[PR #2510] [CLOSED] serve: a durable on-disk conversation tier with a warm→cold cascade that degrades instead of deleting, per-stage segments, a prefix restore ladder, Windows chunked large pages, and a parking target (ram|disk|auto) that spills a re… #4087

Closed
opened 2026-11-07 15:33:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2510
Author: @shahrokhzargarpour
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: aporte/entrega-0.1.44


📝 Commits (10+)

  • 07613f4 serve: durable disk tier for the conversation cache (spill, archive, system-prompt cache)
  • c514173 serve: two-pass streaming session restore (read pass validates, apply pass copies 16 MiB at a time)
  • 26d29b5 serve: per-segment disk tier for the conversation cache (content-addressed segments)
  • 7cd8001 serve: anchor the segment frontier at the <|im_start|> opener, not the role token
  • 1cc359d serve: prefix restore ladder when a parked image fails validation (STRATA_RESTORE_LADDER)
  • 3e14ba4 cuda: reserve the expert arena before the PLE/GGUF, and Windows chunked large pages
  • 0269a3c serve: continuous agenda for batched reads (STRATA_BATCH_AGENDA, opt-in)
  • 940eb9b docs: document the disk tier, restore ladder, anchored frontier and chunked large pages
  • acc0986 serve: --conversation-cache-park (ram|disk|auto), and a rejected park spills to disk instead of discarding
  • 571f120 serve: the transient disk floor decides the sibling disk hits and the API session save/restore too

📊 Changes

46 files changed (+12699 additions, -226 deletions)

View changed files

📝 CMakeLists.txt (+41 -1)
📝 README.md (+10 -0)
📝 docs/DETAILS.md (+139 -4)
➕ docs/FLAGS.md (+287 -0)
➕ docs/SPILL_AND_PROMPT_CACHE.md (+621 -0)
➕ include/strata/core/agenda.hpp (+179 -0)
📝 include/strata/core/conversation_cache.hpp (+145 -15)
📝 include/strata/core/conversation_file.hpp (+33 -1)
📝 include/strata/core/conversation_memory.hpp (+55 -0)
➕ include/strata/core/conversation_prompt_cache.hpp (+138 -0)
➕ include/strata/core/conversation_restore_ladder.hpp (+90 -0)
➕ include/strata/core/conversation_segments.hpp (+291 -0)
📝 include/strata/core/conversation_snapshot.hpp (+58 -0)
➕ include/strata/core/conversation_spill.hpp (+504 -0)
➕ include/strata/core/conversation_spill_dir.hpp (+134 -0)
📝 include/strata/core/expert_source.hpp (+14 -0)
📝 include/strata/core/pinned.hpp (+64 -4)
➕ include/strata/core/system_prompt_cache_dir.hpp (+119 -0)
📝 serve/runconfig.py (+92 -5)
📝 serve/server.py (+381 -15)

...and 26 more files

📄 Description

Title

serve: a durable on-disk conversation tier with a warm→cold cascade that degrades instead of deleting, per-stage segments, a prefix restore ladder, Windows chunked large pages, and a parking target (ram|disk|auto) that spills a rejected park

Issue: Resolves #2597

Summary

This series is built, and it is what runs. The engine binary produced from this tree is the one serving on the machine that took every measurement in this body; the numbers below are that binary's. Where this document says "applies, not verified", it refers to the cherry-pick-alone case in The commits each capability needs: a commit applied on its own to main was checked for conflicts, and nothing was compiled in that scratch tree. It is not a statement that the code was never built.

Fourteen capabilities in one series; all of it opt-in and off by default. With every flag absent the tree is byte-for-byte upstream, and the series applies clean in order on the base. The map, one line each:

  • A. Durable on-disk conversation tier (07613f4b) — the conversation cache gets a disk copy (spill, archive, system-prompt cache).
  • B. Two-pass streaming session restore (c514173e) — restore a parked image without holding its K/V in RAM.
  • C. Per-stage content-addressed segments (26d29b52, 7cd80013) — the shared prefix as addressable pieces, with the frontier anchored at the <|im_start|> opener.
  • D. Prefix restore ladder (1cc359d4, STRATA_RESTORE_LADDER) — a parked image that fails validation no longer loses the prefix.
  • E. Windows chunked large pages + expert-arena-first (3e14ba41) — the CUDA side.
  • F. Continuous batch-read agenda (0269a3c2, STRATA_BATCH_AGENDA, opt-in).
  • G. Parking target + spill-instead-of-discard + transient floor (acc09864, 571f1203) — the transistor ram|disk|auto.
  • H. Default spill / system-prompt-cache directories (2f8d3cad, b0c177f1) — the folder resolves without a flag.
  • I. Disk-tier & cache observability (20e5760b, b9b83c86, 16b67c46, 1f572df4) — engine INFO, /metrics, Monitor rows.
  • J. The cascade (ac5a1746, 33d41214, 686d0b57, bb31e4e4) — a warm level; a level at budget degrades instead of deleting; only the cold deletes.
  • K. Cold-level eviction fix (ba89b7fc) — the cold evicts by its MiB budget, not by a hidden cap of 256 entries.
  • L. Monitor (de0f1f3a, 8f6bfa10, 5320268c, 1895e7ed, 256d76b3) — per-slot clocks, a tachometer, the solo speed, the RAM row.
  • M. Installer (528be20f, 6a93aadf) — several requests at once, and the conversations kept on disk.
  • N. Documentation (940eb9bf, d40cb783, 957d27b0) — the tier, the ladder, the frontier, the pages, the parking, the identity.

Three of the fourteen apply alone on 296b59d2 — A, B and E ("apply alone" means the cherry-pick is conflict-free, not that the capability runs on its own). The rest are a chain, and each says in its own section which commits it needs. Every capability below is a self-sufficient unit: its problem, its flags and defaults, its numbers with their source, what it does not claim, and the minimal set of commits to take it.

Two framings hold for the whole series. The parking work adds a parking target and the rule that closes the hole the disk tier was built for: when the physical-RAM gate rejects a park, the capture is no longer discarded — it spills to disk under a transient floor, and a discard is now counted and printed (discards=N). The cascade gives the disk tier a level above it: the conversation cache runs RAM → warm M.2 → cold disk, and a level that runs out of budget demotes its oldest entry instead of deleting it; only the cold level deletes, and each level is switched off by its own budget.

The installer's always-path does not change, and that is measured rather than asserted: setup.py before and after the change, across 5 machines × 5 sizes × (--yes or Enter), gives 50 cases and 50 identical results, with --yes asking nothing at all.

What changed

A. Durable on-disk conversation tier (spill, archive, system-prompt cache)

The problem. With four parallel slots, long contexts and a bounded --kv-resident, host RAM runs out while a conversation is being parked, and the disk tier sits after the physical-RAM admission gate. When the gate failed, the engine dropped the capture instead of spilling it, so the next turn re-prefilled the whole prompt from token 0. There was no durable on-disk copy of a parked conversation to fall back on at all.

What it does. The conversation cache keeps a durable on-disk copy.

  • --conversation-cache-spill-dir + --conversation-cache-spill-on park — the spill folder and the moment it is written; the folder survives a restart and the SCSM sidecar is rescanned on open.
  • The spill tier owns its writer thread (only the write is asynchronous). The SCSM sidecar carries tokens and images, not K/V; best()/load() restore on re-entry.
  • Identity and validity — SessionFileIdentity (model fingerprint + config fingerprint, engine = STRATA_VERSION). kMetaVersion = 2; v1 is still read.
  • Budget and GC — --conversation-cache-disk-mib (default 8192), --conversation-cache-spill-when-full evict-oldest|reject, --conversation-cache-spill-max-age-days.
  • Free-space preflight — --session-min-free-mib (default 4096).
  • Shared root — --system-prompt-cache (dir/budget/slots/max-age/key) and the shared-Sys dedup of the segment tier.
  • Match knobs — --conversation-cache-similarity and --conversation-cache-n-min, both at their defaults (0), so a disk hit is accepted with no minimum overlap. (These two are not in upstream main.)
  • With every flag absent the tree is byte-for-byte upstream.

What was measured.

  • Restore from disk against a cold prefill: 171,516 tokens in 657 ms read back from disk — the whole reload 6.6 s — against 158,649 ms (158.6 s) to prefill the same prompt cold — ≈24× (the ratio is against the 6.6 s reload, not the 657 ms read). Source: the tier note of 2026-10-14 and the published body's demo table; the 657 ms line is in the engine log.
  • The disk tier on disk (2026-10-15): 268.0 GiB of images + 53.9 GiB of segments across 256 conversations, against a 450 GiB budget. Source: a directory listing of the spill folder.
  • System-prompt cache (the whole engine log, read 2026-10-15 11:27): 8 hits / 106 misses.
  • Changing the system prompt invalidates all reuse today (live engine, 2026-10-15): the control (identical system prompt) reuses 3943/3948; a change at the end reuses 0/4226; a change in the middle reuses 0/3958; and the control that proves it — the same changed prompt sent a second time — reuses 4221/4226. Counts identical across 3 repetitions. The cause is located: the hash of each segment chains the frontier (prev_frontier), and the system prompt is the first segment — the root of the chain; the matcher cuts at the first divergence (a segment after a hole can never be a valid reuse). Source: src/core/conversation_segments.cpp and 09-implementacion/2026-10-15-system-prompt-recalculable-v1.0.0.md.

Updates we plan (design, not implementation, no date promised): stop the segment identity from chaining the frontier; store the K de-rotated and re-anchor them; and recompute the recurrent state (GDN) bounded to the changed span.

What this does not claim. The C++ of this commit was not compiled: the state is applies, not verified, never a tilde. The ≈24× is against the 6.6 s reload, not the 657 ms read. One machine, one model, one pass per cell — not a benchmark and no throughput promise.

Upstream issues. Related — #47 and #661 (both closed/completed) are the origin requests for a conversation tier on disk; #2596 (ours, open) reports and documents that a different K invalidates the whole on-disk tier.

The commits it needs.

commits (in order) take it alone? needs first verified?
07613f4b yes — applies alone on 296b59d2; serve/runconfig.py, serve/server.py, serve/test_monitor.py, serve/test_runconfig.py, setup.py → py_compile OK; the C++ not compiled → applies, not verified

B. Two-pass streaming session restore

The problem. Restoring a parked image materialised the K/V in host RAM; a large image held its whole K/V in RAM during the restore.

What it does. The session restore runs two passes: the read pass validates the image, the apply pass copies it in 16 MiB blocks — so the K/V is not held in RAM as one whole.

What was measured. No separate figure of its own — no measurable before/after: the mechanism is measured through A's restore pair (171,516 tokens / 657 ms read / 6.6 s reload / 158.6 s cold), where the two-pass restore is the path that reads it back. Source: the tier note of 2026-10-14.

What this does not claim. Only C++/.cu/docs — the C++ was not compiled: applies, not verified. There is no isolated measurement of the streaming pass itself.

Upstream issues. Related — #1269 (open PR) carries a nearly identical streaming-restore title; #747 (closed/completed) is the multi-GPU parking terrain the streamed restore reads back.

The commits it needs.

commits (in order) take it alone? needs first verified?
c514173e yes — applies alone on 296b59d2; only C++/.cu/docs → applies, not verified

C. Per-stage content-addressed segments (and the anchored frontier)

The problem. A park rewrites the whole image at once, and the shared root of a prompt (Sys) is written far more often than it is read back: the engine had no way to address the reusable pieces of a prompt separately.

What it does.

  • --conversation-cache-segments + --conversation-cache-segment-budget-mib — a content-addressed per-stage segment tier; conversation_segments.{hpp,cpp}.
  • 7cd80013 — the frontier of the segment store is anchored at the <|im_start|> opener, not at the role token.

What was measured. Nothing live for this commit on its own — no measurable before/after: the note declares host checks 174 → 188 — declared, not reproduced. The shared-Sys dedup is not conclusively measured (one pass, concurrent traffic).

What this does not claim. Not verified (the measurement does not run a parse per commit, and the C++ is not compiled here). The segment plan currently cuts three pieces (Sys, Other, Answer); Think/Read/Write/ToolCall/ToolResult exist in the enum but are not materialised (the cutter is missing). The Sys dedup is not conclusively measured.

Upstream issues. Related — #2508 (ours, open) proposes compacting the stationary KV components, the same territory as the segment dedup; #1962 (open) proposes sharing prefix KV blocks. No upstream issue covers the cutter itself.

The commits it needs.

commits (in order) take it alone? needs first verified?
26d29b52, 7cd80013 no A, B applies in order; not verified. The note declares host checks 174→188 — declared, not reproduced

D. Prefix restore ladder (STRATA_RESTORE_LADDER)

The problem. A parked image that fails validation — e.g. discard snapshot (stage count: saved=0 current=1) — loses the prefix, and the turn re-prefills. (#2595 is 40 of these in one boot, one of 165,543 tokens.)

What it does. STRATA_RESTORE_LADDER — when a parked image fails validation, the ladder rescues the prefix from the bad image so the turn does not lose it; conversation_restore_ladder.hpp.

What was measured. The ladder's image rejected branch did not fire in the live matrix, so its in-serve effect is host-tested, not measured — no measurable before/after. The note declares host checks (1164/1404 in its tests) — declared, not reproduced.

What this does not claim. It does not fix the cause: why the tier produced a 1-token image with a different stage count is not investigated, and our own notes say so (#2595 mitigates). Not verified.

Upstream issues. Mitigates #2595 (ours, open) — the ladder rescues the prefix from the bad image; it does not fix the cause.

The commits it needs.

commits (in order) take it alone? needs first verified?
1cc359d4 no B, C applies in order; not verified. The note declares host checks 1164/1404 — declared, not reproduced

E. Windows chunked large pages + expert-arena-first (CUDA)

The problem. On Windows, the expert arena is reserved after the PLE/GGUF, and large pages are not chunked; the reservation order and the chunked large pages were not the ones this box wants.

What it does. 3e14ba41 — reserve the expert arena before the PLE/GGUF, and use Windows chunked large pages. This is the CUDA side of the series.

What was measured. Nothing live here: only C++/.cu/docs, and no CUDA toolchain in this environment — declared, not reproduced.

What this does not claim. C++/.cu not compiled → applies, not verified, never a tilde.

Upstream issues. Related — #2185 (closed PR) added the Windows enable_large_pages.ps1 helper for SeLockMemoryPrivilege; #2271 (open PR) is --shared-expert-arena.

The commits it needs.

commits (in order) take it alone? needs first verified?
3e14ba41 yes — applies alone on 296b59d2; only C++/.cu/docs → applies, not verified

F. Continuous batch-read agenda (STRATA_BATCH_AGENDA, opt-in)

The problem. On the serve thread a batched read is an uninterrupted run: from pipe_drain() to the end of the request nothing else drives a decode window.

What it does. 0269a3c2 — a continuous agenda for batched reads, behind STRATA_BATCH_AGENDA (opt-in).

What was measured. The note declares a host correctness test; the effect on throughput is NOT measured — no measurable before/after.

What this does not claim. Not verified. The throughput effect is not measured. Its dependency on C and D is by text, not by function — the regions of CMakeLists.txt/docs/FLAGS.md, which the note itself calls "a dependency of context, not functional".

Upstream issues. Related — #2275 (open) and PR #2050 (open, opt-in STRATA_PIPED_READ_PIECE) cover the pipelined prompt read this agenda sits beside; also #1906 and #1603.

The commits it needs.

commits (in order) take it alone? needs first verified?
0269a3c2 no C, D (by text, not by function) applies in order; not verified; the throughput effect is not measured

G. Parking target + spill-instead-of-discard + transient floor (the transistor ram|disk|auto)

The problem. Measured over the window of real use of 2026-10-14 (19:32:30 → 20:22:03, the configuration before the parking target):

symptom number
rejected parks (skip parking (physical RAM admission …)) 24
disk copies ignored (disk hit skipped) 15
K/V re-processed 1,458,547 tokens = 2,110,865 ms (35.2 min) of engine prefill time
worst single episode 141,718 tokens in 197.3 s
host free RAM (1,277 samples @2 s) min 904 · avg 4,070 · max 5,784 MiB
engine working set avg 10,711 MiB (max 16,046)

Two readings that matter:

  • The floor alone is almost never what blocks; snapshot + floor is. Host free RAM sat below the 2560 MiB floor in only 65 of 1,277 samples (5%), while the real condition is available ≥ snapshot + 2560 and a snapshot measures 1.6–2.9 GB (working figure ≈2.5 GB per conversation). In every rejection the log reads evicted 0, 0 still parked: the RAM cache was empty, so there was nothing to evict — it was system RAM, not the cache's budget.
  • The rejections are policy, not lack of disk. The disk tier was already full (19,855 / 20,480 MiB, 101 age evictions) and still spilling correctly; the RAM gate that precedes it is what refused.

Refusing did not even save RAM. A disk restore is indistinguishable from RAM — disk/checkpoint 95,661 tokens in 273.7 ms against live 102,362 tokens in 267.6 ms — and the re-prefill rebuilds in the slot the same K/V the disk copy would have loaded (the final state is identical; /metrics reports the same held_tokens). The engine refused to do in 274 ms what it then did in 197 s, and ended at the same consumption.

These are the window's frozen artifacts, re-counted. An earlier extraction of the same window — taken while the measurement was still running — counted more rejections; the frozen counts here supersede it, and neither is averaged.

What it does.

  • --conversation-cache-park ram|disk|auto (default ram) — the parking target.
    • ram — capture to host RAM, keep it, mirror it to disk (spill-on=park). What the engine did before.
    • disk — park to disk only: capture, hand the copy to the asynchronous spill writer, and free the RAM copy at once. The RAM cache keeps nothing for that park (conversations.size() does not grow; put() is not called for it).
    • auto — resolved once at startup, after the arena and the model are resident: disk when the free RAM cannot hold one snapshot per cache slot beside the floor, ram otherwise. Reported on stderr (park target auto -> disk|ram).
  • --conversation-cache-park-min-free-mib (default 512) — the transient RAM floor a disk-bound capture may take, as opposed to the parking floor --conversation-cache-min-free-mib (default 2560) that a capture which stays in RAM must leave. Two floors because the big one exists to stop the OS paging during a capture that stays; a disk-bound capture is transient — its RAM is freed right after — so refusing it only pays the re-prefill. 0 = require only need.
  • The transistor (the core rule). In both paths (the park and the disk hit) and both modes: when the big floor does not hold, the capture is not discarded — it spills to disk under the transient floor. "Refuse" and "spill" stopped being mutually exclusive. disk needs the disk tier (--conversation-cache-spill-dir with --conversation-cache-spill-on park); without it the parking stays in RAM with a warning rather than parking nothing.
  • The same rule governs every disk read and save, in one function (conversation_disk_placement, the park rule with the destination fixed to disk): the conversation disk hit, the segment-tier hit, the system-prompt-cache hit, the streamed session restore and the API session save are admitted under the transient floor when the parking floor does not hold, and refused only when neither holds — each printing … hit under the transient RAM floor (need … plus 512 MiB, not 2560 MiB). A copy already on disk is never ignored for RAM it would not keep.

Measured motivation for disk: with 4 slots the RAM cache's committed parking is up to the 8 GiB budget (two parked conversations alone measured 4.51 GB, at 1.6–2.9 GB per conversation); in disk mode that committed RAM becomes reclaimable file cache instead.

What was measured. The window above (2026-10-14 19:32:30 → 20:22:03), and the production boot with the disk target (--conversation-cache-park disk; engine run 2026-10-14 23:20:24 → 2026-10-15 07:02:42, closed): skip parking 0; park-to-disk decisions 365; parks completed 272; restores from disk 277; discard snapshot (stage count) 53; K/V re-processed 3,123,699 / 26,117,121 = 12.0 %. Host free RAM under the disk target (window 2026-10-15 00:13:23 → 00:18:40, 136 samples): mean 7,102 MiB (min 4,475 · max 9,936). Sources: the engine log of that run, re-counted in the measurements note of 2026-10-15; the window's own capture (raw-timestamped.log, events.jsonl, snapshots.csv).

What this does not claim. Not verified. The live run cited is of the binary strata-parkdisco.exe (another layer), not of this integrated binary. The window's counts are a snapshot of a live log; the baseline window and the after window are different traffic, not an A/B. Functionally this capability needs only A (the tier, with -spill-on park); the cherry-pick requires the whole chain because every commit touches src/program/generate.cpp.

Upstream issues. Mitigates #1347 (closed/completed — the physical-RAM park gate; this closes the residue where the copy is already on disk and the read is admitted under the transient floor); related — #1620 (closed/not planned) proposed the provisional park this series implements, and #2502 (open) reports a refused park.

The commits it needs.

commits (in order) take it alone? needs first verified?
acc09864, 571f1203 no F (and by F, C, D, A, B). Functionally only A — the cherry-pick needs the chain because all of it touches generate.cpp applies in order; not verified: no run of this integrated binary

H. Default spill dir + default system-prompt-cache dir

The problem. The disk tier required the operator to name the spill folder; without the flag there was no disk tier at all.

What it does.

  • 2f8d3cad — --conversation-cache-spill-dir resolves a default instead of requiring the flag (conversation_spill_dir_resolve).
  • b0c177f1 — --system-prompt-cache-dir defaults the same way.

What was measured. Nothing measurable before/after: the note declares host resolver tests (29 checks, ctest 20/20) — declared, not reproduced.

What this does not claim. Not verified. The resolver tests are declared by the commit's note, not observed here.

Upstream issues. No upstream issue reports the missing default directory; related — #1090 and #1331 (closed/completed, the system prompt on disk) touch the same system-prompt-cache path.

The commits it needs.

commits (in order) take it alone? needs first verified?
2f8d3cad, b0c177f1 no G; and b0c177f1 additionally J applies in order; not verified. The note declares host resolver tests 29 checks, ctest 20/20 — declared, not reproduced

I. Disk-tier & cache observability (engine INFO + /metrics + Monitor rows)

The problem. The disk tier's folder and live state were invisible, and an absent counter was being reported as 0.

What it does.

  • The engine exposes the disk tier's folder and live state and the admission source to the Monitor (conversation_cache_spill_dir, conversation_cache_disk, the loading … from disk / from cold line, and the live.admission field); serve/server.py parses them, and the web Monitor shows the parking by destination, the per-slot speeds and the admission state.
  • 16b67c46 / 1f572df4 — expose the system-prompt cache's folder and budget in the INFO line, and stop reporting an absent counter as 0.
  • The warm level adds conversation_cache_warm_dir / conversation_cache_warm_mib / conversation_cache_warm to the INFO line, a degraded N conversations to the cold level line, and a third row per destination in the Monitor.

What was measured. System-prompt cache (the whole engine log, read 2026-10-15 11:27): 8 hits / 106 misses. The notes declare py_compile/pytest and fixtures in Chrome headless — but only synthetic: against a simulated /metrics, without a live engine.

What this does not claim. Not verified against a live engine: the fixtures run against a simulated /metrics. The 8/106 is the shared root written far more often than it is read back — it is one read of one log.

Upstream issues. Related — #596 (closed/completed) asked for a conversation-cache view in the Monitor tab.

The commits it needs.

commits (in order) take it alone? needs first verified?
20e5760b, b9b83c86, 16b67c46, 1f572df4 no A, G, H applies in order; not verified. The notes declare py_compile/pytest and Chrome-headless fixtures against a simulated /metrics; no live engine

J. The cascade: a warm level, and degrade instead of delete

The problem. The conversation cache had no level above the disk tier: a level that ran out of budget deleted its oldest entry instead of demoting it to a colder one.

What it does. The cache now runs VRAM → RAM → warm → cold. The warm level is new and opt-in; the cold level is the disk tier this series already had.

  • --conversation-cache-warm-dir + --conversation-cache-warm-mib (empty / 0 = the warm level is off). This is the new pair.
  • --conversation-cache-cold-dir + --conversation-cache-cold-mib are the canonical names of the existing disk tier — the same field, the same directory, the same files. --conversation-cache-spill-dir and --conversation-cache-disk-mib keep working as aliases of the same field; two names pointing at one field with different values is a start-up error. The cold level is the existing directory so that the tier the operator already runs — hundreds of GiB of parked conversations — is inherited with zero migration: the engine recognises a directory by the strata-conv- name prefix and the sidecar identity, not by which flag opened it, and it rewrites nothing on open.
  • Degrade, not delete. When a level's GC runs (enforce_budget, enforce_age) and a next level is set, the entry is handed to the next level (degrade_to_next → adopt): the cold level writes its own sidecar, relocates the session files (relocate_file — a rename on one volume, a copy+delete across two) and re-seals the entry's age; the warm level then drops its own copy. Only the last level (the cold) deletes — FIFO by budget, and by age if the operator asked for it. A degradation is not an eviction: the warm level's disk_evictions and age_evictions counters do not move.
  • All-or-nothing. The entry is written to the cold level first and unindexed from the warm level after; if the cold level cannot receive it (budget, when-full=reject, an oversized image, an I/O failure), nothing is moved and the entry stays in the warm level. The whole move is reverted on any failure.
  • The correctness paths still discard. Only the two capacity levers (budget and age) degrade. Supersede, compaction and an unreadable image still discard, exactly as they do today.
  • The RAM floors are not cascade levels. --conversation-cache-min-free-mib and the transient --conversation-cache-park-min-free-mib stay what they are; the cascade reuses the same transistor, adding no third admission rule.
  • Off by default. No warm level configured means no cascade at all: the write level is the cold level, the read path says from disk and returns the same instance as before, and the tree is byte-for-byte the one that ships without this change. The gate for a level is the same one the existing tier uses (a non-empty directory and a non-zero budget).

What was measured. The cascade's warm level against the cold one — measured on the live engine (2026-10-15) as a 2×2 by level and freshness (22 synthetic conversations of ~5,700 prompt tokens, six randomized rounds with the order shuffled; an old round first reads 10 GiB of unrelated files to push the images out of the OS page cache). The engine's own figure for restoring a parked image — restored N tokens (<level>/…) in X ms — is:

level freshness n restore ms (median / min / max)
warm (disk/…) fresh 36 92.2 / 38.5 / 1240.1
warm old 33 101.7 / 51.3 / 2834.3
cold (cold/…) fresh 30 106.0 / 62.3 / 163.7
cold old 41 104.1 / 41.0 / 141.4

The level does not weigh, and neither does freshness command the median: a floor of ~100 ms does, and freshness appears only as a tail of the warm volume — 9 of 69 warm restores took 300–2834 ms, against 0 of 125 cold ones. Pooled (warm n=69, median 100.5 ms · cold n=125, median 97.3 ms) the ratio is 0.97 with interval [0.906–1.076], which includes 1 → no ratio is asserted.

Why the two earlier runs differed: they ran on different builds — one without the eviction fix, one with it. They did not contradict each other: they measured different things. And the datum that refutes the OS page-cache hypothesis: the images truly old (14, intact for hours) were the fastest measured (74.8 ms), so age alone does not make a restore slow. The warm level's degraded counter went 0 → 45 in the first synthetic run and 0 → 21 in the re-test, holding at ~10,112 MiB of its 10,240 MiB budget while the cold absorbed the overflow: it degrades, it does not drop. Source: 09-implementacion/2026-10-15-ab-por-nivel-y-frescura-v1.0.0.md; the earlier pair from 09-implementacion/2026-10-15-test-sintetico-cascada-v1.0.0.md and 09-implementacion/2026-10-15-re-test-cascada-con-arreglo-v1.0.0.md.

No gain in this machine, with the cause. Measured on this machine (X870P) and this configuration: the two levels give the same median because the bottleneck is the disk path, not the level — in the small-read regime it delivers ~0.5-1 GB/s against the 7 GB/s the drive can do. A large restore (171.5k tokens) did reach 657 ms ≈ 2.8 GB/s, so the ~1 GB/s ceiling belongs to the small-read regime, not to the drive.

What this does not claim. Not verified. The 2×2 is not a controlled media comparison — warm lives on C: and cold on D:, two physical SSDs, and the cold images were, on average, written earlier than the warm ones, so the OS page-cache state is not equalised; no ratio is asserted (the pooled CI contains 1, and the "old" manipulation is a page-cache flush, not age); the request latency includes prefill and admission and whatever else the engine was doing (:5011 is production, the window was not isolated); restored … in X ms is the engine's figure for the load it closes, not isolated disk I/O; and one synthetic workload with a single client is not a load profile. The warm level is new code: its 406 host checks and its mutation check pass, but nothing of it has been served. The cascade is not safe to take without K: without the cold-level eviction fix, the warm level degrades into a cold that deletes by a hidden cap of 256, and taking J without K erases parked material.

Upstream issues. Closes #2597 (ours, open) — the cache degrades across levels instead of deleting, each level switched off by its own budget. Related — #1920 (open: two alternating long conversations evict each other), #2264 (open: it re-parks every turn) and #2448 (open: an incremental write and a fill policy).

The commits it needs.

commits (in order) take it alone? needs first verified?
ac5a1746, 33d41214, 686d0b57, bb31e4e4 no A (for 33d41214); I (ac5a1746 → 16b67c46). Do not take without the cold-eviction fix (K) applies in order; not verified. The live A/B is synthetic and no ratio is asserted (the pooled CI contains 1); 406 host checks + mutation pass, but nothing served. Without K, the warm level degrades into a cold that deletes by a hidden cap of 256

K. Cold-level eviction fix: budget, not a hidden count of 256

The problem. The same synthetic run exposed a real defect, and it is stated as what it is — a defect of ours, caught by our own test. The cold level had a hidden ceiling of 256 entries (kMaxSidecarEntries), named in no log line and in no /metrics field, and adopt() runs the cold level's GC unconditionally — so every warm→cold degradation deleted exactly one cold copy, with 460800 MiB configured and only 265848 MiB in use. Over the test window that was 45 degradations and 45 removals: ≈48.5 GiB of already-parked state deleted, not archived (≈44 conversations at ≈1,128 MiB each; the net byte drop read smaller, −30.1 GiB, only because the same 45 degradations had just written ≈18.5 GiB in). The cap was also pre-existing to the cascade (07613f4b, the original durable tier): any spill into a cold pinned at 256 deletes the same way.

What it does. ba89b7fc — the count term is gone from the removal: the cold now evicts by its MiB budget, the lever the operator sets. The entry cap keeps only its other role, a reject level refusing new work instead of evicting for it. The cap also stopped being invisible: the startup lines declare max-conversations, /metrics exposes it per destination, and each removal and each degradation writes a line naming the victim and the lever (budget or age). A regression test (T11) fills the cold to its entry cap with MiB to spare and degrades one copy in: nothing may be removed.

What was measured. Before the fix: 45 degradations → 45 cold evictions (exact 1:1), ≈48.5 GiB of previously-parked material deleted. After the fix (re-test, 2026-10-15): 21 degradations → 0 cold evictions, the cold grew +21 conversations and +8,544 GiB (the Δ bytes; GiB, not MiB) and lost 0 — the counts rest on a host test and its mutation, declared, not reproduced. Sources: 09-implementacion/2026-10-15-diagnostico-eviccion-del-frio-v1.0.0.md and 09-implementacion/2026-10-15-fix-eviccion-del-frio-y-visibilidad-v1.0.0.md.

What this does not claim. The fix rests on a host test and its mutation, not a served run — it has no live measurement of its own; and the mutation was not executed (declared by the note). With no cascade configured the cold level behaves as before (same flag, folder, inheritance and read path; it is still the only level that removes, by budget and age). Owner's note: the test left ~26 GiB of synthetic material in the tier, and through this eviction the cold level lost ≈48.5 GiB of previously-parked material — the production tier changed content while it was being measured.

Upstream issues. No upstream issue covers the fix — it is a defect of ours, caught by our own test; related — #2448 (open) reads the eviction order as least-recently-used, where the code is FIFO.

The commits it needs.

commits (in order) take it alone? needs first verified?
ba89b7fc no J, H (b0c177f1), L (256d76b3) applies in order; not verified. The note declares host test T11 + a mutation; the mutation was not executed (declared by the note)

L. Monitor: per-slot clocks, tachometer, solo speed, RAM row

The problem. The Monitor did not list every batch slot or clock its context, its aggregate clock did not sum its slots, and the RAM row did not count what the slots hold.

What it does.

  • de0f1f3a — the Monitor draws the cascade's warm and cold levels.
  • 8f6bfa10 — lists every batch slot and clocks its context; 5320268c — the aggregate clock sums its slots, and the slot texts move right; 1895e7ed — the Context fill clocks flank the big one, a tachometer.
  • 256d76b3 — the slot speeds name the solo request, and the RAM row counts what the slots hold.

What was measured. No measurable before/after: the notes declare test_monitor.py (up to 38→47) + node --check + textual asserts; no browser render; the estimated row (kv_estimated) is not validated against a live engine.

What this does not claim. Not verified; no render in a browser; the kv_estimated row is not validated against the live engine; the asserts are textual.

Upstream issues. Related — #596 (closed/completed) asked for the conversation-cache view in the Monitor tab.

The commits it needs.

commits (in order) take it alone? needs first verified?
de0f1f3a, 8f6bfa10, 5320268c, 1895e7ed, 256d76b3 no I, J applies in order; not verified. The notes declare test_monitor.py (38→47) + node --check + textual asserts; no browser render; kv_estimated not validated live

M. Installer: several requests at once, and the conversations kept on disk

The problem. The installer asked nothing about running several requests at once or keeping the conversations on disk, and it chose the slot count after the context size was already fixed.

What it does. 528be20f adds two questions to the flow it already has — one request or several, and whether the conversations are kept on disk — placed after the model and the machine bench and before the context size, so the slot count is chosen with the model and the context already known.

  • The conversations-on-disk assistant (layer_args) writes --conversation-cache-mib 8192, --conversation-cache-warm-dir <install>\slots\warm --conversation-cache-warm-mib 8192 and the cold via --conversation-cache-disk-mib (the alias of the canonical -cold-*, so an engine older than the rename is not broken by a name). No new flag: --parallel N already existed, and a --parallel on the command line is the answer to the first question.
  • 6a93aadf — the conversation cache's RAM is off at 0, not unlimited, and it is not the KV cache (a text fix in setup.py; its message correction is "0 = off", not "0 = no limit").
  • The always-path does not change, and that is measured rather than asserted: setup.py before and after this change, across 5 machines × 5 sizes × (--yes or Enter), gives 50 cases and 50 identical results, with --yes asking nothing at all. No answer means the previous behaviour.

What was measured. The 50 cases / 50 identical results above, plus the golden 50/50; py_compile OK; tools/test_setup_*.py → 40 files, 580 tests, 0 failures. 6a93aadf declares py_compile OK + golden. Sources: 09-implementacion/2026-10-15-instalador-pasos-multislot-y-disco-v1.0.0.md.

What this does not claim. Not verified as a real install (no model downloaded, no engine started — the start is stubbed and fails if called). 6a93aadf is not published yet. The golden is declared, not reproduced here. Functionally the disk question needs J (it writes --conversation-cache-warm-*, which an engine older than the rename rejects).

Upstream issues. No upstream issue covers the installer flow (the parallel-requests path it surfaces is the engine's own --parallel N).

The commits it needs.

commits (in order) take it alone? needs first verified?
528be20f, 6a93aadf no N (d40cb783) for 528be20f; functionally J (it writes --conversation-cache-warm-*) applies in order; not verified. The note declares py_compile + golden 50/50 identical; 6a93aadf declares py_compile + golden — declared, not reproduced. 6a93aadf is not published

N. Documentation

The problem. The new flags and behavior needed documenting: a parked image's identity bound to the engine version, and the lever named.

What it does.

  • 940eb9bf — documents the disk tier, the restore ladder, the anchored frontier and the chunked large pages.
  • d40cb783 — documents the parking destination and the resolved spill directory.
  • 957d27b0 — binds a parked image's identity to the engine version, and names the lever.
  • The travelling docs (in the diff): docs/FLAGS.md, docs/SPILL_AND_PROMPT_CACHE.md, docs/DETAILS.md.

What was measured. Nothing — no measurable before/after: this is prose — not verified (there is nothing to measure).

What this does not claim. Prose, not verified. It documents the other capabilities; it does not by itself change behavior.

Upstream issues. No upstream issue — this is the documentation of the series.

The commits it needs.

commits (in order) take it alone? needs first verified?
940eb9bf, d40cb783, 957d27b0 no C, E, F (940eb9bf); A, I (d40cb783); d40cb783 for 957d27b0 applies in order; prose, not verified (nothing to measure)

Extra Notes

Measurements

Every figure below is real and carries its origin; each capability has its own table instead of one global one. A capability with no live figure says so.

A — durable on-disk conversation tier

what measured origin
restore from disk against a cold prefill 171,516 tokens in 657 ms read back from disk — the whole reload 6.6 s — against 158,649 ms (158.6 s) to prefill cold — ≈24× (against the 6.6 s reload, not the 657 ms read) the tier note of 2026-10-14 and the published body's demo table; the 657 ms line is in the engine log
the disk tier on disk (2026-10-15) 268.0 GiB of images + 53.9 GiB of segments across 256 conversations, against a 450 GiB budget a directory listing of the spill folder
system-prompt cache (whole engine log, 2026-10-15 11:27) 8 hits / 106 misses the engine log, patterns system prompt cache: hit \d+ tokens / prefix changed (miss

B — two-pass streaming session restore

what measured origin
the streaming restore itself no separate figure — it is the path that reads back A's 171,516 tokens in 657 ms the tier note of 2026-10-14

C — per-stage content-addressed segments

what measured origin
host checks (declared) 174 → 188 the commit's note — declared, not reproduced
shared-Sys dedup not conclusively measured (one pass, concurrent traffic) the coverage note of 2026-10-15

D — prefix restore ladder

what measured origin
host checks (declared) 1164 / 1404 in its tests the commit's note — declared, not reproduced
in-serve effect the image rejected branch did not fire in the live matrix → host-tested, not measured the live matrix

E — Windows chunked large pages + expert-arena-first

what measured origin
anything live nothing — no CUDA toolchain here; applies, not verified the cherry-pick measurement

F — continuous batch-read agenda

what measured origin
correctness (declared) a host test, declared the commit's note
throughput effect not measured the commit's note

G — parking target + spill-instead-of-discard + transient floor

what measured origin
production boot with the disk target (--conversation-cache-park disk; 2026-10-14 23:20:24 → 2026-10-15 07:02:42, closed) skip parking 0; park-to-disk 365; parks completed 272; restores from disk 277; discard snapshot (stage count) 53; K/V re-processed 3,123,699 / 26,117,121 = 12.0 % the engine log of that run, re-counted in the measurements note of 2026-10-15
the same gate before the change (window of 2026-10-14 19:32:30 → 20:22:03) skip parking 24; disk hit skipped 15; K/V re-processed 1,458,547 tokens = 2,110,865 ms (35.2 min) the window's own capture (raw-timestamped.log, events.jsonl), re-counted in the measurements note
host free RAM under the disk target (window 2026-10-15 00:13:23 → 00:18:40, 136 samples) mean 7,102 MiB (min 4,475 · max 9,936) the live measurement's snapshots.csv

I — disk-tier & cache observability

what measured origin
system-prompt cache 8 hits / 106 misses the engine log (read 2026-10-15 11:27)
engine INFO / /metrics / Monitor rows fixtures in Chrome headless, against a simulated /metrics — no live engine the notes' fixtures

J — the cascade

level freshness n restore ms (median / min / max)
warm (disk/…) fresh 36 92.2 / 38.5 / 1240.1
warm old 33 101.7 / 51.3 / 2834.3
cold (cold/…) fresh 30 106.0 / 62.3 / 163.7
cold old 41 104.1 / 41.0 / 141.4

The level does not weigh, and neither does freshness command the median: a floor of ~100 ms does (freshness only as a tail of the warm volume: 9 of 69 warm restores at 300–2834 ms, against 0 of 125 cold). Pooled (warm n=69, median 100.5 ms · cold n=125, median 97.3 ms) the ratio is 0.97 with interval [0.906–1.076] — it contains 1, so no ratio is asserted. The two earlier runs differed because they ran on different builds (one without the eviction fix, one with it): not contradictory, they measured different things. The datum that refutes the OS page-cache hypothesis: the images truly old (14, intact for hours) were the fastest (74.8 ms). The warm level's degraded counter went 0 → 45 in the first synthetic run and 0 → 21 in the re-test, holding at ~10,112 MiB of its 10,240 MiB budget. Source: 09-implementacion/2026-10-15-ab-por-nivel-y-frescura-v1.0.0.md.

K — cold-level eviction fix

degradations (warm→cold) cold evictions 1:1? cold GiB lost cold conversations
before (motor without the fix) 45 45 yes, exact ≈48.5 GiB 256 → 256
after (ba89b7fc) 21 0 no 0 256 → 277

The regression test T11 fills the cold to its entry cap with MiB to spare and degrades one copy in: nothing may be removed. Sources: 09-implementacion/2026-10-15-diagnostico-eviccion-del-frio-v1.0.0.md, 09-implementacion/2026-10-15-fix-eviccion-del-frio-y-visibilidad-v1.0.0.md.

L — Monitor

what measured origin
test_monitor.py up to 38 → 47 + node --check + textual asserts the notes
browser render none the notes
kv_estimated row not validated against the live engine the notes

M — installer

what measured origin
setup.py before vs after, 5 machines × 5 sizes × (--yes or Enter) 50 cases and 50 identical results; with --yes asking nothing at all 09-implementacion/2026-10-15-instalador-pasos-multislot-y-disco-v1.0.0.md
golden 50/50; tools/test_setup_*.py → 40 files, 580 tests, 0 failures idem

N — documentation

what measured origin
anything nothing — it is prose, so not verified —

Where each number comes from. Working notes of the author, on disk (paths relative to this repository's working tree):

  • The measurements and their procedure, one row per figure: 09-implementacion/2026-10-15-mediciones-y-procedencia-v1.0.0.md — every figure above with its exact pattern or command, the file it lives in, its window, and whether it reproduces.
  • Mechanism, the 2026-10-14 window and the code points of the gate: the eviction investigation of 2026-10-14 and the parking spec of 2026-10-14.
  • The two floors, the transistor and the flag table: the parking-logic note of 2026-10-14.
  • The cascade (levels, degrade instead of delete, all-or-nothing, the tests and the mutation check): the cascade implementation note of 2026-10-15.
  • Concurrency (declared) and the not-concurrent read: the concurrency declarations note of 2026-10-15 and the phase-prediction note of 2026-10-15.
  • The coverage read against the rival PRs: the coverage matrix of 2026-10-15.
  • The upstream issues crossed, with their state: the scope-and-issues note of 2026-10-15.
  • The travelling docs (in the diff): docs/SPILL_AND_PROMPT_CACHE.md and docs/FLAGS.md.
  • The two runs counted, the disk listing and the window's capture: the engine log of the server — the production run that opens 2026-10-14 23:20:24 (--conversation-cache-park disk) and the 2026-10-14 window (_medicion/2026-10-14-eviction/raw-timestamped.log, events.jsonl, snapshots*.csv) — read directly, and a directory listing of D:\AI\servers\strata\slots\xl.
  • The restore pair (657 ms / 6.6 s / 158.6 s): the tier note of 2026-10-14 (2026-10-14-entrega-por-commit/01-tier-de-disco-y-system-prompt-cache.md) and the published body's demo table.

Relationship to the issues and PRs this series sits beside

The verb is the strong verb the code supports, and no stronger.

issue verb why
#2597 (ours, open) — degrade the conversation cache across levels instead of deleting the oldest (RAM → fast M.2 → cold disk, each level switchable) closes This series implements exactly what it asks: the cache degrades across levels instead of deleting, only the last level discards, and each level is switched off by its own budget.
#2595 (ours, open) — discard snapshot (stage count: saved=0 current=1), 40 in one boot, one of 165,543 tokens mitigates The prefix restore ladder rescues the prefix from the bad image, so the turn does not lose it. It does not fix the cause: why the tier produced a 1-token image with a different stage count is not investigated, and our own notes say so.
#2596 (ours, open) — layer-split auto is not stable between starts and a different K invalidates the whole on-disk tier reports and documents This is a finding of ours, written up with its measurement, not a fix. Pinning --layer-split is the mitigation. It is not implemented here: a search of the series for any change to the split returns 0 commits.
#2508 (ours, open) — KV compaction and hot-swappable KV sessions related, not implemented Same territory (the stationary KV components, the segment dedup) as an aspirational direction. Nothing in the compaction path is touched here. We do have data to offer it: the system-prompt cache in the boot above measured 7 hits against 106 misses, i.e. the shared root is written far more often than it is read back.

Carried over from the published body, unchanged:

  • #1347 (closed, completed) — the park gate. Its fix covers the case with parked conversations left to evict; this series closes the residue of the same hole, where the RAM cache is empty and there was nothing to evict. The transient floor for the disk hit is a separate corner: a copy that already exists on disk, not RAM the engine would keep.
  • #2275 (open) and PR #2050 (open) — the inert BYIELD on the pipelined route is theirs: batch_read_piece() returns 0 for the pipelined groups, so the decode-share block and the BYIELD point below it are unreachable by construction, and #2050 fixes it opt-in (STRATA_PIPED_READ_PIECE, measured pause 12.2 s → 4.2 s). This series cites both and does not re-implement them; see also #1906 and #1603.
  • #1620 (closed, not planned) — a cancelled request loses the conversation cache entry it restored. Our provisional park implements the fix #1620 proposed. The server's parks counter does not count that path, so it under-counts the real parking decisions; the metric is left as is.
  • #1572 (closed, completed) — Optionally reclaim disposable host caches when session SAVE needs RAM. Terrain closed upstream; our residual is only the reclaim target: session_save_reclaim(...) still aims at the large floor while the save's gate now admits the transient one.
  • #2507 (ours, open) — per-slot expert budget and PCIe-idle prefetch: expert budget, not conversation state on disk.

Relationship to the other on-disk tiers in flight, measured. Five open PRs implement a durable conversation tier on disk: #1271 (ANBAL534), #1480 (routhjim), #1529 (konijiwa110), #1810 (CC-David-CC) and #1937 (xrip). #1271, #1480, #1529 and #1810 introduce the same three new paths this series does (include/strata/core/conversation_spill.hpp, src/core/conversation_spill.cpp, src/core/conversation_spill_test.cpp), so one of us will merge and the rest will be add/add conflicts; #1937 takes the other route and modifies the cache in place with its own conversation_disk.*. What follows is what this package covers, what each of the others covers that it does not, and what none of us covers. Every claim below is pointed at a flag or a file, and the facts about the other PRs were read from their patches and threads through the GitHub API, read-only.

What this package covers, with the pointer

capability here
durable image on disk --conversation-cache-spill-dir, --conversation-cache-spill-on park; conversation_spill.{hpp,cpp}
restore on re-entry best() / load(); the sidecar carries tokens and images, not K/V
capture on a park the physical-RAM gate refuses (spill instead of discard) conversation_park_placement() in conversation_memory.hpp
a background write of the tier the spill tier owns its writer thread (only the write is asynchronous)
persistence across restarts the spill folder survives; the SCSM sidecar is rescanned on open
identity and validity SessionFileIdentity (model fingerprint + config fingerprint, engine = STRATA_VERSION)
sidecar metadata, match without reading K/V SCSM — MetaWriter/MetaReader
file format and its version kMetaVersion = 2; v1 is still read — the v1 sidecar of #1271/#1480/#1529/#1810 is accepted
a warm level above the disk tier, and a cascade that degrades instead of deleting --conversation-cache-warm-dir/-warm-mib; the cold is --conversation-cache-cold-dir/-cold-mib (aliases of the historical -spill-dir/-disk-mib); set_next / degrade_to_next / adopt; only the cold deletes — no PR in the group has this
tier budget and GC --conversation-cache-disk-mib (8192), --conversation-cache-spill-when-full evict-oldest|reject
age pruning --conversation-cache-spill-max-age-days
shared root for new conversations --system-prompt-cache (its own dir/budget/slots/max-age/key) and the shared-Sys dedup of the segment tier
content-addressed per-stage segments --conversation-cache-segments, --conversation-cache-segment-budget-mib; conversation_segments.{hpp,cpp} — no PR in the group has this
prefix restore ladder STRATA_RESTORE_LADDER; conversation_restore_ladder.hpp — no PR in the group has this
parking target --conversation-cache-park ram|disk|auto — no PR in the group has this
a transient floor for everything bound to disk --conversation-cache-park-min-free-mib (512) against the parking floor's 2560, applied to the disk hit, the segment hit, the system-prompt-cache hit, the streamed restore and the API session save — no PR in the group has this
free-space preflight on writes --session-min-free-mib (4096)
counting and visibility serve/server.py conversation_cache.destinations, spill_on, live.admission; the Monitor tab
layer split one session file per stage, one joint sidecar — measured live on a 2-GPU split

Where another PR covers something this one does not

  • #1480, #1529, #1810 and #1937 save straight from the live session's pools (SessionKvSource), so a park never materialises a host image; #1529 and #1810 additionally write it on a background thread (spill_async). This series captures to host RAM and only the write is asynchronous. One of #1937's testers priced the difference at 27x between the capture and the streamed write. If the smaller memory bill at park time is what the maintainer wants, that work is in those PRs.
  • #1937 reads a disk image straight into the GPU pools (SessionKvTarget, conversation_snapshot_restore_streamed), with no host copy of the K/V, measured at 3,048 MiB into the GPUs in 4.1 s. This series' two-pass restore streams in 16 MiB blocks but through host RAM; there is no SessionKvTarget in this tree.
  • #1937 carries the widest evidence in the group, and it is external: four independent testers, one on a Windows single-GPU box, one on a 2-GPU layer split, one validating the written volume with smartctl (131.8 GB in 70 min, ~2.7 TB/day on a 256 GB NVMe), and one CONTRIBUTOR who found a correctness bug (index vs payload binding) and saw it fixed. The newest commits of this series have had no live run.
  • #1271 matches on similarity (--conversation-cache-similarity F, --conversation-cache-n-min N); this series' match is an exact prefix from the start, as the RAM cache's is.
  • #1529 has --conversation-cache-disk-min-tokens (do not write a conversation shorter than N) and keeps two checkpoints — the deepest and the root — which halves the file (603-699 MiB against 1149-1618 MiB) and is exactly what a new chat resumes from.
  • #1480 has persistent prefix entries (strata-conv-prefix-N): never dropped as superseded, evicted last, deduped across restarts. This series reaches a similar goal with the system-prompt cache and the segment tier, by a different mechanism.
  • #1810 versions its cache policy inside the saved-state fingerprint and refuses an unversioned reproducible snapshot instead of restoring it; its correctness evidence (exact token-ID parity across RAM, disk-only and fallback, greedy and seeded) is the most rigorous in the group.
  • One factual note: conversation_spill.hpp and conversation_spill.cpp are byte-identical between #1529 and #1810 at the heads measured (same content hash).

Where this package covers something the others do not

  • The transient floor. #1480, #1529 and #1937 gate the disk read on the same large parking floor that the park uses. A third-party tester on Windows measured what that costs in #1937 — "the path written for 'the RAM refused' refuses its own read too": 3 of 10 synthetic read-backs and 2 of 4 in a real session refused, with not enough RAM even for the running state: 2895 MiB available, and asked for a separate, lower floor for the read. --conversation-cache-park-min-free-mib (512 against 2560) is that floor, and it is applied to every path whose copy is already on disk.
  • A cascade that degrades instead of deleting, with each level switchable. Every implementation in the group removes the oldest entry at its budget; none offers a colder level to demote to. This series does, and it is opt-in by the mere presence of a warm directory.
  • Content-addressed per-stage segments, a prefix restore ladder and a system-prompt cache, in one series. No PR in the group has any of the three.
  • A Monitor split by destination and by admission state (RAM plus one row per configured disk tier, the spill_on mode, and whether an admission in progress is loading or reading). #1480, #1529 and #1810 add a card; #1937 logs lines and a totals line.

What none of us covers

  • A delta write. Every park rewrites the whole image: one of #1937's testers measured 131.8 GB in 70 minutes and called it the gating item for keeping the tier; #2264 and #2448 are the upstream reports. This series does not change it either — and note that the cascade retains more copies (it stops deleting in the warm level), so without the incremental write it can increase the volume written at the warm level's frontier.
  • The root cause of discard snapshot (stage count), the run-to-run instability of --layer-split auto, and the pipelined prompt read that cannot give way (#2275, fixed opt-in by PR #2050): all declared below, none fixed here.

Why one PR and not several. The contribution was verified as one tree: it was built, deployed and measured integrated, and its capabilities were not validated in isolation — 27 of the 31 commits need the ones before them, and some capabilities are unsafe without their companions (the cascade, taken without the cold-eviction fix, deletes parked state instead of degrading). Splitting this series would publish configurations whose behaviour was never measured. For a reviewer who wants a subset, The commits each capability needs gives the minimal ordered set for each capability and marks the independent ones — the disk tier, for instance, can be taken without the cascade.

The commits each capability needs

The series is a chain: on a clean 296b59d2, only 07613f4b, c514173e, 3e14ba41 and 7b965cb3 apply alone; the other 27 need the earlier commit(s) that touch the same files. To take a capability, take its commits plus everything it lists under needs, in the order of this table. 14 capabilities (A–N); 31 commits = 30 published (296b59d2→ba89b7fc) + 6a93aadf (child, not published yet); 3 independent — A, B and E.

"Take it alone? yes" means exactly one thing: the cherry-pick lands without conflict on 296b59d2. It is a verdict of application, not of semantics — a capability marked no can still be functionally autonomous, and a yes is not a promise that the feature works on its own. C++ that was never compiled reads applies, not verified, never a tilde.

capability commits (in order) take it alone? needs first verified?
durable on-disk conversation tier (spill, archive, system-prompt cache) 07613f4b yes — applies alone; Python parses OK; C++ not compiled
two-pass streaming session restore c514173e yes — applies alone; C++ not compiled
per-stage content-addressed segments (+ anchored frontier) 26d29b52, 7cd80013 no tier + streaming restore not verified
prefix restore ladder 1cc359d4 no streaming restore, segments not verified
Windows chunked large pages + expert-arena-first 3e14ba41 yes — applies alone; C++/CUDA not compiled
continuous batch-read agenda 0269a3c2 no segments, ladder (context only) not verified; the throughput effect is not measured
parking target + spill-instead-of-discard + transient floor acc09864, 571f1203 no batch agenda (file-level; needs the disk tier, not the cascade) not verified; no run of this integrated binary
default spill / system-prompt-cache directories 2f8d3cad, b0c177f1 no parking; and the cascade, for b0c177f1 not verified
disk-tier & cache observability (INFO, /metrics, Monitor rows) 20e5760b, b9b83c86, 16b67c46, 1f572df4 no tier, parking, defaults not verified; fixtures against a simulated /metrics
the cascade (warm level; degrade instead of delete) ac5a1746, 33d41214, 686d0b57, bb31e4e4 no tier; observability (16b67c46). Do not take without the cold-eviction fix below not verified; the live A/B is synthetic and no ratio is asserted (the pooled CI contains 1)
cold-level eviction fix (budget, not a hidden count of 256) ba89b7fc no cascade, defaults, Monitor runner not verified
Monitor: per-slot clocks, tachometer, solo speed, RAM row de0f1f3a, 8f6bfa10, 5320268c, 1895e7ed, 256d76b3 no observability, cascade not verified; no browser render
installer: several requests + conversations on disk 528be20f, 6a93aadf no docs; and the cascade (it writes --conversation-cache-warm-*) not verified; 6a93aadf is not published yet
documentation 940eb9bf, d40cb783, 957d27b0 no segments/large pages/agenda; tier prose, not verified
tests only (no capability) 7b965cb3 yes — applies alone; Python parses OK
everything all 30 up to ba89b7fc (+ 6a93aadf next push) — the whole series applies clean in order; 4 apply alone; C++ not compiled

The one grab worth calling out: the durable on-disk tier (07613f4b) — and the whole first chain (tier → streaming restore → segments → ladder → large pages → batch agenda + docs) — is self-contained: it needs nothing from the parking work, the cascade or the installer. And the cascade (J) is not a safe take without the cold-eviction fix (K): without ba89b7fc the warm level degrades into a cold that deletes by a hidden cap of 256.

The series in order, oldest first: thirty commits on 296b59d2, messages verbatim (no hashes by hand - git log at the tip, published 2026-10-15).

  1. 07613f4b - serve: durable disk tier for the conversation cache (spill, archive, system-prompt cache)
  2. c514173e - serve: two-pass streaming session restore (read pass validates, apply pass copies 16 MiB at a time)
  3. 26d29b52 - serve: per-segment disk tier for the conversation cache (content-addressed segments)
  4. 7cd80013 - serve: anchor the segment frontier at the <|im_start|> opener, not the role token
  5. 1cc359d4 - serve: prefix restore ladder when a parked image fails validation (STRATA_RESTORE_LADDER)
  6. 3e14ba41 - cuda: reserve the expert arena before the PLE/GGUF, and Windows chunked large pages
  7. 0269a3c2 - serve: continuous agenda for batched reads (STRATA_BATCH_AGENDA, opt-in)
  8. 940eb9bf - docs: document the disk tier, restore ladder, anchored frontier and chunked large pages
  9. acc09864 - serve: --conversation-cache-park (ram|disk|auto), and a rejected park spills to disk instead of discarding
  10. 571f1203 - serve: the transient disk floor decides the sibling disk hits and the API session save/restore too
  11. 2f8d3cad - serve: default the conversation spill directory (--conversation-cache-spill-dir)
  12. 20e5760b - serve: expose the disk tier's folder and live state, and the admission source, to the Monitor
  13. b9b83c86 - serve: the Monitor shows the parking by destination, the per-slot speeds and the admission state
  14. d40cb783 - docs: document the parking destination and the resolved spill directory
  15. 7b965cb3 - test: cover the admission source, the INFO line and the disk lifecycle in the Monitor
  16. 16b67c46 - serve: expose the system-prompt cache's folder and budget in the INFO line
  17. 1f572df4 - serve: expose the system-prompt cache's folder and budget, and stop reporting an absent counter as 0
  18. 957d27b0 - docs: bind a parked image's identity to the engine version, and name the lever
  19. ac5a1746 - serve: name the disk tier's cold level (--conversation-cache-cold-dir)
  20. 33d41214 - cache: the disk tier degrades to a next level instead of removing (delta 6)
  21. 686d0b57 - serve: the conversation cache gains the warm level of the cascade
  22. de0f1f3a - serve: the Monitor draws the cascade's warm and cold levels
  23. bb31e4e4 - serve: the run config and the docs carry the cascade
  24. b0c177f1 - serve: default --system-prompt-cache-dir like the spill directory
  25. 8f6bfa10 - serve: the Monitor lists every batch slot and clocks its context
  26. 5320268c - serve: the Monitor's aggregate clock sums its slots, and the slot texts move right
  27. 1895e7ed - serve: the Context fill clocks flank the big one, a tachometer
  28. 528be20f - setup: several requests at once, and the conversations kept on disk
  29. 256d76b3 - serve: the Monitor's slot speeds name the solo request, and the RAM row counts what the slots hold
  30. ba89b7fc - conversation cache: the cold level evicts by its MiB budget, not by a hidden cap of 256 entries

Known limitations and what is not in this PR

This section keeps the items of the earlier body's ## Declared limitations and ## What we do not claim and extends them. Where upstream already tracks a problem the issue is cited so the reviewer can route it; where it does not, the limitation is simply stated and is not a claim.

Declared limitations.

  1. --layer-split auto is non-deterministic between starts: the 100k reload's first attempt failed (unreadable chain … saved with another layer range) and re-prefilled; the retry with a stable split restored 99,715/99,722. Pinning the split is the mitigation. (Reacted in #2596; issues #509, #1238 and #2463 discuss which K auto picks, none covers run-to-run stability or the invalidated tier.)
  2. The park writes on the next turn or on clean shutdown, not at the end of the request — a force-kill loses the copy.
  3. The effort frontier is not page-aligned: a cut on a position that is not a multiple of page_size can be rejected for a live restore.
  4. The segment plan cuts three pieces (Sys, Other, Answer); Think/Read/Write/ToolCall/ToolResult exist in the enum but are not materialized (the cutter is missing).

Known limitations of the newer work.

  • The read is not concurrent — it is a complete stop of the decode. pipe_drain() sits at the top of the serve loop, before the admission is processed, and from there to the end of the request nothing else drives a decode window: pump() and batch_step() run on the single serve thread. The disk match, the two-pass stream, the restore into the session, the device-to-device copy into the batch slot and — on the production (pipelined) route — the prefill of the new prompt's tail all run inside that one admission. What is asynchronous is the write of the park mirror; the read is not. On the pipelined route batch_read_piece() returns 0, so read_part takes one uninterrupted run and both the BYIELD hand-over and the decode-share interleave are unreachable there. That last finding is #2275's, cited above, not ours.
  • The inheritance of already-parked conversations depends on not touching STRATA_VERSION. The engine recognises a directory by the strata-conv- prefix and the sidecar identity, not by which flag opened it, so the cold level inherits the existing tier with zero migration — but a STRATA_VERSION bump makes every on-disk image foreign silently. On the first real start after this lands, the cold level's start line must read foreign kept=0; if it is not 0, the inheritance failed and the run must stop. STRATA_VERSION is not touched in this series.
  • T11 (the cross-volume relocate) is not covered. The move falling back from rename to copy_file+remove across two volumes is the one path in the degradation that no test exercises: the harness cannot mount a second volume, so it is left uncovered rather than invented. What is covered is its consequence — a move that fails leaves nothing half-done on either side (the test takes the file exclusively so both the rename and the copy fail).
  • The read of the cold level is costlier than the warm one, and that cost is not measured as a pair. That a colder medium is slower is a premise of the request, not a measurement here. What is measured is that an image read is a full stop of the decode (above) and that a disk restore of 171,516 tokens took 657 ms.
  • The degradation is all-or-nothing, and the counters are coarse. degraded is a single total (budget and age together), not two; and a degradation performed by the writer thread is reported on the counter's next read, not at the instant. The segment store and the archive stay inside the cold level; moving them is another PR.
  • Single-slot configurations are compatible by construction, not measured live. Neither a serial (no --batch) engine with the disk tier and --conversation-cache-park disk|auto, nor any configuration where --conversation-cache-slots differs from --batch, was exercised on a live engine; only the host policy tests cover them. --batch 1 itself is refused by the engine ("it needs 2 or more slots"), so "one slot" means the serial serve.
  • In disk mode, a rejected disk write has no RAM fallback (the capture is counted and logged as discards=N), and a provisional park stays in RAM by decision. In ram mode, a park provisional (cancelled request) also keeps the large floor.
  • The 4224-byte KV block used to convert block-read misses to MiB is hard-coded in the engine; a different model geometry would leave it stale, silently.
  • The physical-RAM gate that used to discard a snapshot was closed upstream in #1347 (completed). When neither the parking floor nor the 512 MiB transient floor holds, a disk hit is still skipped (disk hit skipped).

Not covered, with its name (this is the honest shortfall of the package; each is named so it can be routed).

  • A park written straight from the live K/V pools. This series captures to host RAM first; #1480, #1529, #1810 and #1937 write the park from the session's pools without materialising a host image.
  • A policy on top of the similarity / n-minimum filters. The two knobs are already here — this series added them (--conversation-cache-similarity and --conversation-cache-n-min, commit serve: durable disk tier for the conversation cache, and they are not in upstream main) — and both sit at their defaults (0), so a disk hit is accepted with no minimum overlap. This package adds no policy on top of them.
  • End-to-end evidence for the newest commits. They rest on a host test build plus a compile of the generate.cpp object; there is no live engine run and strata.exe was not linked. #1480, #1529, #1810 and #1937 bring their own end-to-end measurements; this is the largest evidence gap in the package.
  • Third-party validation. The package has not been executed by anyone outside this house; #1937 has four independent testers, one of them on Windows.

What the numbers do not say.

  • One machine, one model, one pass per cell; not a benchmark and no throughput promise. tok/s figures are contaminated by concurrent traffic on the live server. No absolute PCIe bytes (no DCGM on this box; the engine's own per-request proxies were used).
  • The counters of the production boot above are a snapshot of a live log: the log is written continuously and every count grows while the engine runs. They are one read of one boot, and the baseline window and the after window are different traffic, not an A/B.
  • The shared-Sys dedup is not conclusively measured (one pass, concurrent traffic); the restore ladder's image rejected branch did not fire in the live matrix, so its in-serve effect is host-tested, not measured.
  • Disk restore latency may be assisted by the OS file cache (2.9 GB in 274 ms ≈ 10.6 GB/s); not measured cold. No effect of disk mode on decode or answer quality was measured.
  • The newest bodies of work were verified by a host ctest run and by a cl /Zs syntax check of generate.cpp; no CUDA build, no live engine run, and strata.exe was not linked. The cascade's warm level is new code: its 406 host checks and its mutation check pass, but nothing of it has been served.

Credits

This layer is authored and directed by Shahrokh Zargarpour. The parking target, the transient floor and the cascade were written and verified with the Grok Build coding agent.

🤖 Generated with Grok Build — Flash Next XL Strata · DeepSeek V4 Flash

The on-disk spill sidecar format we build on — the SCSM header and the MetaWriter/MetaReader pair, version 1 — is credited to the authors whose PRs carry it: #1271 (ANBAL534), #1480 (routhjim), #1529 (konijiwa110) and #1810 (CC-David-CC). Our sidecar is a backward-compatible superset (kMetaVersion = 2; "v1 (single image) is still read"): we read their v1, they do not read our v2. The v1 origin is credited to them by prudence — the timeline is ambiguous and we did not inspect their fork history to settle authorship.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2510 **Author:** [@shahrokhzargarpour](https://github.com/shahrokhzargarpour) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `aporte/entrega-0.1.44` --- ### 📝 Commits (10+) - [`07613f4`](https://github.com/Niko1221/Strata/commit/07613f4b6731bfd509b4bc604024666f2f65c048) serve: durable disk tier for the conversation cache (spill, archive, system-prompt cache) - [`c514173`](https://github.com/Niko1221/Strata/commit/c514173ea3a790e1527b2f4e5c960184c10af3ea) serve: two-pass streaming session restore (read pass validates, apply pass copies 16 MiB at a time) - [`26d29b5`](https://github.com/Niko1221/Strata/commit/26d29b52534c08614e075625076d27d022b45a8e) serve: per-segment disk tier for the conversation cache (content-addressed segments) - [`7cd8001`](https://github.com/Niko1221/Strata/commit/7cd800137b10d6aafce5a612abd1a5c6eb5e1beb) serve: anchor the segment frontier at the <|im_start|> opener, not the role token - [`1cc359d`](https://github.com/Niko1221/Strata/commit/1cc359d4d59ce789127b84f050028457e9af7dcc) serve: prefix restore ladder when a parked image fails validation (STRATA_RESTORE_LADDER) - [`3e14ba4`](https://github.com/Niko1221/Strata/commit/3e14ba4190d250e58fea706f20311105485d6492) cuda: reserve the expert arena before the PLE/GGUF, and Windows chunked large pages - [`0269a3c`](https://github.com/Niko1221/Strata/commit/0269a3c230fc2b5f88b1706713c341cdea3c397b) serve: continuous agenda for batched reads (STRATA_BATCH_AGENDA, opt-in) - [`940eb9b`](https://github.com/Niko1221/Strata/commit/940eb9bfaadf2eb06e94e4996dfdc89112c5993c) docs: document the disk tier, restore ladder, anchored frontier and chunked large pages - [`acc0986`](https://github.com/Niko1221/Strata/commit/acc0986495f4638011028ebf88a4234833cb54ad) serve: --conversation-cache-park (ram|disk|auto), and a rejected park spills to disk instead of discarding - [`571f120`](https://github.com/Niko1221/Strata/commit/571f120322bb7568fd77c17a038c7958fc089ad0) serve: the transient disk floor decides the sibling disk hits and the API session save/restore too ### 📊 Changes **46 files changed** (+12699 additions, -226 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+41 -1) 📝 `README.md` (+10 -0) 📝 `docs/DETAILS.md` (+139 -4) ➕ `docs/FLAGS.md` (+287 -0) ➕ `docs/SPILL_AND_PROMPT_CACHE.md` (+621 -0) ➕ `include/strata/core/agenda.hpp` (+179 -0) 📝 `include/strata/core/conversation_cache.hpp` (+145 -15) 📝 `include/strata/core/conversation_file.hpp` (+33 -1) 📝 `include/strata/core/conversation_memory.hpp` (+55 -0) ➕ `include/strata/core/conversation_prompt_cache.hpp` (+138 -0) ➕ `include/strata/core/conversation_restore_ladder.hpp` (+90 -0) ➕ `include/strata/core/conversation_segments.hpp` (+291 -0) 📝 `include/strata/core/conversation_snapshot.hpp` (+58 -0) ➕ `include/strata/core/conversation_spill.hpp` (+504 -0) ➕ `include/strata/core/conversation_spill_dir.hpp` (+134 -0) 📝 `include/strata/core/expert_source.hpp` (+14 -0) 📝 `include/strata/core/pinned.hpp` (+64 -4) ➕ `include/strata/core/system_prompt_cache_dir.hpp` (+119 -0) 📝 `serve/runconfig.py` (+92 -5) 📝 `serve/server.py` (+381 -15) _...and 26 more files_ </details> ### 📄 Description ## Title serve: a durable on-disk conversation tier with a warm→cold cascade that degrades instead of deleting, per-stage segments, a prefix restore ladder, Windows chunked large pages, and a parking target (ram|disk|auto) that spills a rejected park Issue: Resolves #2597 ## Summary **This series is built, and it is what runs.** The engine binary produced from this tree is the one serving on the machine that took every measurement in this body; the numbers below are that binary's. Where this document says **"applies, not verified"**, it refers to the **cherry-pick-alone** case in *The commits each capability needs*: a commit applied on its own to `main` was checked for conflicts, and nothing was compiled in that scratch tree. It is **not** a statement that the code was never built. **Fourteen capabilities in one series; all of it opt-in and off by default.** With every flag absent the tree is byte-for-byte upstream, and the series applies clean in order on the base. The map, one line each: - **A. Durable on-disk conversation tier** (`07613f4b`) — the conversation cache gets a disk copy (spill, archive, system-prompt cache). - **B. Two-pass streaming session restore** (`c514173e`) — restore a parked image without holding its K/V in RAM. - **C. Per-stage content-addressed segments** (`26d29b52`, `7cd80013`) — the shared prefix as addressable pieces, with the frontier anchored at the `<|im_start|>` opener. - **D. Prefix restore ladder** (`1cc359d4`, `STRATA_RESTORE_LADDER`) — a parked image that fails validation no longer loses the prefix. - **E. Windows chunked large pages + expert-arena-first** (`3e14ba41`) — the CUDA side. - **F. Continuous batch-read agenda** (`0269a3c2`, `STRATA_BATCH_AGENDA`, opt-in). - **G. Parking target + spill-instead-of-discard + transient floor** (`acc09864`, `571f1203`) — the transistor `ram|disk|auto`. - **H. Default spill / system-prompt-cache directories** (`2f8d3cad`, `b0c177f1`) — the folder resolves without a flag. - **I. Disk-tier & cache observability** (`20e5760b`, `b9b83c86`, `16b67c46`, `1f572df4`) — engine `INFO`, `/metrics`, Monitor rows. - **J. The cascade** (`ac5a1746`, `33d41214`, `686d0b57`, `bb31e4e4`) — a warm level; a level at budget degrades instead of deleting; only the cold deletes. - **K. Cold-level eviction fix** (`ba89b7fc`) — the cold evicts by its MiB budget, not by a hidden cap of 256 entries. - **L. Monitor** (`de0f1f3a`, `8f6bfa10`, `5320268c`, `1895e7ed`, `256d76b3`) — per-slot clocks, a tachometer, the solo speed, the RAM row. - **M. Installer** (`528be20f`, `6a93aadf`) — several requests at once, and the conversations kept on disk. - **N. Documentation** (`940eb9bf`, `d40cb783`, `957d27b0`) — the tier, the ladder, the frontier, the pages, the parking, the identity. Three of the fourteen **apply alone on `296b59d2`** — **A, B and E** ("apply alone" means the cherry-pick is conflict-free, not that the capability runs on its own). The rest are a chain, and each says in its own section which commits it needs. Every capability below is a self-sufficient unit: its problem, its flags and defaults, its numbers with their source, what it does **not** claim, and the minimal set of commits to take it. Two framings hold for the whole series. **The parking work** adds a parking target and the rule that closes the hole the disk tier was built for: when the physical-RAM gate rejects a park, the capture is no longer discarded — it spills to disk under a transient floor, and a discard is now *counted* and printed (`discards=N`). **The cascade** gives the disk tier a level above it: the conversation cache runs **RAM → warm M.2 → cold disk**, and a level that runs out of budget **demotes** its oldest entry instead of deleting it; only the cold level deletes, and each level is switched off by its own budget. **The installer's always-path does not change, and that is measured rather than asserted:** `setup.py` before and after the change, across 5 machines × 5 sizes × (`--yes` or Enter), gives **50 cases and 50 identical results**, with `--yes` asking nothing at all. ## What changed ### A. Durable on-disk conversation tier (spill, archive, system-prompt cache) **The problem.** With four parallel slots, long contexts and a bounded `--kv-resident`, host RAM runs out while a conversation is being parked, and the disk tier sits *after* the physical-RAM admission gate. When the gate failed, the engine **dropped the capture instead of spilling it**, so the next turn **re-prefilled the whole prompt from token 0**. There was no durable on-disk copy of a parked conversation to fall back on at all. **What it does.** The conversation cache keeps a durable on-disk copy. - `--conversation-cache-spill-dir` + `--conversation-cache-spill-on park` — the spill folder and the moment it is written; the folder survives a restart and the `SCSM` sidecar is rescanned on open. - The spill tier owns its **writer thread** (only the write is asynchronous). The `SCSM` sidecar carries tokens and images, not K/V; `best()`/`load()` restore on re-entry. - **Identity and validity** — `SessionFileIdentity` (model fingerprint + config fingerprint, `engine = STRATA_VERSION`). `kMetaVersion = 2`; **v1 is still read**. - **Budget and GC** — `--conversation-cache-disk-mib` (**default `8192`**), `--conversation-cache-spill-when-full evict-oldest|reject`, `--conversation-cache-spill-max-age-days`. - **Free-space preflight** — `--session-min-free-mib` (**default `4096`**). - **Shared root** — `--system-prompt-cache` (dir/budget/slots/max-age/key) and the shared-`Sys` dedup of the segment tier. - **Match knobs** — `--conversation-cache-similarity` and `--conversation-cache-n-min`, both at their defaults (**`0`**), so a disk hit is accepted with no minimum overlap. (These two are **not** in upstream `main`.) - With every flag absent the tree is byte-for-byte upstream. **What was measured.** - Restore from disk against a cold prefill: **171,516 tokens in 657 ms** read back from disk — the whole reload **6.6 s** — against **158,649 ms (158.6 s)** to prefill the same prompt cold — **≈24×** (the ratio is against the 6.6 s reload, not the 657 ms read). Source: the tier note of 2026-10-14 and the published body's demo table; the 657 ms line is in the engine log. - The disk tier on disk (2026-10-15): **268.0 GiB of images** + **53.9 GiB of segments** across **256 conversations**, against a 450 GiB budget. Source: a directory listing of the spill folder. - System-prompt cache (the whole engine log, read 2026-10-15 11:27): **8 hits / 106 misses**. - **Changing the system prompt invalidates all reuse today** (live engine, 2026-10-15): the control (identical system prompt) reuses **3943/3948**; a change **at the end** reuses **0/4226**; a change **in the middle** reuses **0/3958**; and the control that proves it — the same changed prompt sent a second time — reuses **4221/4226**. Counts identical across 3 repetitions. **The cause is located:** the hash of each segment **chains the frontier** (`prev_frontier`), and the system prompt is the **first** segment — the **root** of the chain; the matcher cuts at the first divergence (`a segment after a hole can never be a valid reuse`). Source: `src/core/conversation_segments.cpp` and `09-implementacion/2026-10-15-system-prompt-recalculable-v1.0.0.md`. **Updates we plan** (design, not implementation, no date promised): stop the segment identity from chaining the frontier; store the K **de-rotated** and re-anchor them; and recompute the recurrent state (**GDN**) **bounded to the changed span**. **What this does not claim.** The C++ of this commit was **not compiled**: the state is **applies, not verified**, never a tilde. The ≈24× is against the 6.6 s reload, not the 657 ms read. One machine, one model, one pass per cell — not a benchmark and no throughput promise. **Upstream issues.** Related — **#47** and **#661** (both closed/completed) are the origin requests for a conversation tier on disk; **#2596** (ours, open) *reports and documents* that a different `K` invalidates the whole on-disk tier. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `07613f4b` | **yes** | — | applies alone on `296b59d2`; `serve/runconfig.py`, `serve/server.py`, `serve/test_monitor.py`, `serve/test_runconfig.py`, `setup.py` → `py_compile` OK; **the C++ not compiled → applies, not verified** | ### B. Two-pass streaming session restore **The problem.** Restoring a parked image materialised the K/V in host RAM; a large image held its whole K/V in RAM during the restore. **What it does.** The session restore runs **two passes**: the read pass validates the image, the apply pass copies it in **16 MiB blocks** — so the K/V is not held in RAM as one whole. **What was measured.** No separate figure of its own — **no measurable before/after**: the mechanism is measured through A's restore pair (171,516 tokens / 657 ms read / 6.6 s reload / 158.6 s cold), where the two-pass restore is the path that reads it back. Source: the tier note of 2026-10-14. **What this does not claim.** Only C++/`.cu`/docs — **the C++ was not compiled: applies, not verified**. There is no isolated measurement of the streaming pass itself. **Upstream issues.** Related — **#1269** (open PR) carries a nearly identical streaming-restore title; **#747** (closed/completed) is the multi-GPU parking terrain the streamed restore reads back. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `c514173e` | **yes** | — | applies alone on `296b59d2`; only C++/`.cu`/docs → **applies, not verified** | ### C. Per-stage content-addressed segments (and the anchored frontier) **The problem.** A park rewrites the whole image at once, and the shared root of a prompt (`Sys`) is written far more often than it is read back: the engine had no way to address the reusable pieces of a prompt separately. **What it does.** - `--conversation-cache-segments` + `--conversation-cache-segment-budget-mib` — a **content-addressed per-stage** segment tier; `conversation_segments.{hpp,cpp}`. - `7cd80013` — the **frontier** of the segment store is anchored at the `<|im_start|>` opener, not at the role token. **What was measured.** Nothing live for this commit on its own — **no measurable before/after**: the note declares host checks **174 → 188** — **declared, not reproduced**. The shared-`Sys` dedup is **not conclusively measured** (one pass, concurrent traffic). **What this does not claim.** Not verified (the measurement does not run a parse per commit, and the C++ is not compiled here). The segment plan currently cuts **three** pieces (`Sys`, `Other`, `Answer`); `Think`/`Read`/`Write`/`ToolCall`/`ToolResult` exist in the enum but are **not materialised** (the cutter is missing). The `Sys` dedup is not conclusively measured. **Upstream issues.** Related — **#2508** (ours, open) proposes compacting the stationary KV components, the same territory as the segment dedup; **#1962** (open) proposes sharing prefix KV blocks. No upstream issue covers the cutter itself. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `26d29b52`, `7cd80013` | no | A, B | applies in order; not verified. The note declares host checks 174→188 — declared, not reproduced | ### D. Prefix restore ladder (`STRATA_RESTORE_LADDER`) **The problem.** A parked image that fails validation — e.g. `discard snapshot (stage count: saved=0 current=1)` — loses the prefix, and the turn re-prefills. (#2595 is 40 of these in one boot, one of 165,543 tokens.) **What it does.** `STRATA_RESTORE_LADDER` — when a parked image fails validation, the ladder rescues the prefix from the bad image so the turn does not lose it; `conversation_restore_ladder.hpp`. **What was measured.** The ladder's `image rejected` branch **did not fire in the live matrix**, so its in-serve effect is **host-tested, not measured** — **no measurable before/after**. The note declares host checks (1164/1404 in its tests) — **declared, not reproduced**. **What this does not claim.** It does **not** fix the cause: why the tier produced a 1-token image with a different stage count is **not investigated**, and our own notes say so (**#2595 mitigates**). Not verified. **Upstream issues.** **Mitigates #2595** (ours, open) — the ladder rescues the prefix from the bad image; it does not fix the cause. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `1cc359d4` | no | B, C | applies in order; not verified. The note declares host checks 1164/1404 — declared, not reproduced | ### E. Windows chunked large pages + expert-arena-first (CUDA) **The problem.** On Windows, the expert arena is reserved after the PLE/GGUF, and large pages are not chunked; the reservation order and the chunked large pages were not the ones this box wants. **What it does.** `3e14ba41` — reserve the **expert arena before the PLE/GGUF**, and use **Windows chunked large pages**. This is the CUDA side of the series. **What was measured.** Nothing live here: only C++/`.cu`/docs, and no CUDA toolchain in this environment — **declared, not reproduced**. **What this does not claim.** **C++/`.cu` not compiled → applies, not verified**, never a tilde. **Upstream issues.** Related — **#2185** (closed PR) added the Windows `enable_large_pages.ps1` helper for `SeLockMemoryPrivilege`; **#2271** (open PR) is `--shared-expert-arena`. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `3e14ba41` | **yes** | — | applies alone on `296b59d2`; only C++/`.cu`/docs → **applies, not verified** | ### F. Continuous batch-read agenda (`STRATA_BATCH_AGENDA`, opt-in) **The problem.** On the serve thread a batched read is an uninterrupted run: from `pipe_drain()` to the end of the request nothing else drives a decode window. **What it does.** `0269a3c2` — a **continuous agenda** for batched reads, behind `STRATA_BATCH_AGENDA` (**opt-in**). **What was measured.** The note declares a host **correctness** test; **the effect on throughput is NOT measured** — **no measurable before/after**. **What this does not claim.** Not verified. **The throughput effect is not measured.** Its dependency on C and D is **by text, not by function** — the regions of `CMakeLists.txt`/`docs/FLAGS.md`, which the note itself calls "a dependency of context, not functional". **Upstream issues.** Related — **#2275** (open) and **PR #2050** (open, opt-in `STRATA_PIPED_READ_PIECE`) cover the pipelined prompt read this agenda sits beside; also #1906 and #1603. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `0269a3c2` | no | C, D (**by text, not by function**) | applies in order; not verified; the throughput effect is not measured | ### G. Parking target + spill-instead-of-discard + transient floor (the transistor `ram|disk|auto`) **The problem.** Measured over the window of real use of 2026-10-14 (19:32:30 → 20:22:03, the configuration before the parking target): | symptom | number | | --- | ---: | | rejected parks (`skip parking (physical RAM admission …)`) | **24** | | disk copies ignored (`disk hit skipped`) | **15** | | K/V re-processed | **1,458,547 tokens = 2,110,865 ms (35.2 min) of engine prefill time** | | worst single episode | **141,718 tokens in 197.3 s** | | host free RAM (1,277 samples @2 s) | min 904 · avg **4,070** · max 5,784 MiB | | engine working set | avg 10,711 MiB (max 16,046) | Two readings that matter: - **The floor alone is almost never what blocks; `snapshot + floor` is.** Host free RAM sat below the 2560 MiB floor in only **65 of 1,277** samples (5%), while the real condition is `available ≥ snapshot + 2560` and a snapshot measures **1.6–2.9 GB** (working figure ≈2.5 GB per conversation). In **every** rejection the log reads `evicted 0, 0 still parked`: the RAM cache was **empty**, so there was nothing to evict — it was system RAM, not the cache's budget. - **The rejections are policy, not lack of disk.** The disk tier was already **full** (19,855 / 20,480 MiB, 101 age evictions) and still spilling correctly; the RAM gate that precedes it is what refused. Refusing did not even save RAM. A disk restore is indistinguishable from RAM — `disk/checkpoint` **95,661 tokens in 273.7 ms** against `live` **102,362 tokens in 267.6 ms** — and the re-prefill rebuilds in the slot the same K/V the disk copy would have loaded (the final state is identical; `/metrics` reports the same `held_tokens`). The engine refused to do in **274 ms** what it then did in **197 s**, and ended at the same consumption. > These are the window's frozen artifacts, re-counted. An earlier extraction of the same window — taken while the measurement was still running — counted more rejections; the frozen counts here supersede it, and neither is averaged. **What it does.** - **`--conversation-cache-park ram|disk|auto`** (default **`ram`**) — the parking target. - **`ram`** — capture to host RAM, keep it, mirror it to disk (`spill-on=park`). What the engine did before. - **`disk`** — park to disk only: capture, hand the copy to the asynchronous spill writer, and **free the RAM copy at once**. The RAM cache keeps nothing for that park (`conversations.size()` does not grow; `put()` is not called for it). - **`auto`** — resolved **once at startup**, after the arena and the model are resident: `disk` when the free RAM cannot hold one snapshot per cache slot beside the floor, `ram` otherwise. Reported on stderr (`park target auto -> disk|ram`). - **`--conversation-cache-park-min-free-mib`** (default **`512`**) — the **transient RAM floor** a disk-bound capture may take, as opposed to the **parking floor** `--conversation-cache-min-free-mib` (default **`2560`**) that a capture which *stays* in RAM must leave. Two floors because the big one exists to stop the OS paging during a capture that *stays*; a disk-bound capture is transient — its RAM is freed right after — so refusing it only pays the re-prefill. `0` = require only `need`. - **The transistor (the core rule).** In both paths (the park and the disk hit) and both modes: **when the big floor does not hold, the capture is not discarded — it spills to disk under the transient floor.** "Refuse" and "spill" stopped being mutually exclusive. `disk` needs the disk tier (`--conversation-cache-spill-dir` with `--conversation-cache-spill-on park`); without it the parking **stays in RAM** with a warning rather than parking nothing. - **The same rule governs every disk read and save**, in one function (`conversation_disk_placement`, the park rule with the destination fixed to disk): the conversation **disk hit**, the **segment-tier hit**, the **system-prompt-cache hit**, the streamed **session restore** and the **API session save** are admitted under the transient floor when the parking floor does not hold, and refused only when neither holds — each printing `… hit under the transient RAM floor (need … plus 512 MiB, not 2560 MiB)`. A copy already on disk is never ignored for RAM it would not keep. Measured motivation for `disk`: with 4 slots the RAM cache's committed parking is up to the **8 GiB** budget (two parked conversations alone measured **4.51 GB**, at **1.6–2.9 GB per conversation**); in `disk` mode that committed RAM becomes **reclaimable file cache** instead. **What was measured.** The window above (2026-10-14 19:32:30 → 20:22:03), and the production boot with the disk target (`--conversation-cache-park disk`; engine run 2026-10-14 23:20:24 → 2026-10-15 07:02:42, closed): `skip parking` **0**; park-to-disk decisions **365**; parks completed **272**; restores from disk **277**; `discard snapshot (stage count)` **53**; K/V re-processed **3,123,699 / 26,117,121 = 12.0 %**. Host free RAM under the disk target (window 2026-10-15 00:13:23 → 00:18:40, 136 samples): mean **7,102 MiB** (min 4,475 · max 9,936). Sources: the engine log of that run, re-counted in the measurements note of 2026-10-15; the window's own capture (`raw-timestamped.log`, `events.jsonl`, `snapshots.csv`). **What this does not claim.** Not verified. **The live run cited is of the binary `strata-parkdisco.exe` (another layer), not of this integrated binary.** The window's counts are a **snapshot of a live log**; the baseline window and the after window are **different traffic**, not an A/B. Functionally this capability needs only A (the tier, with `-spill-on park`); the cherry-pick requires the whole chain because every commit touches `src/program/generate.cpp`. **Upstream issues.** **Mitigates #1347** (closed/completed — the physical-RAM park gate; this closes the residue where the copy is already on disk and the read is admitted under the transient floor); related — **#1620** (closed/not planned) proposed the provisional park this series implements, and **#2502** (open) reports a refused park. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `acc09864`, `571f1203` | no | F (and by F, C, D, A, B). **Functionally only A** — the cherry-pick needs the chain because all of it touches `generate.cpp` | applies in order; **not verified**: no run of this integrated binary | ### H. Default spill dir + default system-prompt-cache dir **The problem.** The disk tier required the operator to name the spill folder; without the flag there was no disk tier at all. **What it does.** - `2f8d3cad` — `--conversation-cache-spill-dir` **resolves a default** instead of requiring the flag (`conversation_spill_dir_resolve`). - `b0c177f1` — `--system-prompt-cache-dir` **defaults the same way**. **What was measured.** Nothing measurable before/after: the note declares host resolver tests (**29 checks**, `ctest` **20/20**) — **declared, not reproduced**. **What this does not claim.** Not verified. The resolver tests are declared by the commit's note, not observed here. **Upstream issues.** No upstream issue reports the missing default directory; related — **#1090** and **#1331** (closed/completed, the system prompt on disk) touch the same system-prompt-cache path. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `2f8d3cad`, `b0c177f1` | no | G; and `b0c177f1` additionally J | applies in order; not verified. The note declares host resolver tests 29 checks, `ctest` 20/20 — declared, not reproduced | ### I. Disk-tier & cache observability (engine `INFO` + `/metrics` + Monitor rows) **The problem.** The disk tier's folder and live state were invisible, and an absent counter was being reported as `0`. **What it does.** - The engine exposes the disk tier's folder and live state and the admission source to the Monitor (`conversation_cache_spill_dir`, `conversation_cache_disk`, the `loading … from disk` / `from cold` line, and the `live.admission` field); `serve/server.py` parses them, and the web Monitor shows the parking by destination, the per-slot speeds and the admission state. - `16b67c46` / `1f572df4` — expose the **system-prompt cache's folder and budget** in the `INFO` line, and **stop reporting an absent counter as 0**. - The warm level adds `conversation_cache_warm_dir` / `conversation_cache_warm_mib` / `conversation_cache_warm` to the `INFO` line, a `degraded N conversations to the cold level` line, and a third row per destination in the Monitor. **What was measured.** System-prompt cache (the whole engine log, read 2026-10-15 11:27): **8 hits / 106 misses**. The notes declare `py_compile`/`pytest` and fixtures in Chrome headless — but **only synthetic**: **against a simulated `/metrics`**, **without a live engine**. **What this does not claim.** Not verified against a live engine: the fixtures run against a **simulated** `/metrics`. The 8/106 is the shared root written far more often than it is read back — it is one read of one log. **Upstream issues.** Related — **#596** (closed/completed) asked for a conversation-cache view in the Monitor tab. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `20e5760b`, `b9b83c86`, `16b67c46`, `1f572df4` | no | A, G, H | applies in order; not verified. The notes declare `py_compile`/`pytest` and Chrome-headless fixtures **against a simulated `/metrics`**; **no live engine** | ### J. The cascade: a warm level, and degrade instead of delete **The problem.** The conversation cache had no level above the disk tier: a level that ran out of budget deleted its oldest entry instead of demoting it to a colder one. **What it does.** The cache now runs **VRAM → RAM → warm → cold**. The **warm** level is new and opt-in; the **cold** level is the disk tier this series already had. - **`--conversation-cache-warm-dir`** + **`--conversation-cache-warm-mib`** (empty / **`0` = the warm level is off**). This is the new pair. - **`--conversation-cache-cold-dir`** + **`--conversation-cache-cold-mib`** are the **canonical names of the existing disk tier** — the same field, the same directory, the same files. `--conversation-cache-spill-dir` and `--conversation-cache-disk-mib` keep working as **aliases of the same field**; two names pointing at one field with different values is a start-up error. The cold level is the *existing* directory so that the tier the operator already runs — hundreds of GiB of parked conversations — is inherited with **zero migration**: the engine recognises a directory by the `strata-conv-` name prefix and the sidecar identity, not by which flag opened it, and it rewrites nothing on open. - **Degrade, not delete.** When a level's GC runs (`enforce_budget`, `enforce_age`) and a next level is set, the entry is handed to the next level (**`degrade_to_next`** → **`adopt`**): the cold level writes its own sidecar, relocates the session files (`relocate_file` — a rename on one volume, a copy+delete across two) and re-seals the entry's age; the warm level then drops its own copy. **Only the last level (the cold) deletes** — FIFO by budget, and by age if the operator asked for it. A degradation is **not** an eviction: the warm level's `disk_evictions` and `age_evictions` counters do not move. - **All-or-nothing.** The entry is written to the cold level **first** and unindexed from the warm level **after**; if the cold level cannot receive it (budget, `when-full=reject`, an oversized image, an I/O failure), nothing is moved and the entry **stays in the warm level**. The whole move is reverted on any failure. - **The correctness paths still discard.** Only the two **capacity** levers (budget and age) degrade. Supersede, compaction and an unreadable image still discard, exactly as they do today. - **The RAM floors are not cascade levels.** `--conversation-cache-min-free-mib` and the transient `--conversation-cache-park-min-free-mib` stay what they are; the cascade reuses the same transistor, adding no third admission rule. - **Off by default.** No warm level configured means no cascade at all: the write level is the cold level, the read path says `from disk` and returns the same instance as before, and the tree is byte-for-byte the one that ships without this change. The gate for a level is the same one the existing tier uses (a non-empty directory *and* a non-zero budget). **What was measured.** The cascade's warm level against the cold one — measured on the live engine (2026-10-15) as a **2×2 by level and freshness** (22 synthetic conversations of ~5,700 prompt tokens, six randomized rounds with the order shuffled; an *old* round first reads 10 GiB of unrelated files to push the images out of the OS page cache). The engine's own figure for restoring a parked image — `restored N tokens (<level>/…) in X ms` — is: | level | freshness | n | restore ms (median / min / max) | | --- | --- | ---: | --- | | warm (`disk/…`) | fresh | **36** | **92.2 / 38.5 / 1240.1** | | warm | old | **33** | **101.7 / 51.3 / 2834.3** | | cold (`cold/…`) | fresh | **30** | **106.0 / 62.3 / 163.7** | | cold | old | **41** | **104.1 / 41.0 / 141.4** | **The level does not weigh, and neither does freshness command the median: a floor of ~100 ms does**, and freshness appears only as a **tail of the warm volume** — **9 of 69** warm restores took **300–2834 ms**, against **0 of 125** cold ones. **Pooled** (warm **n=69**, median **100.5 ms** · cold **n=125**, median **97.3 ms**) the ratio is **0.97 with interval [0.906–1.076]**, which **includes 1** → **no ratio is asserted**. **Why the two earlier runs differed:** they ran on **different builds** — one without the eviction fix, one with it. **They did not contradict each other: they measured different things.** And the datum that **refutes the OS page-cache hypothesis**: the images **truly old** (14, intact for hours) were the **fastest** measured (**74.8 ms**), so age alone does not make a restore slow. The warm level's `degraded` counter went **0 → 45** in the first synthetic run and **0 → 21** in the re-test, holding at ~**10,112 MiB** of its 10,240 MiB budget while the cold absorbed the overflow: it **degrades, it does not drop**. Source: `09-implementacion/2026-10-15-ab-por-nivel-y-frescura-v1.0.0.md`; the earlier pair from `09-implementacion/2026-10-15-test-sintetico-cascada-v1.0.0.md` and `09-implementacion/2026-10-15-re-test-cascada-con-arreglo-v1.0.0.md`. **No gain in this machine, with the cause.** Measured on this machine (X870P) and this configuration: the two levels give the same median because the bottleneck is the **disk path**, not the level — in the small-read regime it delivers ~**0.5-1 GB/s** against the **7 GB/s** the drive can do. A **large** restore (171.5k tokens) did reach **657 ms** ≈ **2.8 GB/s**, so the ~1 GB/s ceiling belongs to the **small-read** regime, not to the drive. **What this does not claim.** Not verified. The 2×2 is **not a controlled media comparison** — `warm` lives on `C:` and `cold` on `D:`, two physical SSDs, and the cold images were, on average, **written earlier** than the warm ones, so the OS page-cache state is **not equalised**; **no ratio is asserted** (the pooled CI contains 1, and the "old" manipulation is a page-cache flush, not age); the request latency **includes prefill and admission** and whatever else the engine was doing (`:5011` is production, the window was not isolated); `restored … in X ms` is the engine's figure for the load it closes, **not isolated disk I/O**; and one synthetic workload with a single client is **not a load profile**. The warm level is new code: its **406 host checks and its mutation check pass, but nothing of it has been served**. **The cascade is not safe to take without K**: without the cold-level eviction fix, the warm level degrades into a cold that deletes by a hidden cap of 256, and taking J without K **erases parked material**. **Upstream issues.** **Closes #2597** (ours, open) — the cache degrades across levels instead of deleting, each level switched off by its own budget. Related — **#1920** (open: two alternating long conversations evict each other), **#2264** (open: it re-parks every turn) and **#2448** (open: an incremental write and a fill policy). **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `ac5a1746`, `33d41214`, `686d0b57`, `bb31e4e4` | no | A (for `33d41214`); I (`ac5a1746` → `16b67c46`). **Do not take without the cold-eviction fix (K)** | applies in order; not verified. The live A/B is synthetic and **no ratio is asserted** (the pooled CI contains 1); 406 host checks + mutation pass, but nothing served. **Without K, the warm level degrades into a cold that deletes by a hidden cap of 256** | ### K. Cold-level eviction fix: budget, not a hidden count of 256 **The problem.** The same synthetic run exposed a real defect, and it is stated as what it is — **a defect of ours, caught by our own test**. The cold level had a **hidden ceiling of 256 entries** (`kMaxSidecarEntries`), named in **no log line and in no `/metrics` field**, and `adopt()` runs the cold level's GC **unconditionally** — so **every warm→cold degradation deleted exactly one cold copy**, with `460800` MiB configured and only `265848` MiB in use. Over the test window that was **45 degradations and 45 removals**: ≈**48.5 GiB** of already-parked state **deleted, not archived** (≈44 conversations at ≈1,128 MiB each; the net byte drop read smaller, −30.1 GiB, only because the same 45 degradations had just written ≈18.5 GiB in). The cap was also **pre-existing to the cascade** (`07613f4b`, the original durable tier): any spill into a cold pinned at 256 deletes the same way. **What it does.** `ba89b7fc` — the count term is **gone from the removal**: the cold now evicts **by its MiB budget**, the lever the operator sets. The entry cap keeps only its other role, a `reject` level refusing new work **instead of evicting for it**. The cap also stopped being invisible: the startup lines declare `max-conversations`, `/metrics` exposes it **per destination**, and each removal and each degradation writes a line **naming the victim and the lever** (`budget` or `age`). A regression test (T11) fills the cold to its entry cap **with MiB to spare** and degrades one copy in: **nothing may be removed**. **What was measured.** Before the fix: **45 degradations → 45 cold evictions** (exact 1:1), **≈48.5 GiB** of previously-parked material deleted. After the fix (re-test, 2026-10-15): **21 degradations → 0 cold evictions**, the cold grew **+21 conversations** and **+8,544 GiB** (the Δ bytes; **GiB, not MiB**) and **lost 0** — the counts rest on a host test and its mutation, **declared, not reproduced**. Sources: `09-implementacion/2026-10-15-diagnostico-eviccion-del-frio-v1.0.0.md` and `09-implementacion/2026-10-15-fix-eviccion-del-frio-y-visibilidad-v1.0.0.md`. **What this does not claim.** The fix rests on a **host test and its mutation**, not a served run — it has **no live measurement** of its own; and **the mutation was not executed** (declared by the note). With **no cascade configured the cold level behaves as before** (same flag, folder, inheritance and read path; it is still **the only level that removes**, by budget and age). Owner's note: the test left **~26 GiB** of synthetic material in the tier, and through this eviction the cold level **lost ≈48.5 GiB** of previously-parked material — the production tier **changed content** while it was being measured. **Upstream issues.** No upstream issue covers the fix — it is a defect of ours, caught by our own test; related — **#2448** (open) reads the eviction order as least-recently-used, where the code is FIFO. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `ba89b7fc` | no | J, H (`b0c177f1`), L (`256d76b3`) | applies in order; not verified. The note declares host test T11 + a mutation; **the mutation was not executed** (declared by the note) | ### L. Monitor: per-slot clocks, tachometer, solo speed, RAM row **The problem.** The Monitor did not list every batch slot or clock its context, its aggregate clock did not sum its slots, and the RAM row did not count what the slots hold. **What it does.** - `de0f1f3a` — the Monitor draws the cascade's warm and cold levels. - `8f6bfa10` — lists **every batch slot** and clocks its context; `5320268c` — the aggregate clock **sums its slots**, and the slot texts move right; `1895e7ed` — the Context fill clocks flank the big one, a **tachometer**. - `256d76b3` — the slot speeds name the **solo** request, and the **RAM row counts what the slots hold**. **What was measured.** **No measurable before/after**: the notes declare `test_monitor.py` (up to **38→47**) + `node --check` + **textual** asserts; **no browser render**; the estimated row (`kv_estimated`) is **not validated against a live engine**. **What this does not claim.** Not verified; **no render in a browser**; the `kv_estimated` row is **not validated against the live engine**; the asserts are textual. **Upstream issues.** Related — **#596** (closed/completed) asked for the conversation-cache view in the Monitor tab. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `de0f1f3a`, `8f6bfa10`, `5320268c`, `1895e7ed`, `256d76b3` | no | I, J | applies in order; not verified. The notes declare `test_monitor.py` (38→47) + `node --check` + textual asserts; **no browser render**; `kv_estimated` not validated live | ### M. Installer: several requests at once, and the conversations kept on disk **The problem.** The installer asked nothing about running several requests at once or keeping the conversations on disk, and it chose the slot count after the context size was already fixed. **What it does.** `528be20f` adds **two questions** to the flow it already has — one request or several, and whether the conversations are kept on disk — placed **after** the model and the machine bench and **before** the context size, so the slot count is chosen with the model and the context already known. - The conversations-on-disk assistant (`layer_args`) writes `--conversation-cache-mib 8192`, `--conversation-cache-warm-dir <install>\slots\warm --conversation-cache-warm-mib 8192` and the cold via `--conversation-cache-disk-mib` (the alias of the canonical `-cold-*`, so an engine older than the rename is not broken by a name). No new flag: `--parallel N` already existed, and a `--parallel` on the command line **is** the answer to the first question. - `6a93aadf` — the conversation cache's RAM is **off at 0, not unlimited**, and it is **not** the KV cache (a text fix in `setup.py`; its message correction is "0 = off", not "0 = no limit"). - **The always-path does not change, and that is measured rather than asserted:** `setup.py` before and after this change, across 5 machines × 5 sizes × (`--yes` or Enter), gives **50 cases and 50 identical results**, with `--yes` asking nothing at all. No answer means the previous behaviour. **What was measured.** The **50 cases / 50 identical results** above, plus the golden `50/50`; `py_compile` OK; `tools/test_setup_*.py` → 40 files, 580 tests, 0 failures. `6a93aadf` declares `py_compile` OK + golden. Sources: `09-implementacion/2026-10-15-instalador-pasos-multislot-y-disco-v1.0.0.md`. **What this does not claim.** Not verified as a real install (no model downloaded, no engine started — the start is stubbed and fails if called). `6a93aadf` **is not published** yet. The golden is declared, not reproduced here. Functionally the disk question needs J (it writes `--conversation-cache-warm-*`, which an engine older than the rename rejects). **Upstream issues.** No upstream issue covers the installer flow (the parallel-requests path it surfaces is the engine's own `--parallel N`). **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `528be20f`, `6a93aadf` | no | N (`d40cb783`) for `528be20f`; **functionally J** (it writes `--conversation-cache-warm-*`) | applies in order; not verified. The note declares `py_compile` + golden **50/50 identical**; `6a93aadf` declares `py_compile` + golden — declared, not reproduced. `6a93aadf` is **not published** | ### N. Documentation **The problem.** The new flags and behavior needed documenting: a parked image's identity bound to the engine version, and the lever named. **What it does.** - `940eb9bf` — documents the **disk tier, the restore ladder, the anchored frontier and the chunked large pages**. - `d40cb783` — documents the **parking destination and the resolved spill directory**. - `957d27b0` — binds a **parked image's identity to the engine version**, and **names the lever**. - The travelling docs (in the diff): `docs/FLAGS.md`, `docs/SPILL_AND_PROMPT_CACHE.md`, `docs/DETAILS.md`. **What was measured.** Nothing — **no measurable before/after**: this is **prose — not verified** (there is nothing to measure). **What this does not claim.** Prose, not verified. It documents the other capabilities; it does not by itself change behavior. **Upstream issues.** No upstream issue — this is the documentation of the series. **The commits it needs.** | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | | `940eb9bf`, `d40cb783`, `957d27b0` | no | C, E, F (`940eb9bf`); A, I (`d40cb783`); `d40cb783` for `957d27b0` | applies in order; **prose, not verified** (nothing to measure) | ## Extra Notes ### Measurements Every figure below is real and carries its origin; **each capability has its own table** instead of one global one. A capability with no live figure says so. **A — durable on-disk conversation tier** | what | measured | origin | | --- | ---: | --- | | restore from disk against a cold prefill | **171,516 tokens in 657 ms** read back from disk — the whole reload **6.6 s** — against **158,649 ms (158.6 s)** to prefill cold — **≈24×** (against the 6.6 s reload, not the 657 ms read) | the tier note of 2026-10-14 and the published body's demo table; the 657 ms line is in the engine log | | the disk tier on disk (2026-10-15) | **268.0 GiB of images** + **53.9 GiB of segments** across **256 conversations**, against a 450 GiB budget | a directory listing of the spill folder | | system-prompt cache (whole engine log, 2026-10-15 11:27) | **8 hits / 106 misses** | the engine log, patterns `system prompt cache: hit \d+ tokens` / `prefix changed (miss` | **B — two-pass streaming session restore** | what | measured | origin | | --- | ---: | --- | | the streaming restore itself | **no separate figure** — it is the path that reads back A's 171,516 tokens in 657 ms | the tier note of 2026-10-14 | **C — per-stage content-addressed segments** | what | measured | origin | | --- | ---: | --- | | host checks (declared) | **174 → 188** | the commit's note — **declared, not reproduced** | | shared-`Sys` dedup | **not conclusively measured** (one pass, concurrent traffic) | the coverage note of 2026-10-15 | **D — prefix restore ladder** | what | measured | origin | | --- | ---: | --- | | host checks (declared) | **1164 / 1404** in its tests | the commit's note — **declared, not reproduced** | | in-serve effect | the `image rejected` branch did **not fire in the live matrix** → host-tested, not measured | the live matrix | **E — Windows chunked large pages + expert-arena-first** | what | measured | origin | | --- | ---: | --- | | anything live | **nothing** — no CUDA toolchain here; **applies, not verified** | the cherry-pick measurement | **F — continuous batch-read agenda** | what | measured | origin | | --- | ---: | --- | | correctness (declared) | a host test, declared | the commit's note | | throughput effect | **not measured** | the commit's note | **G — parking target + spill-instead-of-discard + transient floor** | what | measured | origin | | --- | ---: | --- | | production boot with the disk target (`--conversation-cache-park disk`; 2026-10-14 23:20:24 → 2026-10-15 07:02:42, closed) | `skip parking` **0**; park-to-disk **365**; parks completed **272**; restores from disk **277**; `discard snapshot (stage count)` **53**; K/V re-processed **3,123,699 / 26,117,121 = 12.0 %** | the engine log of that run, re-counted in the measurements note of 2026-10-15 | | the same gate before the change (window of 2026-10-14 19:32:30 → 20:22:03) | `skip parking` **24**; `disk hit skipped` **15**; K/V re-processed **1,458,547 tokens = 2,110,865 ms (35.2 min)** | the window's own capture (`raw-timestamped.log`, `events.jsonl`), re-counted in the measurements note | | host free RAM under the disk target (window 2026-10-15 00:13:23 → 00:18:40, 136 samples) | mean **7,102 MiB** (min 4,475 · max 9,936) | the live measurement's `snapshots.csv` | **I — disk-tier & cache observability** | what | measured | origin | | --- | ---: | --- | | system-prompt cache | **8 hits / 106 misses** | the engine log (read 2026-10-15 11:27) | | engine `INFO` / `/metrics` / Monitor rows | fixtures in Chrome headless, **against a simulated `/metrics`** — **no live engine** | the notes' fixtures | **J — the cascade** | level | freshness | n | restore ms (median / min / max) | | --- | --- | ---: | --- | | warm (`disk/…`) | fresh | **36** | **92.2 / 38.5 / 1240.1** | | warm | old | **33** | **101.7 / 51.3 / 2834.3** | | cold (`cold/…`) | fresh | **30** | **106.0 / 62.3 / 163.7** | | cold | old | **41** | **104.1 / 41.0 / 141.4** | **The level does not weigh, and neither does freshness command the median: a floor of ~100 ms does** (freshness only as a **tail of the warm volume**: 9 of 69 warm restores at 300–2834 ms, against 0 of 125 cold). **Pooled** (warm **n=69**, median **100.5 ms** · cold **n=125**, median **97.3 ms**) the ratio is **0.97 with interval [0.906–1.076]** — **it contains 1, so no ratio is asserted**. The two earlier runs differed because they ran on **different builds** (one without the eviction fix, one with it): **not contradictory, they measured different things**. The datum that refutes the OS page-cache hypothesis: the images **truly old** (14, intact for hours) were the **fastest** (**74.8 ms**). The warm level's `degraded` counter went **0 → 45** in the first synthetic run and **0 → 21** in the re-test, holding at ~**10,112 MiB** of its 10,240 MiB budget. Source: `09-implementacion/2026-10-15-ab-por-nivel-y-frescura-v1.0.0.md`. **K — cold-level eviction fix** | | degradations (warm→cold) | cold evictions | 1:1? | cold GiB lost | cold conversations | | --- | ---: | ---: | --- | ---: | --- | | **before** (motor without the fix) | **45** | **45** | **yes, exact** | **≈48.5 GiB** | 256 → 256 | | **after** (`ba89b7fc`) | **21** | **0** | **no** | **0** | 256 → 277 | The regression test T11 fills the cold to its entry cap **with MiB to spare** and degrades one copy in: **nothing may be removed**. Sources: `09-implementacion/2026-10-15-diagnostico-eviccion-del-frio-v1.0.0.md`, `09-implementacion/2026-10-15-fix-eviccion-del-frio-y-visibilidad-v1.0.0.md`. **L — Monitor** | what | measured | origin | | --- | ---: | --- | | `test_monitor.py` | up to **38 → 47** + `node --check` + **textual** asserts | the notes | | browser render | **none** | the notes | | `kv_estimated` row | **not validated against the live engine** | the notes | **M — installer** | what | measured | origin | | --- | ---: | --- | | `setup.py` before vs after, 5 machines × 5 sizes × (`--yes` or Enter) | **50 cases and 50 identical results**; with `--yes` asking nothing at all | `09-implementacion/2026-10-15-instalador-pasos-multislot-y-disco-v1.0.0.md` | | golden | `50/50`; `tools/test_setup_*.py` → 40 files, 580 tests, 0 failures | idem | **N — documentation** | what | measured | origin | | --- | ---: | --- | | anything | **nothing** — it is prose, so **not verified** | — | **Where each number comes from.** Working notes of the author, on disk (paths relative to this repository's working tree): - **The measurements and their procedure, one row per figure:** `09-implementacion/2026-10-15-mediciones-y-procedencia-v1.0.0.md` — every figure above with its exact pattern or command, the file it lives in, its window, and whether it reproduces. - **Mechanism, the 2026-10-14 window and the code points of the gate:** the eviction investigation of 2026-10-14 and the parking spec of 2026-10-14. - **The two floors, the transistor and the flag table:** the parking-logic note of 2026-10-14. - **The cascade (levels, degrade instead of delete, all-or-nothing, the tests and the mutation check):** the cascade implementation note of 2026-10-15. - **Concurrency (declared) and the not-concurrent read:** the concurrency declarations note of 2026-10-15 and the phase-prediction note of 2026-10-15. - **The coverage read against the rival PRs:** the coverage matrix of 2026-10-15. - **The upstream issues crossed, with their state:** the scope-and-issues note of 2026-10-15. - **The travelling docs (in the diff):** `docs/SPILL_AND_PROMPT_CACHE.md` and `docs/FLAGS.md`. - **The two runs counted, the disk listing and the window's capture:** the engine log of the server — the production run that opens `2026-10-14 23:20:24` (`--conversation-cache-park disk`) and the 2026-10-14 window (`_medicion/2026-10-14-eviction/raw-timestamped.log`, `events.jsonl`, `snapshots*.csv`) — read directly, and a directory listing of `D:\AI\servers\strata\slots\xl`. - **The restore pair (657 ms / 6.6 s / 158.6 s):** the tier note of 2026-10-14 (`2026-10-14-entrega-por-commit/01-tier-de-disco-y-system-prompt-cache.md`) and the published body's demo table. ### Relationship to the issues and PRs this series sits beside The verb is the strong verb the code supports, and no stronger. | issue | verb | why | | --- | --- | --- | | **#2597** (ours, open) — *degrade the conversation cache across levels instead of deleting the oldest (RAM → fast M.2 → cold disk, each level switchable)* | **closes** | This series implements exactly what it asks: the cache degrades across levels instead of deleting, only the last level discards, and each level is switched off by its own budget. | | **#2595** (ours, open) — `discard snapshot (stage count: saved=0 current=1)`, 40 in one boot, one of 165,543 tokens | **mitigates** | The prefix restore ladder rescues the prefix from the bad image, so the turn does not lose it. It does **not** fix the cause: why the tier produced a 1-token image with a different stage count is **not investigated**, and our own notes say so. | | **#2596** (ours, open) — `layer-split auto` is not stable between starts and a different K invalidates the whole on-disk tier | **reports and documents** | This is a finding of ours, written up with its measurement, not a fix. Pinning `--layer-split` is the mitigation. It is **not** implemented here: a search of the series for any change to the split returns **0 commits**. | | **#2508** (ours, open) — KV compaction and hot-swappable KV sessions | **related, not implemented** | Same territory (the stationary KV components, the segment dedup) as an aspirational direction. Nothing in the compaction path is touched here. We do have data to offer it: the system-prompt cache in the boot above measured **7 hits against 106 misses**, i.e. the shared root is written far more often than it is read back. | Carried over from the published body, unchanged: - **#1347 (closed, completed)** — the park gate. Its fix covers the case **with parked conversations left to evict**; this series closes the **residue of the same hole**, where the RAM cache is empty and there was nothing to evict. The **transient floor for the disk hit** is a separate corner: a copy that already exists on disk, not RAM the engine would keep. - **#2275 (open) and PR #2050 (open)** — the inert `BYIELD` on the pipelined route is **theirs**: `batch_read_piece()` returns 0 for the pipelined groups, so the decode-share block and the `BYIELD` point below it are unreachable by construction, and #2050 fixes it opt-in (`STRATA_PIPED_READ_PIECE`, measured pause 12.2 s → 4.2 s). This series **cites both and does not re-implement them**; see also #1906 and #1603. - **#1620 (closed, not planned)** — *a cancelled request loses the conversation cache entry it restored*. Our **provisional park** implements the fix #1620 proposed. The server's `parks` counter does not count that path, so it under-counts the real parking decisions; the metric is left as is. - **#1572 (closed, completed)** — *Optionally reclaim disposable host caches when session SAVE needs RAM*. Terrain closed upstream; our residual is only the reclaim **target**: `session_save_reclaim(...)` still aims at the large floor while the save's *gate* now admits the transient one. - **#2507** (ours, open) — per-slot expert budget and PCIe-idle prefetch: expert budget, not conversation state on disk. **Relationship to the other on-disk tiers in flight, measured.** Five open PRs implement a durable conversation tier on disk: **#1271** (ANBAL534), **#1480** (routhjim), **#1529** (konijiwa110), **#1810** (CC-David-CC) and **#1937** (xrip). #1271, #1480, #1529 and #1810 introduce the same three new paths this series does (`include/strata/core/conversation_spill.hpp`, `src/core/conversation_spill.cpp`, `src/core/conversation_spill_test.cpp`), so one of us will merge and the rest will be add/add conflicts; #1937 takes the other route and modifies the cache in place with its own `conversation_disk.*`. What follows is what this package covers, what each of the others covers that it does not, and what none of us covers. Every claim below is pointed at a flag or a file, and the facts about the other PRs were read from their patches and threads through the GitHub API, read-only. **What this package covers, with the pointer** | capability | here | | --- | --- | | durable image on disk | `--conversation-cache-spill-dir`, `--conversation-cache-spill-on park`; `conversation_spill.{hpp,cpp}` | | restore on re-entry | `best()` / `load()`; the sidecar carries tokens and images, not K/V | | capture on a park the physical-RAM gate refuses (spill instead of discard) | `conversation_park_placement()` in `conversation_memory.hpp` | | a background write of the tier | the spill tier owns its writer thread (only the write is asynchronous) | | persistence across restarts | the spill folder survives; the `SCSM` sidecar is rescanned on open | | identity and validity | `SessionFileIdentity` (model fingerprint + config fingerprint, `engine = STRATA_VERSION`) | | sidecar metadata, match without reading K/V | `SCSM` — `MetaWriter`/`MetaReader` | | file format and its version | `kMetaVersion = 2`; **v1 is still read** — the v1 sidecar of #1271/#1480/#1529/#1810 is accepted | | a warm level above the disk tier, and a cascade that degrades instead of deleting | `--conversation-cache-warm-dir`/`-warm-mib`; the cold is `--conversation-cache-cold-dir`/`-cold-mib` (aliases of the historical `-spill-dir`/`-disk-mib`); `set_next` / `degrade_to_next` / `adopt`; only the cold deletes — no PR in the group has this | | tier budget and GC | `--conversation-cache-disk-mib` (8192), `--conversation-cache-spill-when-full evict-oldest\|reject` | | age pruning | `--conversation-cache-spill-max-age-days` | | shared root for new conversations | `--system-prompt-cache` (its own dir/budget/slots/max-age/key) and the shared-`Sys` dedup of the segment tier | | content-addressed per-stage segments | `--conversation-cache-segments`, `--conversation-cache-segment-budget-mib`; `conversation_segments.{hpp,cpp}` — no PR in the group has this | | prefix restore ladder | `STRATA_RESTORE_LADDER`; `conversation_restore_ladder.hpp` — no PR in the group has this | | parking target | `--conversation-cache-park ram\|disk\|auto` — no PR in the group has this | | a transient floor for everything bound to disk | `--conversation-cache-park-min-free-mib` (512) against the parking floor's 2560, applied to the disk hit, the segment hit, the system-prompt-cache hit, the streamed restore and the API session save — no PR in the group has this | | free-space preflight on writes | `--session-min-free-mib` (4096) | | counting and visibility | `serve/server.py` `conversation_cache.destinations`, `spill_on`, `live.admission`; the Monitor tab | | layer split | one session file per stage, one joint sidecar — measured live on a 2-GPU split | **Where another PR covers something this one does not** - **#1480, #1529, #1810 and #1937 save straight from the live session's pools** (`SessionKvSource`), so a park never materialises a host image; **#1529** and **#1810** additionally write it on a background thread (`spill_async`). This series captures to host RAM and only the *write* is asynchronous. One of #1937's testers priced the difference at **27x** between the capture and the streamed write. If the smaller memory bill at park time is what the maintainer wants, that work is in those PRs. - **#1937 reads a disk image straight into the GPU pools** (`SessionKvTarget`, `conversation_snapshot_restore_streamed`), with **no host copy of the K/V**, measured at **3,048 MiB into the GPUs in 4.1 s**. This series' two-pass restore streams in 16 MiB blocks but through host RAM; there is no `SessionKvTarget` in this tree. - **#1937 carries the widest evidence in the group**, and it is external: four independent testers, one on a Windows single-GPU box, one on a 2-GPU layer split, one validating the written volume with `smartctl` (131.8 GB in 70 min, ~2.7 TB/day on a 256 GB NVMe), and one `CONTRIBUTOR` who found a correctness bug (index vs payload binding) and saw it fixed. **The newest commits of this series have had no live run.** - **#1271 matches on similarity** (`--conversation-cache-similarity F`, `--conversation-cache-n-min N`); this series' match is an exact prefix from the start, as the RAM cache's is. - **#1529 has `--conversation-cache-disk-min-tokens`** (do not write a conversation shorter than N) and keeps **two** checkpoints — the deepest and the root — which halves the file (603-699 MiB against 1149-1618 MiB) and is exactly what a new chat resumes from. - **#1480 has persistent prefix entries** (`strata-conv-prefix-N`): never dropped as superseded, evicted last, deduped across restarts. This series reaches a similar goal with the system-prompt cache and the segment tier, by a different mechanism. - **#1810 versions its cache policy inside the saved-state fingerprint** and refuses an unversioned reproducible snapshot instead of restoring it; its correctness evidence (exact token-ID parity across RAM, disk-only and fallback, greedy and seeded) is the most rigorous in the group. - One factual note: `conversation_spill.hpp` and `conversation_spill.cpp` are **byte-identical between #1529 and #1810** at the heads measured (same content hash). **Where this package covers something the others do not** - **The transient floor.** #1480, #1529 and #1937 gate the disk **read** on the same large parking floor that the park uses. A third-party tester on Windows measured what that costs in #1937 — "the path written for 'the RAM refused' refuses its own read too": 3 of 10 synthetic read-backs and 2 of 4 in a real session refused, with `not enough RAM even for the running state: 2895 MiB available`, and asked for a separate, lower floor for the read. `--conversation-cache-park-min-free-mib` (512 against 2560) is that floor, and it is applied to every path whose copy is already on disk. - **A cascade that degrades instead of deleting, with each level switchable.** Every implementation in the group removes the oldest entry at its budget; none offers a colder level to demote to. This series does, and it is opt-in by the mere presence of a warm directory. - **Content-addressed per-stage segments, a prefix restore ladder and a system-prompt cache, in one series.** No PR in the group has any of the three. - **A Monitor split by destination and by admission state** (RAM plus one row per configured disk tier, the `spill_on` mode, and whether an admission in progress is loading or reading). #1480, #1529 and #1810 add a card; #1937 logs lines and a totals line. **What none of us covers** - **A delta write.** Every park rewrites the whole image: one of #1937's testers measured 131.8 GB in 70 minutes and called it the gating item for keeping the tier; **#2264** and **#2448** are the upstream reports. This series does not change it either — and note that the cascade **retains more** copies (it stops deleting in the warm level), so without the incremental write it can **increase** the volume written at the warm level's frontier. - The root cause of `discard snapshot (stage count)`, the run-to-run instability of `--layer-split auto`, and the pipelined prompt read that cannot give way (**#2275**, fixed opt-in by **PR #2050**): all declared below, none fixed here. **Why one PR and not several.** The contribution was verified **as one tree**: it was built, deployed and measured integrated, and its capabilities were **not** validated in isolation — 27 of the 31 commits need the ones before them, and some capabilities are **unsafe** without their companions (the cascade, taken without the cold-eviction fix, deletes parked state instead of degrading). Splitting this series would publish configurations whose behaviour was never measured. For a reviewer who wants a subset, *The commits each capability needs* gives the **minimal ordered set** for each capability and marks the **independent** ones — the disk tier, for instance, can be taken without the cascade. ### The commits each capability needs The series is a chain: on a clean `296b59d2`, only `07613f4b`, `c514173e`, `3e14ba41` and `7b965cb3` apply alone; the other 27 need the earlier commit(s) that touch the same files. To take a capability, take its commits **plus** everything it lists under *needs*, in the order of this table. **14 capabilities (A–N); 31 commits = 30 published (`296b59d2`→`ba89b7fc`) + `6a93aadf` (child, not published yet); 3 independent** — A, B and E. > **"Take it alone? yes" means exactly one thing: the cherry-pick lands without conflict on `296b59d2`.** It is a verdict of **application**, not of semantics — a capability marked *no* can still be functionally autonomous, and a *yes* is not a promise that the feature works on its own. C++ that was never compiled reads **applies, not verified**, never a tilde. | capability | commits (in order) | take it alone? | needs first | verified? | | --- | --- | --- | --- | --- | | durable on-disk conversation tier (spill, archive, system-prompt cache) | `07613f4b` | **yes** | — | applies alone; Python parses OK; **C++ not compiled** | | two-pass streaming session restore | `c514173e` | **yes** | — | applies alone; **C++ not compiled** | | per-stage content-addressed segments (+ anchored frontier) | `26d29b52`, `7cd80013` | no | tier + streaming restore | not verified | | prefix restore ladder | `1cc359d4` | no | streaming restore, segments | not verified | | Windows chunked large pages + expert-arena-first | `3e14ba41` | **yes** | — | applies alone; **C++/CUDA not compiled** | | continuous batch-read agenda | `0269a3c2` | no | segments, ladder (context only) | not verified; the throughput effect is not measured | | parking target + spill-instead-of-discard + transient floor | `acc09864`, `571f1203` | no | batch agenda (file-level; needs the disk tier, not the cascade) | not verified; no run of this integrated binary | | default spill / system-prompt-cache directories | `2f8d3cad`, `b0c177f1` | no | parking; and the cascade, for `b0c177f1` | not verified | | disk-tier & cache observability (`INFO`, `/metrics`, Monitor rows) | `20e5760b`, `b9b83c86`, `16b67c46`, `1f572df4` | no | tier, parking, defaults | not verified; fixtures against a simulated `/metrics` | | the cascade (warm level; degrade instead of delete) | `ac5a1746`, `33d41214`, `686d0b57`, `bb31e4e4` | no | tier; observability (`16b67c46`). **Do not take without the cold-eviction fix below** | not verified; the live A/B is synthetic and **no ratio is asserted** (the pooled CI contains 1) | | cold-level eviction fix (budget, not a hidden count of 256) | `ba89b7fc` | no | cascade, defaults, Monitor runner | not verified | | Monitor: per-slot clocks, tachometer, solo speed, RAM row | `de0f1f3a`, `8f6bfa10`, `5320268c`, `1895e7ed`, `256d76b3` | no | observability, cascade | not verified; no browser render | | installer: several requests + conversations on disk | `528be20f`, `6a93aadf` | no | docs; and the cascade (it writes `--conversation-cache-warm-*`) | not verified; `6a93aadf` is not published yet | | documentation | `940eb9bf`, `d40cb783`, `957d27b0` | no | segments/large pages/agenda; tier | prose, not verified | | tests only (no capability) | `7b965cb3` | yes | — | applies alone; Python parses OK | | **everything** | all 30 up to `ba89b7fc` (+ `6a93aadf` next push) | — | the whole series | applies clean in order; 4 apply alone; C++ not compiled | **The one grab worth calling out:** the durable on-disk tier (`07613f4b`) — and the whole first chain (tier → streaming restore → segments → ladder → large pages → batch agenda + docs) — is self-contained: it needs nothing from the parking work, the cascade or the installer. **And the cascade (J) is not a safe take without the cold-eviction fix (K):** without `ba89b7fc` the warm level degrades into a cold that deletes by a hidden cap of 256. The series in order, oldest first: thirty commits on `296b59d2`, messages verbatim (no hashes by hand - `git log` at the tip, published `2026-10-15`). 1. `07613f4b` - serve: durable disk tier for the conversation cache (spill, archive, system-prompt cache) 2. `c514173e` - serve: two-pass streaming session restore (read pass validates, apply pass copies 16 MiB at a time) 3. `26d29b52` - serve: per-segment disk tier for the conversation cache (content-addressed segments) 4. `7cd80013` - serve: anchor the segment frontier at the <|im_start|> opener, not the role token 5. `1cc359d4` - serve: prefix restore ladder when a parked image fails validation (STRATA_RESTORE_LADDER) 6. `3e14ba41` - cuda: reserve the expert arena before the PLE/GGUF, and Windows chunked large pages 7. `0269a3c2` - serve: continuous agenda for batched reads (STRATA_BATCH_AGENDA, opt-in) 8. `940eb9bf` - docs: document the disk tier, restore ladder, anchored frontier and chunked large pages 9. `acc09864` - serve: --conversation-cache-park (ram|disk|auto), and a rejected park spills to disk instead of discarding 10. `571f1203` - serve: the transient disk floor decides the sibling disk hits and the API session save/restore too 11. `2f8d3cad` - serve: default the conversation spill directory (--conversation-cache-spill-dir) 12. `20e5760b` - serve: expose the disk tier's folder and live state, and the admission source, to the Monitor 13. `b9b83c86` - serve: the Monitor shows the parking by destination, the per-slot speeds and the admission state 14. `d40cb783` - docs: document the parking destination and the resolved spill directory 15. `7b965cb3` - test: cover the admission source, the INFO line and the disk lifecycle in the Monitor 16. `16b67c46` - serve: expose the system-prompt cache's folder and budget in the INFO line 17. `1f572df4` - serve: expose the system-prompt cache's folder and budget, and stop reporting an absent counter as 0 18. `957d27b0` - docs: bind a parked image's identity to the engine version, and name the lever 19. `ac5a1746` - serve: name the disk tier's cold level (--conversation-cache-cold-dir) 20. `33d41214` - cache: the disk tier degrades to a next level instead of removing (delta 6) 21. `686d0b57` - serve: the conversation cache gains the warm level of the cascade 22. `de0f1f3a` - serve: the Monitor draws the cascade's warm and cold levels 23. `bb31e4e4` - serve: the run config and the docs carry the cascade 24. `b0c177f1` - serve: default --system-prompt-cache-dir like the spill directory 25. `8f6bfa10` - serve: the Monitor lists every batch slot and clocks its context 26. `5320268c` - serve: the Monitor's aggregate clock sums its slots, and the slot texts move right 27. `1895e7ed` - serve: the Context fill clocks flank the big one, a tachometer 28. `528be20f` - setup: several requests at once, and the conversations kept on disk 29. `256d76b3` - serve: the Monitor's slot speeds name the solo request, and the RAM row counts what the slots hold 30. `ba89b7fc` - conversation cache: the cold level evicts by its MiB budget, not by a hidden cap of 256 entries ### Known limitations and what is not in this PR This section keeps the items of the earlier body's `## Declared limitations` and `## What we do not claim` and extends them. Where upstream already tracks a problem the issue is cited so the reviewer can route it; where it does not, the limitation is simply stated and is not a claim. **Declared limitations.** 1. `--layer-split auto` is non-deterministic between starts: the 100k reload's first attempt failed (`unreadable chain … saved with another layer range`) and re-prefilled; the retry with a stable split restored 99,715/99,722. Pinning the split is the mitigation. (Reacted in **#2596**; issues #509, #1238 and #2463 discuss *which* K `auto` picks, none covers run-to-run stability or the invalidated tier.) 2. The park writes on the next turn or on clean shutdown, not at the end of the request — a force-kill loses the copy. 3. The effort frontier is not page-aligned: a cut on a position that is not a multiple of `page_size` can be rejected for a live restore. 4. The segment plan cuts three pieces (`Sys`, `Other`, `Answer`); `Think`/`Read`/`Write`/`ToolCall`/`ToolResult` exist in the enum but are not materialized (the cutter is missing). **Known limitations of the newer work.** - **The read is not concurrent — it is a complete stop of the decode.** `pipe_drain()` sits at the top of the serve loop, **before** the admission is processed, and from there to the end of the request nothing else drives a decode window: `pump()` and `batch_step()` run on the single serve thread. The disk match, the two-pass stream, the restore into the session, the device-to-device copy into the batch slot and — on the production (pipelined) route — the prefill of the new prompt's tail all run inside that one admission. What is **asynchronous is the write** of the park mirror; the read is not. On the pipelined route `batch_read_piece()` returns `0`, so `read_part` takes one uninterrupted run and both the `BYIELD` hand-over and the decode-share interleave are **unreachable there**. That last finding is **#2275's**, cited above, not ours. - **The inheritance of already-parked conversations depends on not touching `STRATA_VERSION`.** The engine recognises a directory by the `strata-conv-` prefix and the sidecar identity, not by which flag opened it, so the cold level inherits the existing tier with zero migration — but a `STRATA_VERSION` bump makes every on-disk image `foreign` **silently**. On the first real start after this lands, the cold level's start line must read `foreign kept=0`; if it is not 0, the inheritance failed and the run must stop. `STRATA_VERSION` is not touched in this series. - **T11 (the cross-volume relocate) is not covered.** The move falling back from `rename` to `copy_file`+`remove` across two volumes is the one path in the degradation that no test exercises: the harness cannot mount a second volume, so it is left **uncovered** rather than invented. What *is* covered is its consequence — a move that fails leaves nothing half-done on either side (the test takes the file exclusively so both the rename and the copy fail). - **The read of the cold level is costlier than the warm one, and that cost is not measured as a pair.** That a colder medium is slower is a premise of the request, not a measurement here. What is measured is that an image read is a full stop of the decode (above) and that a disk restore of 171,516 tokens took 657 ms. - **The degradation is all-or-nothing, and the counters are coarse.** `degraded` is a single total (budget and age together), not two; and a degradation performed by the writer thread is reported on the counter's next read, not at the instant. The segment store and the archive stay **inside the cold level**; moving them is another PR. - **Single-slot configurations are compatible by construction, not measured live.** Neither a serial (no `--batch`) engine with the disk tier and `--conversation-cache-park disk|auto`, nor any configuration where `--conversation-cache-slots` differs from `--batch`, was exercised on a live engine; only the host policy tests cover them. `--batch 1` itself is refused by the engine ("it needs 2 or more slots"), so "one slot" means the serial serve. - **In `disk` mode, a rejected disk write has no RAM fallback** (the capture is counted and logged as `discards=N`), and a *provisional* park stays in RAM by decision. In `ram` mode, a park `provisional` (cancelled request) also keeps the large floor. - The `4224`-byte KV block used to convert block-read misses to MiB is hard-coded in the engine; a different model geometry would leave it stale, silently. - The physical-RAM gate that used to discard a snapshot was closed upstream in **#1347** (completed). When neither the parking floor nor the 512 MiB transient floor holds, a disk hit is still skipped (`disk hit skipped`). **Not covered, with its name** (this is the honest shortfall of the package; each is named so it can be routed). - **A park written straight from the live K/V pools.** This series captures to host RAM first; #1480, #1529, #1810 and #1937 write the park from the session's pools without materialising a host image. - **A policy on top of the similarity / n-minimum filters.** The two knobs are already here — **this series added them** (`--conversation-cache-similarity` and `--conversation-cache-n-min`, commit *serve: durable disk tier for the conversation cache*, and they are **not** in upstream `main`) — and both sit at their defaults (`0`), so a disk hit is accepted with no minimum overlap. This package adds no policy on top of them. - **End-to-end evidence for the newest commits.** They rest on a host test build plus a compile of the `generate.cpp` object; there is **no live engine run** and `strata.exe` was not linked. #1480, #1529, #1810 and #1937 bring their own end-to-end measurements; this is the largest evidence gap in the package. - **Third-party validation.** The package has not been executed by anyone outside this house; #1937 has four independent testers, one of them on Windows. **What the numbers do not say.** - One machine, one model, one pass per cell; not a benchmark and no throughput promise. `tok/s` figures are contaminated by concurrent traffic on the live server. No absolute PCIe bytes (no DCGM on this box; the engine's own per-request proxies were used). - The counters of the production boot above are a **snapshot of a live log**: the log is written continuously and every count grows while the engine runs. They are one read of one boot, and the baseline window and the after window are **different traffic**, not an A/B. - The shared-`Sys` dedup is not conclusively measured (one pass, concurrent traffic); the restore ladder's `image rejected` branch did not fire in the live matrix, so its in-serve effect is host-tested, not measured. - Disk restore latency may be assisted by the OS file cache (2.9 GB in 274 ms ≈ 10.6 GB/s); not measured cold. No effect of `disk` mode on **decode** or **answer quality** was measured. - The newest bodies of work were verified by a host `ctest` run and by a `cl /Zs` syntax check of `generate.cpp`; **no CUDA build, no live engine run**, and `strata.exe` was not linked. The cascade's warm level is new code: its 406 host checks and its mutation check pass, but nothing of it has been served. ### Credits This layer is authored and directed by Shahrokh Zargarpour. The parking target, the transient floor and the cascade were written and verified with the Grok Build coding agent. 🤖 Generated with Grok Build — Flash Next XL Strata · DeepSeek V4 Flash The on-disk spill sidecar format we build on — the `SCSM` header and the `MetaWriter`/`MetaReader` pair, version 1 — is credited to the authors whose PRs carry it: **#1271 (ANBAL534)**, **#1480 (routhjim)**, **#1529 (konijiwa110)** and **#1810 (CC-David-CC)**. Our sidecar is a backward-compatible superset (`kMetaVersion = 2`; "v1 (single image) is still read"): we read their v1, they do not read our v2. The v1 origin is credited to them by prudence — the timeline is ambiguous and we did not inspect their fork history to settle authorship. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:33:06 +07:00
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
Niko1221/Strata#4087
No description provided.