Skip to content

refactor(storage): deprecate LogicalDType, fromDType/toLogicalDType, logicalType getters and overloads (SKEEP-003 P0, S0.2b) - #1058

Closed
michalharakal wants to merge 8 commits into
feature/1013-skainet-plan-clifrom
develop
Closed

michalharakal wants to merge 8 commits into
feature/1013-skainet-plan-clifrom
develop

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Summary

SKEEP-003 slice S0.2b (milestone M0 #1001, decision #13), the last Phase-0 step: with the two-way bridge (#1045), the DType witness (#1050), Format (#1051) and AllocationSpec (#1053) in place, nothing new is written against LogicalDType — so it is now deprecated, additively.

  • @Deprecated(WARNING, ReplaceWith("DType")) on LogicalDType, LogicalDType.fromDType, DType.toLogicalDType(), the logicalType properties of TensorStorage / StorageMemoryReport, the LogicalDType overloads of TensorStorageFactory (fromRawBytes, fromRawBytesOwned, fileBacked) and PackedBlockStorage.toTensorStorage(logicalType, …).
  • Nothing removed: the primary constructors keep LogicalDType (a data-class constructor cannot change compatibly) and every shim delegates to the dtype-first API; removal is scheduled for the next major (deprecate-don't-delete).
  • The files that implement the legacy surface (LogicalDType.kt, LogicalDTypeBridge.kt, TensorStorage.kt, StorageMemoryReport.kt, TensorStorageFactory.kt, PackedBlockStorage.kt, StorageSpec.kt) and the 16 tests that keep it covered carry a file-level @Suppress("DEPRECATION") with the reason; the rest of the build is deprecation-warning-free for LogicalDType (checked on the JVM compile log).
  • No BCV change (annotations are not part of the dumps); no CHANGELOG edit.

Stacked on #1057 (S0.8); retarget to develop after it merges.

Test plan

Full local gate (scripts/pr-gate.sh, JDK 25); results in the first comment. Targeted: lang-core storage/types + io-gguf + io-safetensors jvmTest 503/503.

Closes #1014

🤖 Generated with Claude Code

michalharakal and others added 2 commits August 22, 2026 21:05
…itness

feat(types): DType carries its KClass witness; dtype-first storage constructors and loaders (SKEEP-003 P0, S0.2a)
…ration (#1005 follow-up)

Reference numbers recorded on develop @ 5611b91 before the M1 Storage /
TensorView façade and registry-dispatch slices: the jvm-cpu-jmh suite
(MatmulBench, KernelMatmulBench, QuantizedMatmulBench, ElementwiseAdd1MBench,
Reductions1MBench; fork 1, 3 warmup, 5 measurement iterations), run with
nothing else building on the machine. Later slices compare against this
table (decision #6: matmul within noise, elementwise <= 3 %).

The kotlinx-benchmark StorageBenchmarks suite is not included: with the
module's default iteration settings a full run takes hours; run it filtered
per class when a slice touches the storage hot paths.

Refs #1005

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@michalharakal

Copy link
Copy Markdown
Contributor Author

Local gate scripts/pr-gate.sh (JDK 25) on the pre-rebase tree ae658b16 (identical sources; the rebase onto the updated chain only changed upstream API dumps):

=== pr-gate: JVM tests ===                                      BUILD SUCCESSFUL in 6m 29s
=== pr-gate: apiCheck ===                                       BUILD SUCCESSFUL in 1m 49s
=== pr-gate: verifyNpmPins jsTest wasmJsTest wasmWasiTest ===   BUILD SUCCESSFUL in 2m 36s
=== pr-gate: linuxX64Test ===                                   BUILD SUCCESSFUL in 1m 30s
=== pr-gate: assemble ===                                       BUILD SUCCESSFUL in 2m 10s
=== pr-gate: :skainet-test:skainet-test-java:test ===           BUILD SUCCESSFUL in 21s
pr-gate: all legs passed.

A --quick re-run (jvmTest + apiCheck) on the rebased tip follows in the next comment.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@michalharakal

Copy link
Copy Markdown
Contributor Author

Confirmation on the rebased tip eda8cad: scripts/pr-gate.sh --quick — jvmTest ✔ · apiCheck ✔ (all tasks up-to-date/from cache against the full run above; the rebase changed no source).

…and-encoding

feat(memory): Format(dtype, encoding), TensorData.encoding, Tensor/TensorStorage.format (SKEEP-003 P1, S0.4)
…baseline

docs(memory): JMH benchmark baseline 2026-08-22 (SKEEP-003 #1005 follow-up)
feat(tensor): TensorId — structured identity from the module tree, assignTensorIds, describe() renderer (SKEEP-003 P1, S0.5)
…memap

feat(io): NameMap — GGUF/HF tensor names ↔ TensorId for Llama, Qwen2, Gemma-3; unmapped reported (SKEEP-003 P1, S0.6)
…plan

feat(memory): MemoryPlan from the GGUF header — weights, KV, forward slab, budget fit, suggestions (SKEEP-003 P1, S0.7)
…-plan-cli

feat(apps): skainet-plan CLI — memory plan of a GGUF from its header, budget fit, suggestions, tensor list by TensorId (SKEEP-003 M0, S0.8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants