Repository navigation
core/deltanet: the wide prompt chain keeps up to four marks (MK[4]), each mark's state and conv window as a segment ending there leaves them - #851
Merged
Conversation
…each mark's state and conv window as a segment ending there leaves them tf_delta_gdn_chain_wide_marks stores the state after each marked row, tf_delta_gdn_mark_conv the conv window conv_commit would leave there; tf_delta_gdn_chain_wide is the same scan without marks. test-deltanet-marks checks both against segments that end at the mark, on synthetic rows.
ashhart
added a commit
that referenced
this pull request
Oct 16, 2026
…build step) Layout only: trailing commas and zig fmt in the Zig files, three Metal statements broken across lines; the code is unchanged.
ashhart
added a commit
that referenced
this pull request
Oct 16, 2026
Owner
|
Thank you, @jschmied. Keeping up to four marks in the wide prompt scan, each holding exactly the state and conv window a segment ending there would leave, is the piece prompt reuse needs before a family can resume from inside a chunk, and your synthetic check pins it mark by mark. Your commit ships in TensorFold 1.0.12 as it is, merged in The marks check gave equal words for every mark set we ran (none, first, last, interior, four, and one segment) on an M3 Ultra and an M5 Ultra. No model calls the marks yet. Posted by Ash's AI Assistant Synthena |
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
…check, build step) Layout only: trailing commas and zig fmt in the Zig files, three Metal statements broken across lines; the code is unchanged.
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
…shhart#862, ashhart#863, ashhart#864, ashhart#866, ashhart#821, ashhart#822, ashhart#823, ashhart#851, ashhart#738, ashhart#523, ashhart#547 and ashhart#875, with the HIP and loader fixes
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.
What this changes
Step 1 of #548: the shared DeltaNet prompt scan can store its recurrent state and conv window at up to four rows of a call (Flash Next's
MK[4]convention), each byte-equal to what a chunk ending at that row leaves.zig/kernels/metal/core/deltanet.metal: the loop oftf_delta_gdn_chain_widemoves intotf_delta_gdn_chain_wide_body<bool M>.tf_delta_gdn_chain_wideisbody<false>with the same buffers 0-9 as before. The newtf_delta_gdn_chain_wide_marks(body<true>) adds buffer 10, oneuint4mark list per segment (rows of that segment, 0 unused), and buffer 11, the state at each mark; a mark stores whenmarks[m] == node + 1. The newtf_delta_gdn_mark_convwrites the conv window at each mark, read astf_delta_gdn_conv_commitreads it for a keep ending at that row.zig/src/core/deltanet_kernels.zig: the two kernels,MARKS = 4, andmarkList, which refuses marks that are not ascending, zero, past the rows, or more than four.zig/tests/deltanet_marks.zigand thetest-deltanet-marksstep.No caller passes marks yet, so nothing served changes. The 27B keeping its prompt-cache marks inside one call (
qwen27_slots.zig) follows separately, once it can be checked on a 27B.Receipt
c7137bb3plus this commit, native Metal engine, Apple M3 Pro (36 GB), macOS 26.7.1, Xcode 27.0 (metal 32023.921), Zig 0.17.0. No checkpoint: model-free tests.zig build test-deltanet-marksruns two segments in one call (24 rows from slot 0, 17 from slot 1; 1 key / 2 value heads, dk = dv = 128, 4 taps), with marks none, first row, last row, interior, four, and one segment only. Each mark's state equalstf_delta_gdn_chain_wide's end state, and its conv window equalstf_delta_gdn_conv_commit's, for a segment ending at that row, byte for byte: 16 marks, 0 mismatches. The marked call's outputs and end states equal the unmarked call's, and unused mark slots stay untouched.tf_delta_gdn_chain_wide's body is the same 186 instructions (alias-scope metadata aside).tf-qwen27-synthetic,-served-check,-dflash-served-check,-lanes-checkand-dflash-synthetic(the 27B's GDN shape, 16 key / 48 value heads) pass with byte-identical output on main and this branch.zig build test162/162 steps, 1,947 of 1,955 tests passed, 8 skipped.zig fmt --checkclean.lean_check.py: 527 findings, as onmain.tf-qwen27-reuse. M1, M2, M4 and M5. CUDA (Metal only).Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (No serving path changes.)