feat(tensor): TensorId — structured identity from the module tree, assignTensorIds, describe() renderer (SKEEP-003 P1, S0.5) - #1054
Merged
Conversation
Contributor
Author
|
Local gate Targeted: lang-core |
…signTensorIds, describe() renderer (SKEEP-003 P1) Milestone M0 (#1001), PRD M0-F5, decisions #9/#10: one stable, human- readable identity per tensor, the same whether materialized or symbolic. - sk.ainet.lang.tensor.TensorId(modulePath, parameter, discriminator?): canonical ("model.layers.blk.3.attn.q_proj.weight", "…scores#step=17"), legacyPath() (the slash form bindPaths / WeightNameResolvers use), parse(canonical), fromLegacyPath, withDiscriminator, view(range). Equality and hashing are by canonical string: parse splits dotted module names ("blk.0") into more segments than they were built from, so ids that print the same must be the same id. - Tensor.id: TensorId? default member (null = anonymous); TensorIdBearer { var id } implemented by VoidOpsTensor, OpsBoundTensor (delegates to its origin so ids survive re-binding) and the context-factory origin. - ModuleNode.assignTensorIds(root = name): TensorIdAssignment — explicit, idempotent walk; module-path segments equal bindPaths' segments (id.legacyPath() == node.path), parameter = short name ("<module>.weight" -> weight); tensors that cannot carry an id are reported in notCarried. No runtime code path changes (M0-A5). - Tensor.describe() / TensorStorage.describe(id) (sk.ainet.lang.memory): "TensorId · Format · Shape · storage kind · origin · scope · StorageId", with — for the M1-only fields. - Tests: TensorIdTest, AssignTensorIdsTest, DescribeTest. BCV lang-core jvm dump regenerated (additions; VoidOpsTensor/OpsBoundTensor gain the TensorIdBearer interface). Closes #1010 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
michalharakal
force-pushed
the
feature/1010-tensor-id
branch
from
August 22, 2026 21:08
e821ffb to
6ca4ed9
Compare
Contributor
Author
|
Rebased onto the updated base after #1053 merged into |
This was referenced Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SKEEP-003 slice S0.5 (milestone M0 #1001, PRD M0-F5; decisions #9/#10):
TensorId— one stable, human-readable identity per tensor derived from the model structure — plus thedescribe()debugger renderer.sk.ainet.lang.tensor.TensorId(modulePath, parameter, discriminator?): structured, withcanonical(model.layers.blk.3.attn.q_proj.weight,…scores#step=17),legacyPath()(the slash formbindPaths/ theWeightNameResolvers use:MLP/blk.0/attn),parse(canonical),fromLegacyPath(path, parameter),withDiscriminator,view(range).Tensor.id: TensorId?default member (null= anonymous —a matMul bin a notebook stays free);TensorIdBearer { var id }implemented byVoidOpsTensor,OpsBoundTensor(delegates to its origin so ids survive re-binding to another context) and the context-factory origin tensor.ModuleNode.assignTensorIds(root = name): TensorIdAssignment— explicit, idempotent walk over the module tree: module-path segments are exactlybindPaths' segments (id.legacyPath() == node.path), parameter = short name ("<module>.weight"→weight); tensors that cannot carry an id are reported innotCarried, all are in thetensorsmap (ids["model.layers.blk.0.attn.weight"]). No runtime code path changes (M0-A5).Tensor.describe()/TensorStorage.describe(id)(sk.ainet.lang.memory, opt-in):TensorId · Format · Shape · storage kind · origin · scope · StorageIdwith—for the M1-only fields (scope, storage id); file-backed storage printsMapped · <path> @0x<offset>.TensorIdTest,AssignTensorIdsTest(tree walk, bindPaths parity, idempotence, not-carried, re-binding),DescribeTest.Activation ids (debug-only in eager, always-on when tracing) are the hook
withDiscriminatoris for; wiring them into tracing is P7.toString()is not overridden (existing tests and logs rely on current renderings);describe()is the renderer the IDE/debugger surface (decision #12) builds on.Stacked on #1051 (S0.4 —
Format); retarget todevelopafter it merges.Test plan
Full local gate (
scripts/pr-gate.sh, JDK 25) on the stacked tree; results in the first comment.Closes #1010
🤖 Generated with Claude Code