76 Commits
Author SHA1 Message Date
Constantin 315aea7db9 test(libr4d): benchmark W6NL expert down against W5NL 2026-11-17 18:35:11 +01:00
Constantin d1b5a45e31 feat(qwen4exp): support U4 gate with W6NL down experts 2026-11-17 18:35:11 +01:00
Constantin 79ac2bd50d Add Muse Glimmer IQ4R-V4 with quantized DFlash2 2026-11-17 18:24:56 +01:00
Constantin 1d94e416a6 libr4d: keep short IQR verification on the decode path
A speculative verify issues several rows where a plain decode issues one.
Two IQR kernels accumulated those rows differently, so the same weights and
activations could round to different bf16 outputs. A greedy choice near a
tie could therefore diverge even though every draft was accepted.

gemm_iqr_nt_m64: a U5 row-scale trellis (computed trellis, 5-bit, one f32
scale a row) already folds one to four rows as a GEMV in the single-token
order. Above that, through the GEMV's eight-row limit, the multi-row fold
differs. Those rows now run as independent single-row GEMV blocks on
grid.y, including a chained launch. Gated GEMMs and every other form keep
their dispatch.

moe_gemm_iqr: a short token-order gate/up batch (more than one token, at
most eight times top_k, top_k below the one-wave threshold, K at least
eight 128-blocks, and a one-token step inside the decode band) used the
run grid. Several tokens on one expert then took the WMMA tile instead of
the one-row dot. Those batches now give each sorted slot its own block and
the same wide-K dot reduction as a one-token gate/up. Sorted down
projections, longer batches and the prefill map are unchanged.

r4d_selftest checks both against independent single-row launches, bit for
bit, including an untouched output tail on the dense row. The existing
grouped numerical suite still passes.

Measured on an R9700, the dense U5 path at N=8192 K=2560 is 26.5 us at
M=1, 51.2 at M=4 and 105.2 at M=7. A 512-expert Qwen3.8-Flash-Next gate/up
(768:512 x 2560, 5-bit, ten slots a token) is 28.9 us at one token, 52.4
at four and 82.2 at seven. Prefill remains the old kernel.

On the isolated build, Qwen3.8-Flash-Next U5-gate/W5-down matched its
non-speculative token ids at MTP 3 and 6 on arithmetic, writing, code,
explanation and JSON. StillDeadcode's IQR-V4 control matched on the
arithmetic and writing prompts at MTP 3. A layer trace of the previously
divergent writing token was bit-identical between the two schedules.
2026-11-16 17:59:42 +01:00
Constantin ba3ebd380f feat(qwen4exp): support calibrated U5 gate/W5 down recipe 2026-11-16 17:58:41 +01:00
Constantin 8088c9a783 test: check DSpark device usage before skipping 2026-11-03 14:35:30 -05:00
Constantin c1c8e40445 test: run DSpark differential against libr4d on device 2026-11-03 14:22:46 -05:00
Constantin cebf759a36 fix: keep one Spark prefill pass key per plugin 2026-11-03 14:10:11 -05:00
Constantin 51b08808de spark: key BF16 and IQ8R prefill tape geometry 2026-11-03 13:56:46 -05:00
Constantin c96cfc9e7b test: verify DSpark device KV rollback 2026-11-03 13:56:46 -05:00
Constantin e14463b8eb docs: describe Spark DSpark serving, not GGUF import
The graph still reads draft.* from a container that already has them. How that
container is built from XHToken's GGUF is not this change.
2026-11-03 13:56:46 -05:00
Constantin f98ccd3f56 Add a DSpark QoS harness that only reports supported evidence
Two-server probe plus tests. Missing or reset counters fail closed;
partial-acceptance, stop-sequence, and timing claims are not made.
2026-11-03 13:56:46 -05:00
Constantin 5b98ba37e8 Stop aliasing DSpark restrict kernel buffers
rmsnorm, sigmoid, and scale_rows declare __restrict__ input and output.
Give those stages separate graph buffers and check the declared graph
does not pass the same allocation to both.
2026-11-03 13:56:46 -05:00
Constantin 9ca20a1fba Use F32 draft logits for the DSpark Markov walk
Score the walk on F32 head logits, reject non-I32 anchors in libref, and
assert the real proposal path. Near-tie policy vs the reference is still
open.
2026-11-03 13:56:46 -05:00
Constantin 445bf8e0d9 Honor DSpark Markov scratch row pitches and exercise device oracles
Index Markov scratch by the padded row stride, not a packed width, and
cover the walk plus shared-anchor attention on device.
2026-11-03 13:56:46 -05:00
Constantin 340ff8781a Implement exact DSpark attention and Markov ops
Shared-anchor window attention and full-vocabulary greedy Markov as named
ops, with libref oracles. Register the anchor-window kernel constraints.
2026-11-03 13:56:45 -05:00
Constantin b43088a334 Draft with a Spark DSpark drafter
Spark's standalone DSpark is five sliding-window layers over a seven-token
block, taps on the trunk residual, sigmoid headwise gates, exact GELU, and
a rank-256 Markov head over the tied table. Own block vs MiniCPM5 DSpark.

The graph follows the pinned reference: shared-anchor window and
full-vocabulary greedy Markov walk. Tensor names are the ones the container
holds; the walk scores at the width it reads. TP>1 drafting is refused.
2026-11-03 13:56:45 -05:00
Constantin f692c3f446 spark: key BF16 and IQ8R prefill tape geometry 2026-11-03 13:53:46 -05:00
Constantin 416c231a18 Report Spark probe cleanup failures without masking outcomes 2026-11-03 13:53:27 -05:00
Constantin 95af71af3a Retain Spark score backups if rollback fails 2026-11-03 13:53:27 -05:00
Constantin 50b60078ab Protect Spark probe artifacts through promotion failures 2026-11-03 13:53:27 -05:00
Constantin acd256ba25 Stage Spark score outputs and protect inputs from overwrite 2026-11-03 13:53:27 -05:00
Constantin a4403a1a90 Harden Spark measurement identity and fresh output checks 2026-11-03 13:53:27 -05:00
Constantin 4a60c64ec5 Guard Spark reference provenance against recording input changes 2026-11-03 13:53:26 -05:00
Constantin 6295ba1d92 Bind Spark quality probes to measured artifacts
Hash architecture and quantizer inventories as well as kernels. Bind reusable references to model bytes, corpus, runtime, settings and data. Bind tail replay to scored reports and launch the verified candidate privately. Reject incomplete forced-length QoS responses. Add CPU-only positive and negative attribution tests; no GPU certification is implied.
2026-11-03 13:53:26 -05:00
Constantin 40442cc81b Record exact sparse keep12 KL provenance 2026-11-03 13:53:26 -05:00
Constantin 08c3e752f7 Document Spark IQ8R quality allocation and replay 2026-11-03 13:53:26 -05:00
Constantin cb97b1c886 Add Spark rotated-int8 inference and calibration
Serve the Spark X2.6 trunk on IQ8R's rotated int8 grid. Six projection types a layer carry
fwht128-rotated int8 weights with a bf16 scale per 128 columns; activations are quantised into
the same 128-column groups and feed the `i8a8h` rows, exact GELU runs before the down
projection's own Hadamard quantiser, and the embedding, the two norms a layer, the head's norm
and the 16-row attention gate stay as they are. The descriptor is `w8a8_fwht128`, and the
container says `quantization_config.quant_method=w8a8`, `fmt=fwht128`.

`data/recipes/spark-x26-4b-iq8r.recipe` fits those weights by GPTQ against the model's own
calibration Hessians, which the BF16 plugin writes as RADGRAM2 files under `RADIANCE_CALIB_DIR`;
each layer's f32 [K,K] accumulators are 533 MB, so `RADIANCE_SPARK_CALIB_LAYERS=lo:hi` calibrates
a slice at a time into one directory. The output head is RTN. Column-sharded inputs and their
offsets must land on whole scale groups, so a rank with an unaligned span is refused rather than
served with misaligned scales: TP 1, 2, 4 and 8 align for these shapes, TP 3 does not for the
FFN-down shard. Calibration asks for TP=1, because the off-diagonal cross-rank terms only exist
on one card.

`tests/spark25_iq8r.py` compares a deterministic quantised fixture against the Transformers
reference, top-10 probabilities included, across cached decoding; `--tp 2` checks two fake host
ranks and `--wide-tp --tp N` the group-aligned attention and FFN shards for N from 1 to 8. Run it
under a GPU-denying device cgroup, as with the BF16 fixture.

Against this checkpoint's own BF16 container, 32 held-out chat, math, code and tool-call samples
and 31,391 positions, greedy with prefix caching off: 98.60% of positions keep their top token,
mean KL 0.00408, median 6.5e-5, p99 0.0496, p99.9 0.348, worst 11.88. The tail is the honest
part -- 13 positions above one nat -- and leaving the first twelve layers in BF16 takes the worst
to 0.247 with nothing above one nat, for about 12% of prefill and 17% of decode. One R9700, zero
cached prompt tokens: 11.8k, 11.8k and 11.3k tok/s of prefill at 1.1k, 4.4k and 9.9k-token
prompts, 93.7 tok/s of decode from a short prompt and 88.9 with a 4.4k-token context. 8.29 GiB of
BF16 weights become 4.52 GiB.

That comparison is distribution agreement against BF16, not a task benchmark, and the corpus the
Grams came from is public text held disjoint from the holdout by hash; no MMLU or GSM8K-class
number is claimed here. The numbers need the prefill softmax scaling per row rather than per
wave: while a row's rounding depended on its wave-mates, the quantised container was worse off
against BF16 than its own error explains.
2026-11-03 13:53:26 -05:00
Constantin 5d6de60318 spark: key BF16 prefill tape geometry 2026-11-03 19:08:58 +01:00
Constantin f697660b8b Document Spark TP collective requirements 2026-11-03 19:08:58 +01:00
Constantin 213403b458 Fail Spark TP declaration without exact collectives 2026-11-03 19:08:58 +01:00
Constantin a5b2f84450 Round Spark TP projections before the FP32 residual add
Reduce attention-output and FFN-down shards in exact BF16, then widen the merged result for the FP32 residual. Keep the disjoint embedding reduction unchanged. Declare the reductions before the casts as well as issuing them in that order so buffer liveness follows the fixed graph. Clarify that TP can still differ from one card through sharded dot-product rounding.
2026-11-03 19:08:58 +01:00
Constantin 8cb2c0a841 Add regression for Spark TP projection rounding
Capture the BF16 midpoint case and require each projection reduction to round before widening into the FP32 residual. This regression precedes the production fix and is expected to fail on the current graph.
2026-11-03 19:08:58 +01:00
Constantin 4204fa4da7 Let the shipped-arch registry expect spark25
The loader test fixes the (architecture id, quantisation descriptor) pairs a shipped plugin may
claim; the Spark plugin was not in it, so the set comparison failed once every architecture plugin
was built.
2026-11-03 19:08:58 +01:00
Constantin 1c96558970 Shard Spark across ranks and reduce the f32 residual
Attention takes whole GQA groups, so a world that does not divide the KV head count still gets a
clean cut; above it the KV heads are replicated and a group splits between the ranks sharing its
KV head. Gate/up, down and the tied vocabulary take matching spans, and every query head, FFN
channel and vocabulary row belongs to exactly one rank at every world from 1 to 8.

The projection outputs are partial sums, so each block widens to f32 and issues an exact f32
all_reduce before the residual add, which keeps the single-card accumulation order.

tests/spark25_reference.py --tp N holds the sharded graph against the HF reference on N fake host
devices; the tiny fixture has 8 heads over 4 KV heads and 3584 vocabulary rows so worlds 1-8 all
get a nonempty shard.
2026-11-03 19:08:58 +01:00
Constantin 48407fb52d Cover Spark configuration refusals and CPU isolation caveat 2026-11-03 19:08:58 +01:00
Constantin 125854df79 Document Spark support and add reference differential 2026-11-03 19:08:58 +01:00
Constantin 1483a1ae17 Support Spark reasoning and tagged tool calls 2026-11-03 19:08:58 +01:00
Constantin e56d948889 Add BF16 Spark 2.5 checkpoint and decoder 2026-11-03 19:08:58 +01:00
Constantin 798fb21e51 prefill: key tape splits from ordered host KV bounds 2026-11-03 19:05:30 +01:00
Constantin aa14eea76c prefill: fail closed when live split geometry is unknown
Head-256 split-prefill launchers now declare that their grid depends on
live KV. Without an architecture geometry key, those passes stay live
instead of replaying a stale tape. Qwen keys only a proven one-sequence
prefill. Plugin ABI 34.
2026-11-03 19:05:30 +01:00
Constantin ded64c0bd3 prefill: key recordings by live split geometry 2026-11-03 19:05:30 +01:00
Constantin 61e275e30f prefill: split KV on live seqused, not the model max_ctx
The 8-tile floor used max_ctx, so a 128-token chunk at --max-model-len
2048 became four splits of ~32 keys. The same prompt in one 977-token
launch stayed unsplit. Only the reduction order changed, and that
moved Spark BF16 first-token top-20 by 0.46 nats.

Occupancy still decides when a long-KV short-Q launch should split.
The floor now reads seqused_k (skipping the copy when occupancy is
already 1). A 128/128 case with declared max_ctx 2048 stays unsplit.
2026-11-03 19:05:30 +01:00
Constantin 9cb04f62a8 config: --gpu-memory-mib, the inverse of --gpu-headroom-mib
N claims that many MiB of every card; headroom is the rest. The two
flags cannot be combined. vLLM's utilisation fraction, written in MiB.
2026-11-03 19:02:52 +01:00
Constantin b264e9bd0c Scale the prefill softmax by row, not by wave
The h256 prefill online-softmax branch must remain wave-uniform, but the
previous branch let one row's growth vote make every row update its reference
maximum. A row's rounding could therefore depend on which other rows shared
the launch.

Keep the branch uniform and make each row update only when its own cross-half
maximum exceeds its own `m_ref + PGROW`. Rows below threshold retain `m_ref`.
This fixes row-coupled rescaling; it does not claim full-model bitwise
invariance across chunk sizes, since other shape-dependent paths remain.

The dedicated regression selector is `--case attn_prefill_rows` (exact match;
`--case rows` is not recognized). The older kernel-name selector runs the
regression only for that named GQA row; rerunning it for GQA4 also passes the
row checks. Three launch pairs run on six BF16 head-256 rows: GQA 2/4/6/8/12
and GQA6 with 4-token pages (18 assertions).
Against v1.15.1, 17/18 assertions failed; with this change 18/18 pass
bit-identically. For Spark GQA4, the baseline 58/128 pair differs in
588/118,784 elements (max abs 0.00195). Although this implementation file is
named `gqa6`, the parameterized body is included by the other head-256 GQA
wrappers too.

Controlled 917-token Spark BF16 rerun (same prompt, binary, model, TP1, BF16
KV, no prefix cache; only libr4d changed): chunk 128 vs 1024 kept top token 198
and all 20 candidates in common before and after. Maximum shared top-20
log-probability delta was 0.23717 on v1.15.1 and 0.28474 with this patch.
This example does not improve; it is included to avoid claiming general chunk
invariance. The earlier raw full-vocabulary pre-fix result (131,070/131,072
logits changed, max abs 0.46925) has no matching post-fix capture; the paired
API top-20 comparison is the comparable result.

On a separate 32-document, 31,391-position BF16 evaluation, chunk-1024 vs
chunk-128 reference achieved 99.49% top-1 agreement (31,231/31,391): 160
positions still choose a different top token between chunk shapes, not against
external ground truth. Mean KL was 0.000879, median 1.29e-5, p99 0.00462,
p99.9 0.10119, max 3.2961. The pre-fix result on this exact set was not
measured. At the separately
investigated scored row 461 (document 20, token position 477), prefix replay's
recorded top token 62594 was replaced by 2561 before the fix; after it, token
62594 was restored with a 0.184-nat top-token log-probability gap. That
0.184 is not a full-set KL, and the 3.296 maximum comes from the separate
31,391-position evaluation.

Fast CTest: 141/141. Full card selftest still has one unrelated
`hc_read_e4m3` prefill-tile failure, reproducible on untouched v1.15.1. No
throughput improvement is claimed or measured.
2026-11-01 20:59:44 +01:00
Constantin fb8cb95b7e docs: verify non-target kernel dispatch 2026-10-27 18:28:46 +01:00
Constantin c2565369e9 docs: record BF16 W4 review follow-up 2026-10-27 18:28:46 +01:00
Constantin d947d7139e fix: preserve BF16 W4 CPU narrowing semantics 2026-10-27 18:28:46 +01:00
Constantin da8c95d4d9 docs: clarify shared R9700 power caps 2026-10-27 18:28:46 +01:00
Constantin fbffd33e22 docs: record third-card benchmark confirmation 2026-10-27 18:28:46 +01:00
Constantin 05ccf42964 docs: record cross-card HYV3 throughput check 2026-10-27 18:28:46 +01:00
Constantin 31ac68549b docs: record launcher compatibility smokes 2026-10-27 18:28:46 +01:00
Constantin 2c9d415166 docs: record full HYV3 validation and A/B results 2026-10-27 18:28:46 +01:00
Constantin 85b5388089 docs: record release-based GPU and inference smoke 2026-10-27 18:28:46 +01:00
Constantin c301f3315e docs: record release-tag PR build validation 2026-10-27 18:28:46 +01:00
Constantin edbdc44b8e docs: verify engine build on latest upstream 2026-10-27 18:28:46 +01:00
Constantin 87cb41b5fa docs: distinguish validation from final rebased base 2026-10-27 18:28:46 +01:00
Constantin 9d6ae971e8 docs: record local Qwen validation artifact hash 2026-10-27 18:28:46 +01:00
Constantin ad26c95675 docs: record rebased HYV3 validation results 2026-10-27 18:28:46 +01:00
Constantin 3a1706f1fa Document HYV3 optimization scope, measurements and validation
## Summary

Optimize HYV3 decode and the shared W4/W5 and signed-I4 expert paths:

- Compact the asymmetric W4/W5 one-row epilogue without changing its WMMA or split-K arithmetic.
- Pack per-128-scale I4 experts into `t16k64` fragments and load one routed row directly into registers; keep prefill compatible with the same packed weights. Subgroup-scaled codebooks retain their layout.
- Narrow BF16 activations to F16 inside the W4 decode GEMM, replacing the separate activation cast with the same rounding.
- Reuse fused Q/K normalization/RoPE/KV-store, residual norms, routing and the TP1 shared/routed gather in HYV3. TP2 retains separate arm reductions.
- Add cold-weight timing modes, canonical/byte/guard checks, independent nibble-address tests and an affected-path/measurement report.

## Validation

On merged `main` (`2d2f638`):

- `gfx1201` kernel library, selftest executable and all three HYV3 plugins: compiled.
- Release and ASan/UBSan/leak architecture suites: passed.
- Layout parity: 1,145 checks over 20 cases, including GPTQ, rotated experts and subgroup codebooks: passed.
- Reference arithmetic: 136,622 checks over 254 cases passed with two failing upstream inventory/sweep cases excluded; the same failures were reproduced using unchanged upstream test source.

A full engine/unit run is blocked by upstream's missing KV-stream headers. No GPU workload or serving-service changes were made during this validation pass.

## Measurements and readiness

Earlier TP1 HYV3 measurements reached 115.678 decode tokens/s versus 90.290 initially; the isolated expert-packing step measured 95.392 to 103.364. These used a highly repetitive 10,030-prompt/2,000-output `alpha` workload on an R9700. They are **historical, not measurements of this rebased PR**, and establish neither general throughput nor gains on other models.

Keep this PR in draft until current-base GPU numerical/guard checks and matched throughput/text/tool-quality measurements pass for HYV3 and the other affected W4/W5/I4 paths. The historical tool subset did not clear its earlier guard and needs an isolated rerun.

See [the optimization report](docs/benchmarks/hyv3-w4-decode.md) for affected models/encodings, historical results, validation details and remaining gates.
2026-10-27 18:28:46 +01:00
Constantin 9916dcace3 Fold HYV3 TP1 shared combination into the routed gather
Prepare a unity-gate plane once per step and use the existing gather at TP1 while preserving routed BF16 rounding before the shared add. Retain independent arm reductions and combination at TP2, with multi-pass graph and routing-rounding checks.
2026-10-27 18:28:46 +01:00
Constantin 36c39efdca Fold HYV3 residual adds into the following norms
Reuse the existing BF16-rounded add/norm fusion while retaining final output materialization and the original collective positions. Cover TP1, TP2 and multi-pass prefill without introducing calibration hooks.
2026-10-27 18:28:46 +01:00
Constantin d59cdce040 Use fused QK normalization RoPE and KV store in HYV3 decode
Wire the existing fused prologue into the private HYV3 attention helper for small BF16-KV batches. Retain the separate operations for other shapes and KV layouts, with graph coverage of both paths.
2026-10-27 18:28:46 +01:00
Constantin bb48b14005 Reuse BF16 add for HYV3 shared/routed combination
Replace the equivalent FP32 cast/add/cast chain with the existing BF16 add and enable the existing fused router for HYV3. Preserve separate tensor-parallel arm reductions and BF16 rounding boundaries; add the reference arithmetic check.
2026-10-27 18:28:46 +01:00
Constantin 492d33c470 Narrow BF16 activations inside asymmetric W4 decode GEMMs
Replace the separate BF16-to-F16 activation cast with the same nearest-even narrowing on load. Keep existing split-K and WMMA arithmetic. Test finite and raw-bit activations, canonical arithmetic, byte parity and output guards; provide BF16-input cold-weight timing sweeps.
2026-10-27 18:28:46 +01:00
Constantin aeedae4027 Pack per-128 I4 experts for coalesced one-token GEMMs
Change only the per-128-scale load-time expert layout to 16-column/64-K fragment tiles. Add the register-loaded one-row kernel, keep staged prefill compatible, and leave subgroup-scaled codebooks row-major.

Update the stored-layout hashes atomically with the layout and add independent canonical-nibble address checks.
2026-10-27 18:28:46 +01:00
Constantin 692ce7ed8b Measure routed-expert GEMMs with cold live-weight banks
Add the TP1 HYV3 expert geometry to the timing harness while keeping the Flash-Next mode. Rotate actively addressed codes and scales and check all output bytes across dispatch forms.
2026-10-27 18:28:46 +01:00
Constantin 9f90451599 Prune padded-row work from single-row asymmetric W4/W5 GEMMs
Keep WMMA, group and split arithmetic unchanged, but stage and reduce only the live row. Add byte parity, guard and canonical-arithmetic cases over legal launch geometries.
2026-10-27 18:28:46 +01:00
Constantin 2ef0536051 Expose a cold-weight asymmetric W4 GEMM timing sweep 2026-10-27 18:28:46 +01:00
Constantin 99edcc97e0 Cover head-128 BF16 fused QK normalization in existing kernels
Extend registry bounds for the existing qkv_norm_rope_kv_store implementation and exercise the head-128 GQA-8/16 shapes numerically. No HYV3 architecture hook is included in this kernel-only branch.
2026-10-27 18:28:46 +01:00
Constantin 2d2f638fa8 Document HYV3 support and add conversion recipes
Add BF16-source W4/W8/block-FP8/MXFP4, native FP8-source and GGUF-to-W4 recipes. Document supported sources, precision/KV limits and unvalidated paths without calibration environment switches or performance claims.
2026-10-25 12:09:29 +01:00
Constantin e3eab050bd Add HYV3 BF16 FP8 and GGUF architecture adapters
Declare the HYV3 graph with a private attention helper and existing kernels/layouts. Support per-head Q/K normalization, sigmoid-correction routing, the dense-first schedule and TP1/TP2 independent arm reductions with FP32 combine. Add graph, format and plugin tests without calibration or decode optimizations.
2026-10-25 12:09:29 +01:00
Constantin 7e04bcac2b Parse HYV3 native sectioned tool calls and tagged arguments
Use the existing RadChatFormat fields for the outer tool-call section, name separator and tagged values. Cover grammar, template replay, streaming at every truncation, section boundaries and OpenAI response lifting; leave the supports_reasoning adapter unchanged.
2026-10-25 12:09:29 +01:00
Constantin 7621e4ac2b Import HYV3 KV scales and decode Q4_K/Q6_K checkpoint tensors
Carry the native FP8 release scalar K/V descales into metadata, reject invalid scales, and support conversion-time decoding of HYV3 GGUF source tensors. Add source metadata and block-decoding regressions.
2026-10-25 12:09:29 +01:00
Constantin a6702f8db5 Fix test fixture lifetimes for sanitizer validation
Avoid empty-payload fwrite, retain the JSON embedding value during iteration, and release fake pinned allocations between Flash-Next redeclarations. Test-only fixes used by the HYV3 sanitizer run.
2026-10-25 12:09:29 +01:00
Constantin f2c892761a mem: preserve snapshot-backed prefix KV across recomputes
When a stateful model's cached prefix is host-resident and another request recomputes shared tokens without restoring that entry, PrefixCache::insert can replace KV still referenced by an older recurrent checkpoint. Preserve the first cached copy for snapshot-backed prefixes regardless of tier, while retaining rebinding behavior for non-stateful caches.

Add a regression covering a recomputed shared prefix, the original host copy, and its recurrent snapshot.

Tests: `ctest --test-dir build-gfx1201 -L '^fast$' --output-on-failure --parallel 24` (96/96 passed).
2026-10-24 11:11:46 +02:00