[GH-ISSUE #4803] [RFC]: Per-sequence state objects and two-stage hit resolution for hybrid/SWA models #1216

Open
opened 2026-10-29 21:24:04 +00:00 by bsakaguchi · 5 comments
Owner

Originally created by @sususama on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4803

Changes proposed

Motivation

Mooncake Store models every cache entry as a paged KV block addressed by a content-addressed prefix chain. That covers full-attention models well. It does not cover models where part of the persistent per-sequence cache is not paged and not addressed by block position.

DeepSeek V4.1-Flash is one such model, and Mooncake already touches this family through the Engram work (#4083, #4692). In V4.1 only the first 20 layers keep a sliding-window KV, the window is 128 tokens plus 6 tokens of speculative-decode rollback, and the retained state is a fixed-length per-sequence slot rather than a page. The open-source DeepInfer release documents the layout precisely in doc/DeepSeek V4.1 Flash 推理部署 Q&A.pdf:

Property | Value -- | -- unit | one fixed-length slot per sequence (StateBlock), not a page persisted content | first 20 layers only persistence granularity | only at 128-token boundaries, and only after the last prefill chunk ring length | 134 (window 128 + rollback 6) on the inference side; 396 on the prefill side bytes per sequence | 20 × 134 × 528 B = 1,415,040 B (MXFP8) medium | host memory of the machine that produced it, plus a directory of which machine holds which key

The same shape appears in Gemma3n/Gemma4, Qwen4-Exp and the rest of the hybrid stack that the SGLang adapters in #4692 already cover.

The object model and the hit semantics are the two halves of one problem, which is why they are in one RFC:

  • Without a state object kind, the hit predicate in stage B has nothing to ask about.
  • Without the predicate, a present block with an absent state resolves to a false long hit, and the engine pays a full prefill for it.

Why the current model cannot express it

  1. The key is wrong. A block object is keyed by a hash chain and means "the prefix up to block N". A state slot is valid for an exact aligned prefix length. Two prefixes sharing blocks 0..N-1 share paged KV but do not necessarily share state validity, because state is only written at aligned boundaries.
  1. The value shape is wrong. It is per-sequence and fixed length, not block_size tokens of paged KV.
  1. Partial validity is inherent. State can be absent while the corresponding block is present, and that is a normal outcome, not a transient failure to be retried.
  1. The placement policy is different. ~1.4 MB per sequence is small enough that replica-in-host-memory plus a cross-machine pull is the right policy, which is nothing like bulk KV placement.
  1. Hit length is decided by one signal only. Today the block chain decides both "how far" and "usable", so there is no way to report "the blocks are here but the tail is not reusable".

Proposed design

A. State object kind

  • Key = (content hash of the prefix at an aligned length, aligned length). Value = opaque fixed-length slot with a declared state_layout (per-layer byte offsets).
  • state_layout is registered per model/checkpoint like a schema, so Store can validate size and reject mismatched producers instead of serving garbage.
  • PUT/GET take a boundary_aligned_length and refuse non-aligned writes, matching the engine-side rule that state is only written on aligned boundaries.
  • A state object has no prefix-extension semantics: it can never answer a hit for a longer prefix, only avoid recomputation for the exact prefix it was written for.

B. Two-stage hit resolution

  • The block chain still decides the hit length.
  • State presence decides only whether the last block is usable.
  • When state is missing, stepping back one block lets the engine recompute a bounded amount instead of the whole prefix.

The engine-side counterpart is "replay only the last window tokens, with the attention window truncated inside the replay segment", which makes the recompute cost independent of context length. That stays engine work; this RFC is about the storage shape and the reported hit length.

C. Lifetime and placement

  • TTL may differ from block KV. The reference deployment uses 3 days for agent traffic and 7 days for chatbot traffic, while the bulk store runs a longer LRU-based retention; the two lifetimes are managed separately.
  • Eviction coupling between a state object and its block prefix is an open question below, not an assumption here.
  • The payload is small and node-local in the reference design, with a directory recording which machine holds which key. Whether that directory is the Master or a side structure is an open question.

What this unlocks

Without it, a hybrid/SWA model on Mooncake gets either (a) SWA bytes smuggled into a block object, which inflates payload and breaks block reuse, or (b) no prefix reuse at all for the layers that need it. With it, prefix reuse for these models costs ~1.4 MB per cached sequence and the router stops advertising matches the engine cannot use.

The asymmetry is the reason to bother: a false long hit costs a full prefill, a conservative short hit costs one block of recompute.

Relationship to existing work

  • #4083 / #4692: Engram tables are already a non-block object kind in Store, so the "second object kind" precedent exists.
  • #4242: the state object is small and contiguous, so it needs no scatter path; the transport side has no new requirement.
  • #131 discusses cache hit rate under cache-aware scheduling; that is a different cause (scheduling), but the router-side effect here is similar in spirit.

Phasing

  1. Store: state object kind, layout registry, aligned PUT/GET validation.
  1. Conductor: the second predicate in the prefix index and the adjusted hit length returned to routers.
  1. Engine adapters: write state on aligned boundaries, replay a bounded suffix on a short hit.

Steps 1 and 2 are independently reviewable; they are one RFC because step 2 is meaningless without step 1, and the step-back granularity in step 2 depends on the alignment rule chosen in step 1.

Non-goals

  • Model-side logic (when to write, what to drop, how to recompute) stays in the engine.
  • No change to paged KV addressing or to the block hash recipe.
  • No decision here on where state replicas live; that is placement policy.
  • Not proposing a new transport; the existing path already covers a small contiguous object.

Open questions

  1. Should state live in Store's object namespace, or in a separate lightweight directory that only maps (prefix, aligned length) to an owner?
  1. Is a per-model state_layout registry acceptable, or should the value stay fully opaque with size validation only?
  1. Eviction: should a state object be evicted together with its block prefix, or independently?
  1. Should the step-back be one block or ceil(window / block_size) blocks? In the reference implementation state is stored at 128-token boundaries with a 128-token window, so one block is enough there; the general rule needs a definition.
  1. Who owns the "window + rollback" constant — model config registered with the Store, or the engine passing it per request?
  1. If state is absent but the engine could rebuild it cheaply from the block chain, should the Store report L1 and let the engine decide? (Pro: fewer conservative step-backs. Con: the router no longer knows the real cost.)

References

  • deepseek-ai/DeepInfer (Apache-2.0): deepinfer/worker/cache_engine.py (StateBlock, select_state_slice_to_store, load_state_from_store_to_prefill_cache) and doc/DeepSeek V4.1 Flash 推理部署 Q&A.pdf.
  • Searched existing issues: no current issue covers non-paged per-sequence state, and none covers hit-length resolution for models that need it.

Before submitting a new issue...

  • Make sure you already searched for relevant issues and read the documentation
Originally created by @sususama on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4803 ### Changes proposed <h2>Motivation</h2><p>Mooncake Store models every cache entry as a paged KV block addressed by a content-addressed prefix chain. That covers full-attention models well. It does not cover models where part of the persistent per-sequence cache is <strong>not paged</strong> and <strong>not</strong> addressed by block position.</p><p>DeepSeek V4.1-Flash is one such model, and Mooncake already touches this family through the Engram work (#4083, #4692). In V4.1 only the first 20 layers keep a sliding-window KV, the window is 128 tokens plus 6 tokens of speculative-decode rollback, and the retained state is a fixed-length per-sequence slot rather than a page. The open-source DeepInfer release documents the layout precisely in <code>doc/DeepSeek V4.1 Flash 推理部署 Q&amp;A.pdf</code>:</p> Property | Value -- | -- unit | one fixed-length slot per sequence (StateBlock), not a page persisted content | first 20 layers only persistence granularity | only at 128-token boundaries, and only after the last prefill chunk ring length | 134 (window 128 + rollback 6) on the inference side; 396 on the prefill side bytes per sequence | 20 × 134 × 528 B = 1,415,040 B (MXFP8) medium | host memory of the machine that produced it, plus a directory of which machine holds which key <p>The same shape appears in Gemma3n/Gemma4, Qwen4-Exp and the rest of the hybrid stack that the SGLang adapters in #4692 already cover.</p><p>The object model and the hit semantics are the two halves of one problem, which is why they are in one RFC:</p><ul><li>Without a state object kind, the hit predicate in stage B has nothing to ask about.</li></ul><ul><li>Without the predicate, a present block with an absent state resolves to a <strong>false long hit</strong>, and the engine pays a full prefill for it.</li></ul><h2>Why the current model cannot express it</h2><ol><li><strong>The key is wrong.</strong> A block object is keyed by a hash chain and means "the prefix up to block N". A state slot is valid for an exact aligned prefix length. Two prefixes sharing blocks 0..N-1 share paged KV but do not necessarily share state validity, because state is only written at aligned boundaries.</li></ol><ol><li><strong>The value shape is wrong.</strong> It is per-sequence and fixed length, not <code>block_size</code> tokens of paged KV.</li></ol><ol><li><strong>Partial validity is inherent.</strong> State can be absent while the corresponding block is present, and that is a normal outcome, not a transient failure to be retried.</li></ol><ol><li><strong>The placement policy is different.</strong> ~1.4 MB per sequence is small enough that replica-in-host-memory plus a cross-machine pull is the right policy, which is nothing like bulk KV placement.</li></ol><ol><li><strong>Hit length is decided by one signal only.</strong> Today the block chain decides both "how far" and "usable", so there is no way to report "the blocks are here but the tail is not reusable".</li></ol><h2>Proposed design</h2><h3>A. State object kind</h3><ul><li>Key = (content hash of the prefix at an aligned length, aligned length). Value = opaque fixed-length slot with a declared <code>state_layout</code> (per-layer byte offsets).</li></ul><ul><li><code>state_layout</code> is registered per model/checkpoint like a schema, so Store can validate size and reject mismatched producers instead of serving garbage.</li></ul><ul><li>PUT/GET take a <code>boundary_aligned_length</code> and refuse non-aligned writes, matching the engine-side rule that state is only written on aligned boundaries.</li></ul><ul><li>A state object has <strong>no prefix-extension semantics</strong>: it can never answer a hit for a longer prefix, only avoid recomputation for the exact prefix it was written for.</li></ul><h3>B. Two-stage hit resolution</h3><pre><code></code></pre><ul><li>The block chain still decides the hit length.</li></ul><ul><li>State presence decides only whether the last block is usable.</li></ul><ul><li>When state is missing, stepping back one block lets the engine recompute a bounded amount instead of the whole prefix.</li></ul><p>The engine-side counterpart is "replay only the last <code>window</code> tokens, with the attention window truncated inside the replay segment", which makes the recompute cost independent of context length. That stays engine work; this RFC is about the storage shape and the reported hit length.</p><h3>C. Lifetime and placement</h3><ul><li>TTL may differ from block KV. The reference deployment uses 3 days for agent traffic and 7 days for chatbot traffic, while the bulk store runs a longer LRU-based retention; the two lifetimes are managed separately.</li></ul><ul><li>Eviction coupling between a state object and its block prefix is an open question below, not an assumption here.</li></ul><ul><li>The payload is small and node-local in the reference design, with a directory recording which machine holds which key. Whether that directory is the Master or a side structure is an open question.</li></ul><h2>What this unlocks</h2><p>Without it, a hybrid/SWA model on Mooncake gets either (a) SWA bytes smuggled into a block object, which inflates payload and breaks block reuse, or (b) no prefix reuse at all for the layers that need it. With it, prefix reuse for these models costs ~1.4 MB per cached sequence and the router stops advertising matches the engine cannot use.</p><p>The asymmetry is the reason to bother: a false long hit costs a full prefill, a conservative short hit costs one block of recompute.</p><h2>Relationship to existing work</h2><ul><li>#4083 / #4692: Engram tables are already a non-block object kind in Store, so the "second object kind" precedent exists.</li></ul><ul><li>#4242: the state object is small and contiguous, so it needs no scatter path; the transport side has no new requirement.</li></ul><ul><li>#131 discusses cache hit rate under cache-aware scheduling; that is a different cause (scheduling), but the router-side effect here is similar in spirit.</li></ul><h2>Phasing</h2><ol><li><strong>Store</strong>: state object kind, layout registry, aligned PUT/GET validation.</li></ol><ol><li><strong>Conductor</strong>: the second predicate in the prefix index and the adjusted hit length returned to routers.</li></ol><ol><li><strong>Engine adapters</strong>: write state on aligned boundaries, replay a bounded suffix on a short hit.</li></ol><p>Steps 1 and 2 are independently reviewable; they are one RFC because step 2 is meaningless without step 1, and the step-back granularity in step 2 depends on the alignment rule chosen in step 1.</p><h2>Non-goals</h2><ul><li>Model-side logic (when to write, what to drop, how to recompute) stays in the engine.</li></ul><ul><li>No change to paged KV addressing or to the block hash recipe.</li></ul><ul><li>No decision here on where state replicas live; that is placement policy.</li></ul><ul><li>Not proposing a new transport; the existing path already covers a small contiguous object.</li></ul><h2>Open questions</h2><ol><li>Should state live in Store's object namespace, or in a separate lightweight directory that only maps (prefix, aligned length) to an owner?</li></ol><ol><li>Is a per-model <code>state_layout</code> registry acceptable, or should the value stay fully opaque with size validation only?</li></ol><ol><li>Eviction: should a state object be evicted together with its block prefix, or independently?</li></ol><ol><li>Should the step-back be one block or <code>ceil(window / block_size)</code> blocks? In the reference implementation state is stored at 128-token boundaries with a 128-token window, so one block is enough there; the general rule needs a definition.</li></ol><ol><li>Who owns the "window + rollback" constant — model config registered with the Store, or the engine passing it per request?</li></ol><ol><li>If state is absent but the engine could rebuild it cheaply from the block chain, should the Store report <code>L1</code> and let the engine decide? (Pro: fewer conservative step-backs. Con: the router no longer knows the real cost.)</li></ol><h2>References</h2><ul><li>deepseek-ai/DeepInfer (Apache-2.0): <code>deepinfer/worker/cache_engine.py</code> (<code>StateBlock</code>, <code>select_state_slice_to_store</code>, <code>load_state_from_store_to_prefill_cache</code>) and <code>doc/DeepSeek V4.1 Flash 推理部署 Q&amp;A.pdf</code>.</li></ul><ul><li>Searched existing issues: no current issue covers non-paged per-sequence state, and none covers hit-length resolution for models that need it.</li></ul><sc-clipboard block-data="[{&quot;blockId&quot;:&quot;73gQKHG2RKqFPjpSOMqPMY&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;73gQKHG2RKqFPjpSOMqPMY&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;73gQKHG2RKqFPjpSOMqPMY&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header2&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Motivation&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;ZKX58lNH4sDpnyvPsAvli7&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;ZKX58lNH4sDpnyvPsAvli7&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;ZKX58lNH4sDpnyvPsAvli7&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Mooncake Store models every cache entry as a paged KV block addressed by a content-addressed prefix chain. That covers full-attention models well. It does not cover models where part of the persistent per-sequence cache is &quot;,null],[&quot;not paged&quot;,[[&quot;b&quot;]]],[&quot; and &quot;,null],[&quot;not&quot;,[[&quot;b&quot;]]],[&quot; addressed by block position.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;aCVyOgq9pAvoVhssuC6k10&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;aCVyOgq9pAvoVhssuC6k10&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;aCVyOgq9pAvoVhssuC6k10&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;DeepSeek V4.1-Flash is one such model, and Mooncake already touches this family through the Engram work (#4083, #4692). In V4.1 only the first 20 layers keep a sliding-window KV, the window is 128 tokens plus 6 tokens of speculative-decode rollback, and the retained state is a fixed-length per-sequence slot rather than a page. The open-source DeepInfer release documents the layout precisely in &quot;,null],[&quot;doc/DeepSeek V4.1 Flash 推理部署 Q&amp;A.pdf&quot;,[[&quot;c&quot;]]],[&quot;:&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;simple_table&quot;,&quot;props&quot;:{&quot;tableColumnOrder&quot;:[&quot;ffewgMo5&quot;,&quot;YWZO3nM9&quot;],&quot;tableColumnWidthMap&quot;:{&quot;ffewgMo5&quot;:120,&quot;YWZO3nM9&quot;:120},&quot;tableRowHeader&quot;:true},&quot;children&quot;:[&quot;lgZgApM9Iam6KPHkHRfoTD&quot;,&quot;pNYI3X4wUwWSGCEhkMFOUf&quot;,&quot;hAr9EqLsHmkBgBFsi2PLmz&quot;,&quot;dHPmSRlesSfgax4rMziviR&quot;,&quot;MovXBzSvup1lzs84piYweQ&quot;,&quot;ZiF2lmZV4RQlMTwOBABsl9&quot;,&quot;J6Ckcok9T4L5TSx7BOzmbb&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;lgZgApM9Iam6KPHkHRfoTD&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;lgZgApM9Iam6KPHkHRfoTD&quot;,&quot;parentId&quot;:&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;,&quot;type&quot;:&quot;simple_table_row&quot;,&quot;props&quot;:{},&quot;children&quot;:[&quot;TEpm9Gakg23vofECfAmpKu&quot;,&quot;USaC5Aci2HYJ3Ss0gOspsv&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;TEpm9Gakg23vofECfAmpKu&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;TEpm9Gakg23vofECfAmpKu&quot;,&quot;parentId&quot;:&quot;lgZgApM9Iam6KPHkHRfoTD&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;ffewgMo5&quot;},&quot;children&quot;:[&quot;lewb9It8bETlnplt1TvFEl&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;lewb9It8bETlnplt1TvFEl&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;lewb9It8bETlnplt1TvFEl&quot;,&quot;parentId&quot;:&quot;TEpm9Gakg23vofECfAmpKu&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Property&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;USaC5Aci2HYJ3Ss0gOspsv&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;USaC5Aci2HYJ3Ss0gOspsv&quot;,&quot;parentId&quot;:&quot;lgZgApM9Iam6KPHkHRfoTD&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;YWZO3nM9&quot;},&quot;children&quot;:[&quot;4y47cW87yxwVqPwK7Py7m5&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;4y47cW87yxwVqPwK7Py7m5&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;4y47cW87yxwVqPwK7Py7m5&quot;,&quot;parentId&quot;:&quot;USaC5Aci2HYJ3Ss0gOspsv&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Value&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;pNYI3X4wUwWSGCEhkMFOUf&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;pNYI3X4wUwWSGCEhkMFOUf&quot;,&quot;parentId&quot;:&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;,&quot;type&quot;:&quot;simple_table_row&quot;,&quot;props&quot;:{},&quot;children&quot;:[&quot;aQXQAjx15vYJMcqBEEYkY4&quot;,&quot;6XWaErUH1hXUbNqgd021E9&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;aQXQAjx15vYJMcqBEEYkY4&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;aQXQAjx15vYJMcqBEEYkY4&quot;,&quot;parentId&quot;:&quot;pNYI3X4wUwWSGCEhkMFOUf&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;ffewgMo5&quot;},&quot;children&quot;:[&quot;VzV0V1hN55yPSGN7LNZsZI&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;VzV0V1hN55yPSGN7LNZsZI&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;VzV0V1hN55yPSGN7LNZsZI&quot;,&quot;parentId&quot;:&quot;aQXQAjx15vYJMcqBEEYkY4&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;unit&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;6XWaErUH1hXUbNqgd021E9&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;6XWaErUH1hXUbNqgd021E9&quot;,&quot;parentId&quot;:&quot;pNYI3X4wUwWSGCEhkMFOUf&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;YWZO3nM9&quot;},&quot;children&quot;:[&quot;FpfTtzDeLGOCVOO4fXPINY&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;FpfTtzDeLGOCVOO4fXPINY&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;FpfTtzDeLGOCVOO4fXPINY&quot;,&quot;parentId&quot;:&quot;6XWaErUH1hXUbNqgd021E9&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;one fixed-length slot per sequence (&quot;,null],[&quot;StateBlock&quot;,[[&quot;c&quot;]]],[&quot;), not a page&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;hAr9EqLsHmkBgBFsi2PLmz&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;hAr9EqLsHmkBgBFsi2PLmz&quot;,&quot;parentId&quot;:&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;,&quot;type&quot;:&quot;simple_table_row&quot;,&quot;props&quot;:{},&quot;children&quot;:[&quot;Z85iZslvKFswF1AwKQAJRT&quot;,&quot;7UaQCtbY9MmDJy1h8iam8l&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;Z85iZslvKFswF1AwKQAJRT&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;Z85iZslvKFswF1AwKQAJRT&quot;,&quot;parentId&quot;:&quot;hAr9EqLsHmkBgBFsi2PLmz&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;ffewgMo5&quot;},&quot;children&quot;:[&quot;CqtcJkPf7rLVEfwXqzfaPQ&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;CqtcJkPf7rLVEfwXqzfaPQ&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;CqtcJkPf7rLVEfwXqzfaPQ&quot;,&quot;parentId&quot;:&quot;Z85iZslvKFswF1AwKQAJRT&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;persisted content&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;7UaQCtbY9MmDJy1h8iam8l&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;7UaQCtbY9MmDJy1h8iam8l&quot;,&quot;parentId&quot;:&quot;hAr9EqLsHmkBgBFsi2PLmz&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;YWZO3nM9&quot;},&quot;children&quot;:[&quot;yEx7RGbQUqS9DIQXEv85ZN&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;yEx7RGbQUqS9DIQXEv85ZN&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;yEx7RGbQUqS9DIQXEv85ZN&quot;,&quot;parentId&quot;:&quot;7UaQCtbY9MmDJy1h8iam8l&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;first 20 layers only&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;dHPmSRlesSfgax4rMziviR&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;dHPmSRlesSfgax4rMziviR&quot;,&quot;parentId&quot;:&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;,&quot;type&quot;:&quot;simple_table_row&quot;,&quot;props&quot;:{},&quot;children&quot;:[&quot;0rMrpdTRU17fYuvlHO1Tqg&quot;,&quot;y2xMHcoKHJfTXX3OEZQoPM&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;0rMrpdTRU17fYuvlHO1Tqg&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;0rMrpdTRU17fYuvlHO1Tqg&quot;,&quot;parentId&quot;:&quot;dHPmSRlesSfgax4rMziviR&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;ffewgMo5&quot;},&quot;children&quot;:[&quot;BJ7tVudMHSncMPl5ydEFeq&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;BJ7tVudMHSncMPl5ydEFeq&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;BJ7tVudMHSncMPl5ydEFeq&quot;,&quot;parentId&quot;:&quot;0rMrpdTRU17fYuvlHO1Tqg&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;persistence granularity&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;y2xMHcoKHJfTXX3OEZQoPM&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;y2xMHcoKHJfTXX3OEZQoPM&quot;,&quot;parentId&quot;:&quot;dHPmSRlesSfgax4rMziviR&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;YWZO3nM9&quot;},&quot;children&quot;:[&quot;yYwKTgMPzSqqm4i2a08Cgf&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;yYwKTgMPzSqqm4i2a08Cgf&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;yYwKTgMPzSqqm4i2a08Cgf&quot;,&quot;parentId&quot;:&quot;y2xMHcoKHJfTXX3OEZQoPM&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;only at 128-token boundaries, and only after the last prefill chunk&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;MovXBzSvup1lzs84piYweQ&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;MovXBzSvup1lzs84piYweQ&quot;,&quot;parentId&quot;:&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;,&quot;type&quot;:&quot;simple_table_row&quot;,&quot;props&quot;:{},&quot;children&quot;:[&quot;zvoWh9XqBR68wCxsZf0iB1&quot;,&quot;08EHLJPcbaEDIYuZXFIjD8&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;zvoWh9XqBR68wCxsZf0iB1&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;zvoWh9XqBR68wCxsZf0iB1&quot;,&quot;parentId&quot;:&quot;MovXBzSvup1lzs84piYweQ&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;ffewgMo5&quot;},&quot;children&quot;:[&quot;jSN45Aost9TH1iY4HtOSbC&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;jSN45Aost9TH1iY4HtOSbC&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;jSN45Aost9TH1iY4HtOSbC&quot;,&quot;parentId&quot;:&quot;zvoWh9XqBR68wCxsZf0iB1&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;ring length&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;08EHLJPcbaEDIYuZXFIjD8&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;08EHLJPcbaEDIYuZXFIjD8&quot;,&quot;parentId&quot;:&quot;MovXBzSvup1lzs84piYweQ&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;YWZO3nM9&quot;},&quot;children&quot;:[&quot;vnrJnHiO0jG0saS3Z7pgIc&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;vnrJnHiO0jG0saS3Z7pgIc&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;vnrJnHiO0jG0saS3Z7pgIc&quot;,&quot;parentId&quot;:&quot;08EHLJPcbaEDIYuZXFIjD8&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;134 (window 128 + rollback 6) on the inference side; 396 on the prefill side&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;ZiF2lmZV4RQlMTwOBABsl9&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;ZiF2lmZV4RQlMTwOBABsl9&quot;,&quot;parentId&quot;:&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;,&quot;type&quot;:&quot;simple_table_row&quot;,&quot;props&quot;:{},&quot;children&quot;:[&quot;zATkLzIc3sRaTnsvyPEBOl&quot;,&quot;4D4H4xZoob5ocXyIw7DbAU&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;zATkLzIc3sRaTnsvyPEBOl&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;zATkLzIc3sRaTnsvyPEBOl&quot;,&quot;parentId&quot;:&quot;ZiF2lmZV4RQlMTwOBABsl9&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;ffewgMo5&quot;},&quot;children&quot;:[&quot;ujUTuQi6IgpTRILMEByYJk&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;ujUTuQi6IgpTRILMEByYJk&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;ujUTuQi6IgpTRILMEByYJk&quot;,&quot;parentId&quot;:&quot;zATkLzIc3sRaTnsvyPEBOl&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;bytes per sequence&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;4D4H4xZoob5ocXyIw7DbAU&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;4D4H4xZoob5ocXyIw7DbAU&quot;,&quot;parentId&quot;:&quot;ZiF2lmZV4RQlMTwOBABsl9&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;YWZO3nM9&quot;},&quot;children&quot;:[&quot;YDQIOOKR6xnXjQN6h7DFh4&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;YDQIOOKR6xnXjQN6h7DFh4&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;YDQIOOKR6xnXjQN6h7DFh4&quot;,&quot;parentId&quot;:&quot;4D4H4xZoob5ocXyIw7DbAU&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;20 × 134 × 528 B = 1,415,040 B (MXFP8)&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;J6Ckcok9T4L5TSx7BOzmbb&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;J6Ckcok9T4L5TSx7BOzmbb&quot;,&quot;parentId&quot;:&quot;C3dzVGGTjG9NyGAl6Bmw0l&quot;,&quot;type&quot;:&quot;simple_table_row&quot;,&quot;props&quot;:{},&quot;children&quot;:[&quot;LaFDipZugLqVjwavFscNn8&quot;,&quot;dEerS1ZgwYAJGMze16nr2A&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;LaFDipZugLqVjwavFscNn8&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;LaFDipZugLqVjwavFscNn8&quot;,&quot;parentId&quot;:&quot;J6Ckcok9T4L5TSx7BOzmbb&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;ffewgMo5&quot;},&quot;children&quot;:[&quot;f8vNOkRrtQLisNIaOWK02A&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;f8vNOkRrtQLisNIaOWK02A&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;f8vNOkRrtQLisNIaOWK02A&quot;,&quot;parentId&quot;:&quot;LaFDipZugLqVjwavFscNn8&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;medium&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;dEerS1ZgwYAJGMze16nr2A&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;dEerS1ZgwYAJGMze16nr2A&quot;,&quot;parentId&quot;:&quot;J6Ckcok9T4L5TSx7BOzmbb&quot;,&quot;type&quot;:&quot;simple_table_cell&quot;,&quot;props&quot;:{&quot;columnKey&quot;:&quot;YWZO3nM9&quot;},&quot;children&quot;:[&quot;ZENAc8G9bvceh8HTTfcuAA&quot;],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}},&quot;ZENAc8G9bvceh8HTTfcuAA&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;ZENAc8G9bvceh8HTTfcuAA&quot;,&quot;parentId&quot;:&quot;dEerS1ZgwYAJGMze16nr2A&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;host memory of the machine that produced it, plus a directory of which machine holds which key&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;ue3zxBTnLdd3c6KOYYrXHn&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;ue3zxBTnLdd3c6KOYYrXHn&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;ue3zxBTnLdd3c6KOYYrXHn&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;The same shape appears in Gemma3n/Gemma4, Qwen4-Exp and the rest of the hybrid stack that the SGLang adapters in #4692 already cover.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;5ZMslE7n2jE0hXIrgU1krU&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;5ZMslE7n2jE0hXIrgU1krU&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;5ZMslE7n2jE0hXIrgU1krU&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;The object model and the hit semantics are the two halves of one problem, which is why they are in one RFC:&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;rI3t6egbaUFcE1D8THmYaY&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;rI3t6egbaUFcE1D8THmYaY&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;rI3t6egbaUFcE1D8THmYaY&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Without a state object kind, the hit predicate in stage B has nothing to ask about.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;6QMjWYJyW4ooO0wUENRzo3&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;6QMjWYJyW4ooO0wUENRzo3&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;6QMjWYJyW4ooO0wUENRzo3&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Without the predicate, a present block with an absent state resolves to a &quot;,null],[&quot;false long hit&quot;,[[&quot;b&quot;]]],[&quot;, and the engine pays a full prefill for it.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;sDZj8IIpERi8uiI370Qvvv&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;sDZj8IIpERi8uiI370Qvvv&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;sDZj8IIpERi8uiI370Qvvv&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header2&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Why the current model cannot express it&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;XGCdrCaYRpq52TbIaiFLbr&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;XGCdrCaYRpq52TbIaiFLbr&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;XGCdrCaYRpq52TbIaiFLbr&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;The key is wrong.&quot;,[[&quot;b&quot;]]],[&quot; A block object is keyed by a hash chain and means \&quot;the prefix up to block N\&quot;. A state slot is valid for an exact aligned prefix length. Two prefixes sharing blocks 0..N-1 share paged KV but do not necessarily share state validity, because state is only written at aligned boundaries.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;hrtfJGWWuRfkkwAXKHf6QE&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;hrtfJGWWuRfkkwAXKHf6QE&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;hrtfJGWWuRfkkwAXKHf6QE&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;The value shape is wrong.&quot;,[[&quot;b&quot;]]],[&quot; It is per-sequence and fixed length, not &quot;,null],[&quot;block_size&quot;,[[&quot;c&quot;]]],[&quot; tokens of paged KV.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;kT8kvgHRbWQI0yZF7rsSVH&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;kT8kvgHRbWQI0yZF7rsSVH&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;kT8kvgHRbWQI0yZF7rsSVH&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Partial validity is inherent.&quot;,[[&quot;b&quot;]]],[&quot; State can be absent while the corresponding block is present, and that is a normal outcome, not a transient failure to be retried.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;W6XBZWG83MLbRt6XBPqHpk&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;W6XBZWG83MLbRt6XBPqHpk&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;W6XBZWG83MLbRt6XBPqHpk&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;The placement policy is different.&quot;,[[&quot;b&quot;]]],[&quot; ~1.4 MB per sequence is small enough that replica-in-host-memory plus a cross-machine pull is the right policy, which is nothing like bulk KV placement.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;1d5YHqQRsid3OG9ZfyfgwX&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;1d5YHqQRsid3OG9ZfyfgwX&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;1d5YHqQRsid3OG9ZfyfgwX&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Hit length is decided by one signal only.&quot;,[[&quot;b&quot;]]],[&quot; Today the block chain decides both \&quot;how far\&quot; and \&quot;usable\&quot;, so there is no way to report \&quot;the blocks are here but the tail is not reusable\&quot;.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;4nll3NLYkIObs0YtznHhyV&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;4nll3NLYkIObs0YtznHhyV&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;4nll3NLYkIObs0YtznHhyV&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header2&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Proposed design&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;tmGYFomJ3DljO8xAemO4N1&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;tmGYFomJ3DljO8xAemO4N1&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;tmGYFomJ3DljO8xAemO4N1&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header3&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;A. State object kind&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;g4QERZ5JFUEo1tmlGhb3Fy&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;g4QERZ5JFUEo1tmlGhb3Fy&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;g4QERZ5JFUEo1tmlGhb3Fy&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Key = (content hash of the prefix at an aligned length, aligned length). Value = opaque fixed-length slot with a declared &quot;,null],[&quot;state_layout&quot;,[[&quot;c&quot;]]],[&quot; (per-layer byte offsets).&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;gDHJ6j4Ymd5EVl0pITGaWS&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;gDHJ6j4Ymd5EVl0pITGaWS&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;gDHJ6j4Ymd5EVl0pITGaWS&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;state_layout&quot;,[[&quot;c&quot;]]],[&quot; is registered per model/checkpoint like a schema, so Store can validate size and reject mismatched producers instead of serving garbage.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;DI8DTiuzxCFr9050hhriQN&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;DI8DTiuzxCFr9050hhriQN&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;DI8DTiuzxCFr9050hhriQN&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;PUT/GET take a &quot;,null],[&quot;boundary_aligned_length&quot;,[[&quot;c&quot;]]],[&quot; and refuse non-aligned writes, matching the engine-side rule that state is only written on aligned boundaries.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;tELdKRV1TbhbZIR9FhkICs&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;tELdKRV1TbhbZIR9FhkICs&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;tELdKRV1TbhbZIR9FhkICs&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;A state object has &quot;,null],[&quot;no prefix-extension semantics&quot;,[[&quot;b&quot;]]],[&quot;: it can never answer a hit for a longer prefix, only avoid recomputation for the exact prefix it was written for.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;3NlLKqo7sFNH3f76LLlyHl&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;3NlLKqo7sFNH3f76LLlyHl&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;3NlLKqo7sFNH3f76LLlyHl&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header3&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;B. Two-stage hit resolution&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;6b0P7hqfjqHQ1zTK1M3K6w&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;6b0P7hqfjqHQ1zTK1M3K6w&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;6b0P7hqfjqHQ1zTK1M3K6w&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;code&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;max_hit <= L - (window + max_rollback) # leave room to replay\nL1 = block_chain_hit_length(...) # multiple of block_size\nif state_present_in([L1 - window, L1]):\n hit = L1\nelse:\n hit = L1 - block_size # step back one block&quot;]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;c93YxDryI0uihKtwVfx23t&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;c93YxDryI0uihKtwVfx23t&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;c93YxDryI0uihKtwVfx23t&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;The block chain still decides the hit length.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;B9txIFgruxr2W0a90HbkVi&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;B9txIFgruxr2W0a90HbkVi&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;B9txIFgruxr2W0a90HbkVi&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;State presence decides only whether the last block is usable.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;gxz8PMLmkORcNRqO81C7pt&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;gxz8PMLmkORcNRqO81C7pt&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;gxz8PMLmkORcNRqO81C7pt&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;When state is missing, stepping back one block lets the engine recompute a bounded amount instead of the whole prefix.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;9jxA3abIA9BgSuNKzikCtI&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;9jxA3abIA9BgSuNKzikCtI&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;9jxA3abIA9BgSuNKzikCtI&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;The engine-side counterpart is \&quot;replay only the last &quot;,null],[&quot;window&quot;,[[&quot;c&quot;]]],[&quot; tokens, with the attention window truncated inside the replay segment\&quot;, which makes the recompute cost independent of context length. That stays engine work; this RFC is about the storage shape and the reported hit length.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;TO4qXBJvDf9ALnNgjaGDnN&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;TO4qXBJvDf9ALnNgjaGDnN&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;TO4qXBJvDf9ALnNgjaGDnN&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header3&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;C. Lifetime and placement&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;TN5tbmUR6jy5jSuxO8kSAE&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;TN5tbmUR6jy5jSuxO8kSAE&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;TN5tbmUR6jy5jSuxO8kSAE&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;TTL may differ from block KV. The reference deployment uses 3 days for agent traffic and 7 days for chatbot traffic, while the bulk store runs a longer LRU-based retention; the two lifetimes are managed separately.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;nrQ2ahvc4KeweQ39A8F7No&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;nrQ2ahvc4KeweQ39A8F7No&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;nrQ2ahvc4KeweQ39A8F7No&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Eviction coupling between a state object and its block prefix is an open question below, not an assumption here.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;r0Zk16jTPQN5N5Pr5wG0lK&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;r0Zk16jTPQN5N5Pr5wG0lK&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;r0Zk16jTPQN5N5Pr5wG0lK&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;The payload is small and node-local in the reference design, with a directory recording which machine holds which key. Whether that directory is the Master or a side structure is an open question.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;fIF77DL46WjL9bYUGQaoRu&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;fIF77DL46WjL9bYUGQaoRu&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;fIF77DL46WjL9bYUGQaoRu&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header2&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;What this unlocks&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;KHLC0TCavmljcr0yeibTWR&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;KHLC0TCavmljcr0yeibTWR&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;KHLC0TCavmljcr0yeibTWR&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Without it, a hybrid/SWA model on Mooncake gets either (a) SWA bytes smuggled into a block object, which inflates payload and breaks block reuse, or (b) no prefix reuse at all for the layers that need it. With it, prefix reuse for these models costs ~1.4 MB per cached sequence and the router stops advertising matches the engine cannot use.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;QZDVkJWmDHkrgZnp0hadYs&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;QZDVkJWmDHkrgZnp0hadYs&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;QZDVkJWmDHkrgZnp0hadYs&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;The asymmetry is the reason to bother: a false long hit costs a full prefill, a conservative short hit costs one block of recompute.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;Rm4rahbmN3yfo9a8A2vbK0&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;Rm4rahbmN3yfo9a8A2vbK0&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;Rm4rahbmN3yfo9a8A2vbK0&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header2&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Relationship to existing work&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;rB389ZRE7yKLTcxLvSD8oe&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;rB389ZRE7yKLTcxLvSD8oe&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;rB389ZRE7yKLTcxLvSD8oe&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;#4083 / #4692: Engram tables are already a non-block object kind in Store, so the \&quot;second object kind\&quot; precedent exists.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;VfQNqtJuNtOU72xreytQwO&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;VfQNqtJuNtOU72xreytQwO&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;VfQNqtJuNtOU72xreytQwO&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;#4242: the state object is small and contiguous, so it needs no scatter path; the transport side has no new requirement.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;1b0q02lmeZHSFJcn4dBsLh&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;1b0q02lmeZHSFJcn4dBsLh&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;1b0q02lmeZHSFJcn4dBsLh&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;#131 discusses cache hit rate under cache-aware scheduling; that is a different cause (scheduling), but the router-side effect here is similar in spirit.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;3f7w9qvGxRW4yEQ5I28kor&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;3f7w9qvGxRW4yEQ5I28kor&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;3f7w9qvGxRW4yEQ5I28kor&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header2&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Phasing&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;h8XAsW5lN6nSPesC6w6iP1&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;h8XAsW5lN6nSPesC6w6iP1&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;h8XAsW5lN6nSPesC6w6iP1&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Store&quot;,[[&quot;b&quot;]]],[&quot;: state object kind, layout registry, aligned PUT/GET validation.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;gzXeLOmuuDeMVhKLUh9uHn&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;gzXeLOmuuDeMVhKLUh9uHn&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;gzXeLOmuuDeMVhKLUh9uHn&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Conductor&quot;,[[&quot;b&quot;]]],[&quot;: the second predicate in the prefix index and the adjusted hit length returned to routers.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;m4ORC3P1172F6cJVx1HpL7&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;m4ORC3P1172F6cJVx1HpL7&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;m4ORC3P1172F6cJVx1HpL7&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Engine adapters&quot;,[[&quot;b&quot;]]],[&quot;: write state on aligned boundaries, replay a bounded suffix on a short hit.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;peKghnOXjqLJVhUJFtc4Cp&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;peKghnOXjqLJVhUJFtc4Cp&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;peKghnOXjqLJVhUJFtc4Cp&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;text&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Steps 1 and 2 are independently reviewable; they are one RFC because step 2 is meaningless without step 1, and the step-back granularity in step 2 depends on the alignment rule chosen in step 1.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;zkjxfWiJtikzvaE54R13ZS&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;zkjxfWiJtikzvaE54R13ZS&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;zkjxfWiJtikzvaE54R13ZS&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header2&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Non-goals&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;5nF7CKjhmJsLUC1iMuRtxa&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;5nF7CKjhmJsLUC1iMuRtxa&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;5nF7CKjhmJsLUC1iMuRtxa&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Model-side logic (when to write, what to drop, how to recompute) stays in the engine.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;gRTzosHSGgS8jGGT80wfB8&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;gRTzosHSGgS8jGGT80wfB8&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;gRTzosHSGgS8jGGT80wfB8&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;No change to paged KV addressing or to the block hash recipe.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;yWU7FP4BxUtVYnRA4cT8NL&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;yWU7FP4BxUtVYnRA4cT8NL&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;yWU7FP4BxUtVYnRA4cT8NL&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;No decision here on where state replicas live; that is placement policy.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;HkeJGyKsmIcl2aylI1c9Kb&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;HkeJGyKsmIcl2aylI1c9Kb&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;HkeJGyKsmIcl2aylI1c9Kb&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Not proposing a new transport; the existing path already covers a small contiguous object.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;LnSi3Ut6tgdTJU5r1Aewdx&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;LnSi3Ut6tgdTJU5r1Aewdx&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;LnSi3Ut6tgdTJU5r1Aewdx&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header2&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Open questions&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;zPLDC4M4TtZCfEngcu7CN4&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;zPLDC4M4TtZCfEngcu7CN4&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;zPLDC4M4TtZCfEngcu7CN4&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Should state live in Store's object namespace, or in a separate lightweight directory that only maps (prefix, aligned length) to an owner?&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;FNfUIhTg54t87aBS5JASFe&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;FNfUIhTg54t87aBS5JASFe&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;FNfUIhTg54t87aBS5JASFe&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Is a per-model &quot;,null],[&quot;state_layout&quot;,[[&quot;c&quot;]]],[&quot; registry acceptable, or should the value stay fully opaque with size validation only?&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;fKvbAuJWXl3ZYsQFG7MFD1&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;fKvbAuJWXl3ZYsQFG7MFD1&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;fKvbAuJWXl3ZYsQFG7MFD1&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Eviction: should a state object be evicted together with its block prefix, or independently?&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;zGAhnAHOU5ELE9XHbxCDBm&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;zGAhnAHOU5ELE9XHbxCDBm&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;zGAhnAHOU5ELE9XHbxCDBm&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Should the step-back be one block or &quot;,null],[&quot;ceil(window / block_size)&quot;,[[&quot;c&quot;]]],[&quot; blocks? In the reference implementation state is stored at 128-token boundaries with a 128-token window, so one block is enough there; the general rule needs a definition.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;KGguvG1oNqxB8AwVpbki2A&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;KGguvG1oNqxB8AwVpbki2A&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;KGguvG1oNqxB8AwVpbki2A&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Who owns the \&quot;window + rollback\&quot; constant — model config registered with the Store, or the engine passing it per request?&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;fSgLrmKZWbk1JiiRL4hW2o&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;fSgLrmKZWbk1JiiRL4hW2o&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;fSgLrmKZWbk1JiiRL4hW2o&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;numbered_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;If state is absent but the engine could rebuild it cheaply from the block chain, should the Store report &quot;,null],[&quot;L1&quot;,[[&quot;c&quot;]]],[&quot; and let the engine decide? (Pro: fewer conservative step-backs. Con: the router no longer knows the real cost.)&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;D3DvqlEdnEvfjW5mB2qApZ&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;D3DvqlEdnEvfjW5mB2qApZ&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;D3DvqlEdnEvfjW5mB2qApZ&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;header2&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;References&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;SGbf3wJavvdH7Jjon5b94g&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;SGbf3wJavvdH7Jjon5b94g&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;SGbf3wJavvdH7Jjon5b94g&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;deepseek-ai/DeepInfer (Apache-2.0): &quot;,null],[&quot;deepinfer/worker/cache_engine.py&quot;,[[&quot;c&quot;]]],[&quot; (&quot;,null],[&quot;StateBlock&quot;,[[&quot;c&quot;]]],[&quot;, &quot;,null],[&quot;select_state_slice_to_store&quot;,[[&quot;c&quot;]]],[&quot;, &quot;,null],[&quot;load_state_from_store_to_prefill_cache&quot;,[[&quot;c&quot;]]],[&quot;) and &quot;,null],[&quot;doc/DeepSeek V4.1 Flash 推理部署 Q&amp;A.pdf&quot;,[[&quot;c&quot;]]],[&quot;.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}},{&quot;blockId&quot;:&quot;YR8fOa0920PXxMf4NSCu9Q&quot;,&quot;blockSubtree&quot;:{&quot;block&quot;:{&quot;YR8fOa0920PXxMf4NSCu9Q&quot;:{&quot;role&quot;:&quot;editor&quot;,&quot;value&quot;:{&quot;id&quot;:&quot;YR8fOa0920PXxMf4NSCu9Q&quot;,&quot;parentId&quot;:&quot;&quot;,&quot;type&quot;:&quot;bulleted_list&quot;,&quot;props&quot;:{&quot;title&quot;:[[&quot;Searched existing issues: no current issue covers non-paged per-sequence state, and none covers hit-length resolution for models that need it.&quot;,null]]},&quot;children&quot;:[],&quot;parentTable&quot;:&quot;block&quot;,&quot;enabled&quot;:true}}}}}]"></sc-clipboard> ### Before submitting a new issue... - [ ] Make sure you already searched for relevant issues and read the [documentation](https://kvcache-ai.github.io/Mooncake/)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 20, 2026):

Thanks for opening this issue, @sususama!

Field Value
Issue #4803
GitHub user ID 52159774
Reporter @sususama

A maintainer will triage this when possible. To help us respond faster, please include:

  • Mooncake version or commit SHA
  • Environment (OS, CUDA/driver, RDMA stack if relevant)
  • Steps to reproduce and expected vs. actual behavior

Useful links: Documentation · Contributing guide

This message was posted automatically by the issue bot.

<!-- gh-comment-id:6289367419 --> @github-actions[bot] commented on GitHub (Oct 20, 2026): Thanks for opening this issue, @sususama! | Field | Value | |-------|-------| | **Issue** | #4803 | | **GitHub user ID** | `52159774` | | **Reporter** | @sususama | A maintainer will triage this when possible. To help us respond faster, please include: - Mooncake version or commit SHA - Environment (OS, CUDA/driver, RDMA stack if relevant) - Steps to reproduce and expected vs. actual behavior Useful links: [Documentation](https://kvcache-ai.github.io/Mooncake/) · [Contributing guide](https://github.com/kvcache-ai/Mooncake/blob/main/CONTRIBUTING.md) > This message was posted automatically by the issue bot.
Author
Owner

@he-yufeng commented on GitHub (Oct 20, 2026):

The state-validity and routing contract is worth separating from a new Store object kind. Store already accepts arbitrary byte slices under a string key (ObjectKey, Put/Get), so a fixed-size state payload does not by itself require changing that layer. A first adapter could use a separate key namespace containing the checkpoint/layout fingerprint, prefix hash and exact aligned boundary, validate the payload size, and publish availability only after the write completes.

For the lookup result, I would keep block_hit_length separate from state availability and the engine's fallback cost. An engine that supports bounded replay can recover differently from one that requires exact reconstruction; stepping back one block is not a safe general rule for every hybrid/SWA model. That capability and the replay boundary need to come from the engine rather than be inferred from an object's presence.

One source correction for section C: the reported 3/7-day retention is for Block KV. The SWA state in the reference deployment stays in host memory for about 180 seconds. Independent lifetimes are useful here, but those numbers should not become a state-object TTL default. I would pin the adapter's state layout and add hit/missing/expired/mismatched-layout contract tests before deciding whether the Master needs a model-specific layout registry.

<!-- gh-comment-id:6292416828 --> @he-yufeng commented on GitHub (Oct 20, 2026): The state-validity and routing contract is worth separating from a new Store object kind. Store already accepts arbitrary byte slices under a string key ([ObjectKey](https://github.com/kvcache-ai/Mooncake/blob/5ea6cf0d95d3a69b4ba196d28bf1f96e28ec5e10/mooncake-store/include/types.h#L200), [Put/Get](https://github.com/kvcache-ai/Mooncake/blob/5ea6cf0d95d3a69b4ba196d28bf1f96e28ec5e10/mooncake-store/include/client_service.h#L197-L246)), so a fixed-size state payload does not by itself require changing that layer. A first adapter could use a separate key namespace containing the checkpoint/layout fingerprint, prefix hash and exact aligned boundary, validate the payload size, and publish availability only after the write completes. For the lookup result, I would keep `block_hit_length` separate from state availability and the engine's fallback cost. An engine that supports bounded replay can recover differently from one that requires exact reconstruction; stepping back one block is not a safe general rule for every hybrid/SWA model. That capability and the replay boundary need to come from the engine rather than be inferred from an object's presence. One source correction for section C: the reported 3/7-day retention is for Block KV. The SWA state in the reference deployment stays in host memory for about 180 seconds. Independent lifetimes are useful here, but those numbers should not become a state-object TTL default. I would pin the adapter's state layout and add hit/missing/expired/mismatched-layout contract tests before deciding whether the Master needs a model-specific layout registry.
Author
Owner

@sususama commented on GitHub (Oct 21, 2026):

Thanks, this is a useful correction and I'll fold both points in — and I'll write the adapter.

Section A — agreed, no new object kind. ObjectKey is a std::string and Put/Get already take arbitrary byte payloads, so I'll rewrite this as an adapter contract rather than a Store change: a separate key namespace carrying {checkpoint/layout fingerprint, prefix hash at the aligned boundary}, payload-size validation on both sides, and availability published only after the write completes. The state_layout registry becomes an adapter-side pinned constant in v1.

Section B — agreed, and this is the better shape. Store should report facts, not infer policy. Concretely: return block_hit_length and state_available(aligned_length) as separate fields and let the engine combine them with its own replay capability. I'll drop "step back one block" as a Store rule. One note on why both halves are needed: an engine that declares bounded-replay support still cannot act on it if the lookup never reports the state as missing.

Section C — you're right, I had this wrong. The 3/7-day figures are Block KV retention and should not appear as a state TTL default; I'll remove them. For the record, the open release does not pin a constant here: state capacity is a slot pool sized by DEEPINFER_NUM_STATE_SLOTS_RATIO, so residency is driven by pool pressure and request lifetime rather than by time. If the ~180 s figure comes from something citable I'd rather reference it than paraphrase it.

Contract tests — agreed, and I'd start there rather than argue about the registry: hit / missing / expired / layout-mismatch / boundary-misaligned against a pinned layout.

One question before I open anything: should the adapter live on the EngramStore-style path, or as a new lightweight connector under mooncake-integration? Default if you would rather not spend time on this: a new lightweight Python module on the store-facing side (python/mooncake/store/), following structured_object_store.py, because the adapter needs no GPU row gather and put / get / is_exist / get_size are already exposed. I'll proceed that way if I don't hear otherwise; it is easy to move before anything depends on it.

<!-- gh-comment-id:6309550527 --> @sususama commented on GitHub (Oct 21, 2026): Thanks, this is a useful correction and I'll fold both points in — and I'll write the adapter. **Section A — agreed, no new object kind.** `ObjectKey` is a `std::string` and Put/Get already take arbitrary byte payloads, so I'll rewrite this as an adapter contract rather than a Store change: a separate key namespace carrying `{checkpoint/layout fingerprint, prefix hash at the aligned boundary}`, payload-size validation on both sides, and availability published only after the write completes. The `state_layout` registry becomes an adapter-side pinned constant in v1. **Section B — agreed, and this is the better shape.** Store should report facts, not infer policy. Concretely: return `block_hit_length` and `state_available(aligned_length)` as separate fields and let the engine combine them with its own replay capability. I'll drop "step back one block" as a Store rule. One note on why both halves are needed: an engine that declares bounded-replay support still cannot act on it if the lookup never reports the state as missing. **Section C — you're right, I had this wrong.** The 3/7-day figures are Block KV retention and should not appear as a state TTL default; I'll remove them. For the record, the open release does not pin a constant here: state capacity is a slot pool sized by `DEEPINFER_NUM_STATE_SLOTS_RATIO`, so residency is driven by pool pressure and request lifetime rather than by time. If the ~180 s figure comes from something citable I'd rather reference it than paraphrase it. **Contract tests** — agreed, and I'd start there rather than argue about the registry: hit / missing / expired / layout-mismatch / boundary-misaligned against a pinned layout. One question before I open anything: should the adapter live on the `EngramStore`-style path, or as a new lightweight connector under `mooncake-integration`? **Default if you would rather not spend time on this:** a new lightweight Python module on the store-facing side (`python/mooncake/store/`), following `structured_object_store.py`, because the adapter needs no GPU row gather and `put` / `get` / `is_exist` / `get_size` are already exposed. I'll proceed that way if I don't hear otherwise; it is easy to move before anything depends on it.
Author
Owner

@he-yufeng commented on GitHub (Oct 23, 2026):

Confirmed, go with the default: a lightweight module under python/mooncake/store/ following structured_object_store.py. mooncake-integration is the C++/allocator-level surface, and this adapter is exactly the kind of byte-payload contract that belongs on the store-facing Python side. Nothing about it needs the GPU row-gather path.

Two things worth pinning before the first PR lands, both cheap now and expensive to retrofit:

  1. Version the layout fingerprint itself, not just the layout. state_layout as an adapter-side constant is right for v1, but put a scheme/version byte (or a short semver string) into the fingerprint so a v2 layout change reads as a clean miss instead of a collision.
  2. Reserve the key namespace explicitly. A documented prefix (something like state/ plus the fingerprint) keeps adapter keys out of the way of engine-written Block KV keys, and the contract tests should include a namespace-collision case, not only hit/miss/expired/layout-mismatch/boundary-misaligned.

On the TTL point: agreed, leave time-based figures out of the state path entirely. Pool-pressure-driven residency via the slot ratio is the accurate description, and the adapter should treat expiry as an observed fact from is_exist/get_size, never as a duration it assumes.

Looking forward to the contract tests first, as you proposed.

<!-- gh-comment-id:6358873084 --> @he-yufeng commented on GitHub (Oct 23, 2026): Confirmed, go with the default: a lightweight module under `python/mooncake/store/` following `structured_object_store.py`. `mooncake-integration` is the C++/allocator-level surface, and this adapter is exactly the kind of byte-payload contract that belongs on the store-facing Python side. Nothing about it needs the GPU row-gather path. Two things worth pinning before the first PR lands, both cheap now and expensive to retrofit: 1. Version the layout fingerprint itself, not just the layout. `state_layout` as an adapter-side constant is right for v1, but put a scheme/version byte (or a short semver string) into the fingerprint so a v2 layout change reads as a clean miss instead of a collision. 2. Reserve the key namespace explicitly. A documented prefix (something like `state/` plus the fingerprint) keeps adapter keys out of the way of engine-written Block KV keys, and the contract tests should include a namespace-collision case, not only hit/miss/expired/layout-mismatch/boundary-misaligned. On the TTL point: agreed, leave time-based figures out of the state path entirely. Pool-pressure-driven residency via the slot ratio is the accurate description, and the adapter should treat expiry as an observed fact from `is_exist`/`get_size`, never as a duration it assumes. Looking forward to the contract tests first, as you proposed.
Author
Owner

@whn09 commented on GitHub (Oct 23, 2026):

An engine-side consumer for this contract now exists: deepseek-ai/DeepInfer#216 (draft) adds Mooncake Store as an L3 tier under DeepInfer's host prefix cache (#144 there), for DeepSeek-V4.1-Flash. Notes from it that may help the adapter and the contract tests:

How it maps to Sections A/B today (plain MooncakeDistributedStore, until the adapter lands):

  • State objects: state/<fp>/<prefix chain hash at the 128-aligned boundary>. One object per boundary, holding exactly the persisted SWA region DeepInfer stores at that position (state_size_to_disk, taken with select_state_slice_to_store). Boundaries are the last few 128-aligned positions of each stored prompt.
  • Block KV: a separate namespace, dsv4kv/<fp>/g<G>/<chain hash of the last block>. Each object holds G consecutive 128-token blocks, all layers per block.
  • <fp>: v1-<sha256[:16]> over the checkpoint config.json plus page bytes, state bytes, block size and the env knobs that change the state ring layout. The version is in the fingerprint itself, as suggested, so a layout change is a clean miss.
  • Hit resolution follows Section B: batch_is_exist on block keys gives the block run; batch_is_exist on state keys at candidate boundaries gives state availability. The engine then picks the deepest boundary that it can also replay from (it must recompute ≥ 140 trailing tokens) and fetches with batch_get_into_multi_buffers. The Store never infers policy.
  • Expiry: an object that is gone between exists and get (we treat -704 / size mismatch as a miss) falls back to the host-only lookup. There is a unit test for exactly that case.

Observations from B200, TCP, one host, wheel 0.3.13.post1 that may matter for defaults:

  • Per-object overhead dominates for single 114 KB blocks. batch_put_from reaches 0.17 GB/s with one block per object, but 1.7 GB/s with 4 blocks per object (the loopback limit). Hence G=4 (512 tokens) for block objects. State objects are larger and single.
  • The Store rejects protocol=shm (unsupported_protocol). protocol=efa on the same host gave TRANSFER_FAIL (-800) for every put; I haven't dug into that yet.

Once python/mooncake/store/'s adapter lands, DeepInfer can switch its state path to it directly. Happy to run the contract tests against real V4.1 states, and to share layout numbers, if that is useful.

中文

这个约定现在已经有了引擎侧的使用方:deepseek-ai/DeepInfer#216(Draft)在 DeepInfer 的主机前缀缓存(那边的 #144)下面加了一层 Mooncake Store 作为 L3,面向 DeepSeek-V4.1-Flash。下面几点或许对 adapter 和契约测试有帮助。

目前和 Section A/B 的对应关系(adapter 落地之前,直接用 MooncakeDistributedStore):

  • state 对象: state/<fp>/<128 对齐边界处的前缀链哈希>。每个边界一个对象,内容正好是 DeepInfer 在该位置保存的 SWA 区域(state_size_to_disk,用 select_state_slice_to_store 取出)。边界取每个已保存 prompt 的最后几个 128 对齐位置。
  • Block KV: 用单独的命名空间,dsv4kv/<fp>/g<G>/<最后一个 block 的链哈希>。每个对象包含 G 个连续的 128-token block,每个 block 含所有层。
  • <fp>: v1-<sha256 前 16 位>,由 checkpoint 的 config.json 加上页字节数、state 字节数、block 大小,以及会改变 state 环形布局的环境变量算出。按建议把版本号放进了指纹本身,布局一变就自然查不到。
  • 命中判定遵循 Section B: 对 block key 做 batch_is_exist 得到连续 block 的长度,对候选边界的 state key 做 batch_is_exist 得到 state 是否可用;然后由引擎挑出最深的、自己也能重放的边界(末尾必须重算至少 140 个 token),再用 batch_get_into_multi_buffers 读取。Store 本身不做任何策略推断。
  • 过期: exists 和 get 之间对象消失时(-704 或大小不符都按未命中处理),退回只用主机池的查找。这种情况有专门的单元测试。

在 B200 上的观察(TCP,单机,wheel 0.3.13.post1),可能和默认参数有关:

  • 对单个 114 KB 的 block 来说,每个对象的固定开销占了大头。 每对象 1 个 block 时 batch_put_from 只有 0.17 GB/s,每对象 4 个 block 能到 1.7 GB/s(回环带宽上限),所以 block 对象取 G=4(512 token)。state 对象本身较大,单独存放。
  • Store 不接受 protocol=shm(unsupported_protocol);同机用 protocol=efa 时每次 put 都返回 TRANSFER_FAIL (-800),我还没来得及深入查。

等 python/mooncake/store/ 的 adapter 落地后,DeepInfer 可以直接把 state 路径切过去。如果有用,我很乐意用真实的 V4.1 state 跑契约测试,也可以提供布局相关的数据。

<!-- gh-comment-id:6360317607 --> @whn09 commented on GitHub (Oct 23, 2026): An engine-side consumer for this contract now exists: **deepseek-ai/DeepInfer#216** (draft) adds Mooncake Store as an L3 tier under DeepInfer's host prefix cache (#144 there), for DeepSeek-V4.1-Flash. Notes from it that may help the adapter and the contract tests: **How it maps to Sections A/B today** (plain `MooncakeDistributedStore`, until the adapter lands): - **State objects:** `state/<fp>/<prefix chain hash at the 128-aligned boundary>`. One object per boundary, holding exactly the persisted SWA region DeepInfer stores at that position (`state_size_to_disk`, taken with `select_state_slice_to_store`). Boundaries are the last few 128-aligned positions of each stored prompt. - **Block KV:** a separate namespace, `dsv4kv/<fp>/g<G>/<chain hash of the last block>`. Each object holds G consecutive 128-token blocks, all layers per block. - **`<fp>`:** `v1-<sha256[:16]>` over the checkpoint `config.json` plus page bytes, state bytes, block size and the env knobs that change the state ring layout. The version is in the fingerprint itself, as suggested, so a layout change is a clean miss. - **Hit resolution follows Section B:** `batch_is_exist` on block keys gives the block run; `batch_is_exist` on state keys at candidate boundaries gives state availability. The engine then picks the deepest boundary that it can also replay from (it must recompute ≥ 140 trailing tokens) and fetches with `batch_get_into_multi_buffers`. The Store never infers policy. - **Expiry:** an object that is gone between `exists` and `get` (we treat `-704` / size mismatch as a miss) falls back to the host-only lookup. There is a unit test for exactly that case. **Observations from B200, TCP, one host, wheel 0.3.13.post1** that may matter for defaults: - **Per-object overhead dominates for single 114 KB blocks.** `batch_put_from` reaches 0.17 GB/s with one block per object, but 1.7 GB/s with 4 blocks per object (the loopback limit). Hence G=4 (512 tokens) for block objects. State objects are larger and single. - The Store rejects `protocol=shm` (`unsupported_protocol`). `protocol=efa` on the same host gave `TRANSFER_FAIL (-800)` for every put; I haven't dug into that yet. Once `python/mooncake/store/`'s adapter lands, DeepInfer can switch its state path to it directly. Happy to run the contract tests against real V4.1 states, and to share layout numbers, if that is useful. <details><summary>中文</summary> 这个约定现在已经有了引擎侧的使用方:**deepseek-ai/DeepInfer#216**(Draft)在 DeepInfer 的主机前缀缓存(那边的 #144)下面加了一层 Mooncake Store 作为 L3,面向 DeepSeek-V4.1-Flash。下面几点或许对 adapter 和契约测试有帮助。 **目前和 Section A/B 的对应关系**(adapter 落地之前,直接用 `MooncakeDistributedStore`): - **state 对象:** `state/<fp>/<128 对齐边界处的前缀链哈希>`。每个边界一个对象,内容正好是 DeepInfer 在该位置保存的 SWA 区域(`state_size_to_disk`,用 `select_state_slice_to_store` 取出)。边界取每个已保存 prompt 的最后几个 128 对齐位置。 - **Block KV:** 用单独的命名空间,`dsv4kv/<fp>/g<G>/<最后一个 block 的链哈希>`。每个对象包含 G 个连续的 128-token block,每个 block 含所有层。 - **`<fp>`:** `v1-<sha256 前 16 位>`,由 checkpoint 的 `config.json` 加上页字节数、state 字节数、block 大小,以及会改变 state 环形布局的环境变量算出。按建议把版本号放进了指纹本身,布局一变就自然查不到。 - **命中判定遵循 Section B:** 对 block key 做 `batch_is_exist` 得到连续 block 的长度,对候选边界的 state key 做 `batch_is_exist` 得到 state 是否可用;然后由引擎挑出最深的、自己也能重放的边界(末尾必须重算至少 140 个 token),再用 `batch_get_into_multi_buffers` 读取。Store 本身不做任何策略推断。 - **过期:** `exists` 和 `get` 之间对象消失时(`-704` 或大小不符都按未命中处理),退回只用主机池的查找。这种情况有专门的单元测试。 **在 B200 上的观察**(TCP,单机,wheel 0.3.13.post1),可能和默认参数有关: - **对单个 114 KB 的 block 来说,每个对象的固定开销占了大头。** 每对象 1 个 block 时 `batch_put_from` 只有 0.17 GB/s,每对象 4 个 block 能到 1.7 GB/s(回环带宽上限),所以 block 对象取 G=4(512 token)。state 对象本身较大,单独存放。 - Store 不接受 `protocol=shm`(`unsupported_protocol`);同机用 `protocol=efa` 时每次 put 都返回 `TRANSFER_FAIL (-800)`,我还没来得及深入查。 等 `python/mooncake/store/` 的 adapter 落地后,DeepInfer 可以直接把 state 路径切过去。如果有用,我很乐意用真实的 V4.1 state 跑契约测试,也可以提供布局相关的数据。 </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#1216
No description provided.