Skip to content

prompt radix: a checkpoint inside a page keeps a writable tail, a held copy never written again (#2444 P2, C4) - #3329

Merged
ashhart merged 6 commits into
ashhart:mainfrom
laudney:radix-c4-tails
Nov 19, 2026
Merged

ashhart merged 6 commits into
ashhart:mainfrom
laudney:radix-c4-tails

Conversation

@laudney

@laudney laudney commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

P2 of #2444, its third and last step: writable tails (C4) in the core radix store. A checkpoint may now sit inside a page. The store holds a copy of that page's valid rows and never writes it again. No store user turns tails on in this step, so every current user stays byte-equal.

Before (#2888) After, for a store that declares tails
Where a checkpoint sits a page edge on the request's chunk schedule any row on the request's chunk schedule: any row unplanned, a request start or a grid row planned
The page a checkpoint ends inside not kept: the mark floors to its page edge a tail: one store-held copy a prefix group, rows [0, r) copied by the family's copy_rows, never written after that keep
A hit the deepest entry at a matched page edge the same, or a deeper tail at a matched edge whose rows, lookahead words, images and namespace the prompt repeats
A resume at a tail n/a the path to the edge is adopted; the tail's page comes back as a Copy the stream makes into a page of its own promise, then finish releases the source
Room, eviction, reclaim parts count in the limits and go first in reclaim tails count and go the same way; the root is a leaf for its tails
A store without tails the same marks, hits, keeps, eviction order and reclaim as #2888

A tail is a separate entry on the node that ends at its page edge, so one edge can hold its own entry and several tails. Copies and copy_rows number the part groups first and prefix group p as parts.len + p, so #2875's part numbering stands. The family view (kv_prompts.zig) does not change yet: no family's mark leaves a page edge until one declares copy_rows.

Checks on this head

Receipt

Store user Device Store on Evicting Unset Off
Qwen 3.6 35B-A3B NVFP4 (TF_QWEN_KV_SHARE) GB10 equal equal equal equal
GLM-5.3-Flash NVFP4 (TF_KV_SHARE), TP=2 2 × GB10 equal equal equal equal
Kolibri-1 FP8 (TF_KV_SHARE) GB10 equal equal equal equal
Gemma 4 31B MLX 4-bit (TF_KV_SHARE) GB10 equal equal equal equal
Nemotron 3.5 Lightning MLX 4-bit, HIP store gfx1201 equal equal n/a equal
Qwen 3.5 9B MLX 4-bit, HIP store gfx1201 equal equal (too small to keep) n/a equal

GLM at TP=2 with --vision, a long shared text then picture A, picture B at the same position, A again: equal, cached 0 / 6144 / 8192 on both heads.

Host: the store's tests (74) and the kv-pool checks (28): the same off-page position marks a tail with tails and its page edge without; a tail resumed by a prompt that diverges past its rows and missed by one that diverges inside them; a tail inside the first page (on the root) kept, found, resumed, evicted and reclaimed; three tails on one edge, the deepest usable chosen under a request's starts; a tail at a grid row inside a request's chunk refused; a page-only store with and without state slots; tails refused without copy_rows or a pool that holds pages; a window group with other rows a page copying its own rows at a tail and at an edge; hold, copy and allocation failures that leave nothing held; supersession only under the tail's own key and namespace; over a real pool, the private copy taken from the stream's promise and trimmed back on failure, the store's copy never written, and an idle tail reclaimed first. Planted removals (tail words ignored, tails' cut rules ignored, tails skipped by reclaim, the tail's Ns or lookahead ignored in eviction) each fail their tests.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Resumed equals fresh, above; the rest not run.)
  • No precision traded for speed.
  • Decode and prompt processing are no slower than main at one stream and the widest admitted. (One stream only.)

@ashhart

ashhart commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Thanks @laudney. The tail keeps a separate store-held copy, resumes through a page from the stream's own promise, and fences copies before releasing their sources. The 74 radix cases, 28 pool cases and focused pool/adapter checks pass, including root tails, failure cleanup and namespace/lookahead matching. No current family enables tails. The shared store paths still need the pending CUDA cache regression checks against #2888; we will run those on our side. No requested source changes.

  • Synthena (Ash's Agent)

@laudney
laudney marked this pull request as ready for review November 14, 2026 13:12
@laudney

laudney commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

@ashhart #2888 is in main, so I rebased this PR onto main 93de4c724. The new head is e16e223e25, and it holds only this PR's two commits. git range-diff shows both commits unchanged. zig build test test-kv-pool test-cuda-host passes: 716/716 steps. Nothing else changed.

@ashhart

ashhart commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Thanks @laudney, the rebase reads right, both commits unchanged and the full host suite green on the new head. Nothing new to review in the change itself.

What is left is ours: the CUDA cache regression checks against the landed base that we said we would run, on this head. Once they pass this goes into the queue, and no family turns tails on in this step, so nothing served moves a token meanwhile.

  • Synthena

@ashhart

ashhart commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Thanks @laudney. The rebase holds both commits unchanged, and the full host suite is green on the new head. The tail keeps its own store-held copy, resumes through a page from the stream's own promise, and is counted in reclaim; the planted removals each fail their tests. No family turns tails on in this step, and the posted token hashes and cached counts equal the base.

Nothing further is needed from you. We will run the cache regression checks on our side.

  • Synthena

ashhart and others added 6 commits November 19, 2026 13:47
C4 of ashhart#2444: a store that declares tails cuts at any row its request
schedule allows, and a keep off a page edge holds one copy of the
partial page per prefix group, made by copy_rows and never written
again; a later prompt that repeats those rows, their lookahead,
images and namespace resumes there and copies the page into its own.
Tails count in the page limits, reclaim and eviction like parts, and
a store without them keeps every mark, hit and eviction of P2.2.
A resume at a tail takes its private page from the stream's promise,
trims it back on failure, and leaves the store's copy unwritten; an
idle tail is reclaimed before a page a stream still maps, so the
pool's census stays exact across the tail's whole life.
@ashhart
ashhart merged commit 6e7f308 into ashhart:main Nov 19, 2026
1 of 10 checks passed
ashhart added a commit that referenced this pull request Nov 19, 2026
@ashhart

ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Thank you @laudney. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

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