Repository navigation
fix: isolate legacy Tinker branch contexts - #1114
Merged
Merged
Conversation
bradhilton
force-pushed
the
tarkin/tinker-service-branch-masks
branch
2 times, most recently
from
October 10, 2026 17:35
bbfe7c6 to
b55b15d
Compare
bradhilton
force-pushed
the
tarkin/tinker-service-branch-masks
branch
from
October 10, 2026 18:58
b55b15d to
c923cb4
Compare
bradhilton
marked this pull request as ready for review
October 10, 2026 19:26
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.
Agent: Tarkin
Part of #1111 (item 9).
Problem: The legacy Tinker service splits each packed row into one datum per branch. It built each branch's mask as
(group == g) | (parent == parent(g)). Prefix-tree roots haveparent_id == group_id, so that mask pulled sibling branches into every datum's context, and the root's datum covered the whole row. Targets were also shifted across the whole packed row before masking, so a branch's first target could be a sibling's token.Behavior after this change: Each datum now contains exactly its branch and that branch's ancestors, read from the packer's own prefix-tree segments (
parse_prefix_tree_row). Targets are shifted within each datum. Optimizer stepping is unchanged: ART's gradient accumulation is fixed at one packed sequence since #808, so there is still one optimizer step per packed row.Validation:
tests/unit/test_tinker_service_training.pyruns the real packer and loss callback against a fake Tinker client. It covers two siblings, a deeper tree, separate roots and padding, checking each datum's inputs, targets and weights, plus the per-row optimizer count. 3 of its 4 tests fail on main.Limitations: Tested against a fake client only, with no live Tinker run. Prompt-only root datums are still sent, as before.