[PR #4551] [Engine] session-file v3: incremental append saves under --session-save-append #5084

Open
opened 2026-11-07 16:32:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4551
Author: @sakuumomo
Created: 10/28/2026
Status: 🔄 Open

Base: main ← Head: pr/engine-session-save-append


📝 Commits (10+)

  • e05bf4a Add an opt-in build that runs CUDA and HIP in one process
  • f8e0e29 A hybrid build follows 0.2.2's HIP rules for a HIP primary: the early PLE flag and side-thread launch rule, the queue priming, and the integrated-GPU cache reserve
  • b17e8dc docs: the hybrid CUDA+HIP build (opt-in), its devices and its probe command
  • cf3d713 A hybrid build follows 0.2.3's drafter rules for a HIP primary too: the dflash2 stream priority and fork defaults, the Strix Halo window cap and the 12 GB card line
  • bf40f37 hip_compat: cover the CUDA usages main's drafter brings to the HIP copy
  • 8843b4e hip_compat: drop grid_constant on the HIP copy
  • 0d8075f hybrid: do not glob the dsv41 engine path into strata
  • 256cd07 hybrid: keep the moe_ws family out of the HIP glob - upstream #3752 (GP100 weight-stationary experts) landed with the 0.2.7 rebase, after this file was written. The kernels are pure PTX (prmt/mad.wide/f16x2 asm): on the CUDA side they are strata_mmq sources only under STRATA_EXPERIMENTAL_SM60, gated at run time to machines whose every GPU is cc 6.0. A hip-src copy of them fails on 'invalid output constraint =f' / 'invalid instruction' in the gfx1150 pass, and could never dispatch on an AMD device - so they belong beside the gdn_chunk/mmq_nvfp4/mmq_kq_lib exclusions. moko flavor build was the witness: moe_ws_down/gu_iq2/gu_iq3 were the only FAILED targets.
  • 1b8fa69 hybrid: speak CUDA 13's plain runtime API names
  • 9828162 Let a HIP helper read pinned expert rows in place

📊 Changes

58 files changed (+12173 additions, -222 deletions)

View changed files

📝 CMakeLists.txt (+53 -5)
📝 bench/results/2026-10-10-community-2x-p40-iq3_s/README.md (+4 -2)
➕ cmake/hip-host-tramp.py (+99 -0)
➕ cmake/hybrid.cmake (+406 -0)
➕ cmake/prefix-hip.py (+97 -0)
📝 docs/AMD_HIP.md (+25 -1)
📝 docs/DETAILS.md (+59 -6)
📝 docs/MULTI_GPU.md (+2 -1)
📝 docs/QUANTS.md (+2 -1)
📝 include/strata/core/conversation_cache.hpp (+12 -1)
📝 include/strata/core/conversation_file.hpp (+186 -5)
📝 include/strata/core/conversation_snapshot.hpp (+33 -1)
📝 include/strata/core/device.hpp (+3 -4)
📝 include/strata/core/expert_cache.hpp (+1 -1)
📝 include/strata/core/expert_source.hpp (+19 -0)
📝 include/strata/core/layer.hpp (+7 -0)
📝 include/strata/core/remote_experts.hpp (+22 -1)
📝 include/strata/core/session.hpp (+42 -0)
📝 include/strata/core/session_save_reclaim.hpp (+38 -9)
📝 include/strata/hip_compat/cublas_v2.h (+4 -0)

...and 38 more files

📄 Description

Problem and result: saves rewrite the whole conversation file every time — a 30k-token session costs ~1.1 GB written per save. This adds an opt-in incremental mode: with --session-save-append, a save APPENDS its new generation group onto its own file instead of rewriting it, behind the trailer chain + digest authority cascade that already guards a torn tail. Flag-off behavior is unchanged: a flag-off save is byte-identical to v2 (pinned by conversation_file_test's golden fixture).

On a live serve host (proof tables collapsible below): re-save with no request in between went from writing 1,109,307,968 bytes in 8.88 s to appending 237,226,496 bytes in 1.97 s; a second shape: 1,053,068,864 / 31.5 s → 237,210,624 / 2.11 s.

Related discussion: #4552 (the steady-state blocker: engine-internal mount/borrow watermarks dirtied from token 0 — fixed on this branch as of 2026-11-07: every proven-bytes resume now marks the restored prefix, see Approach and Limits). Stacks on #4310 — see Limits.

Approach:

  • v3 format: per-generation groups appended to the file itself (no temp, no rename); header/trailer chain, region-map reader, digest authority + demotion cascade behind a torn tail.
  • The save gate (session_save_gate + the kv watermark M1–M7 in SessionState): a save may append only when the pool's first dirty cell, rounded to whole pages, is at or above the file's whole-page committed prefix. The whole-page rounding is load-bearing: comparing against the raw saved_tokens made every save at an unaligned boundary refuse its own next append — that bug was found by measurement on a live host (13 saves, 0 appends) and is pinned here with an unaligned gate matrix (conversation_append_test, session_watermark_test).
  • The append reports its DELTA as bytes (appended-only SAVED field) so the serve-side ladder can record appended / delta_bytes in its save ledger.
  • Compile portability: the v3 reader held its layer count in size_t while the reader's count(uint64_t& …) binding needs uint64_t — identical types on Linux, unsigned long vs unsigned long long on macOS arm64, where the reference refuses to bind (metal-link CI caught it). The count now follows the file's u64-counts convention; the other twelve count() sites already did.
  • #4552 fix (added 2026-11-07, in the shape the issue thread converged on): engine resumes that rewrite pools from proven bytes mark the restored prefix instead of dirtying from token 0. The core backstops conversation_kv_restore / conversation_kv_restore_prefix (M9) mark a COMPLETED restore at upto; a mid-transfer failure marks 0 (partial bytes landed); a refusal that wrote no pools marks nothing, so a rejected attempt cannot invalidate the watermark a previous save earned. The engine sites follow: the file restore (M3) at the restored conversation's whole cells, a park restore (M4) per carve against its own stage image, a prefix borrow (M4) at the borrowed count, a batch slot handing its conversation back (M5) at the tokens it returned; the zeroing sites (M2) keep marking 0 — there nothing was restored — and the checkpoint mount (M8) already marked at spare-row granularity, unchanged. On a layer split the save gate now consults session_gate_watermark, the fold (most-dirty carve) over every carve — a stage rewritten below the committed boundary refuses the append, the file-corrupting direction of the same defect — and the post-save raise lifts every carve's watermark, so a split save stops refusing its own next append.

Validation (branch tip f1dbcea0 — the append delta re-applied on the rebuilt 0.2.8 lineage; the v3 content is identical to the gate-verified d74bcec6 tree; local NixOS x86_64, AMD gfx1030 / ROCm 7.2.3; model Qwen3.8-Flash-Next IQ3_XXS GGUF, --kv fp16 --max-context 262144 --kv-resident 32768 --layer-split 19):
Passed:

  • cmake --build build && ctest --test-dir build -R 'conversation_(file|append|split_failure|cache|memory)_test|session_save_reclaim_test|session_watermark_test' (nix develop toolchain): 100 % tests passed out of 7. Running the binaries directly: conversation_append_test 1969 checks, conversation_file_test 263, session_watermark_test 21.
  • ThreadSanitizer build: conversation_file_test + conversation_append_test — 0 warnings (1969 + 260 checks; 3 filesystem-shape file checks skip under the sanitizer).
  • Serve-side python suites: session-ladder 112 tests OK, serve 156 tests OK.
  • Both package flavors build with installCheck on d74bcec6: the HIP/gfx1030 build and the CUDA build that also compiles the shared kernels for gfx1150 — rc=0.
  • GitHub Actions on d74bcec6: Metal build (macOS arm64), Minimal serving runtime, Title area — all green; on the rebased tip f1dbcea0 the Metal and title jobs are green again. Metal is compile-only here; no Metal execution claimed.
  • Hardware execution (live serve host running the deployed dd4790a7 build — the same lineage; the one commit on top is the macOS type binding above): the append/refusal/restoration behaviors in the collapsible tables below, from real saves against a running GPU engine, with the append delta round-tripping through the engine result into the serve-side save ledger.
  • 2026-10-30 rebase onto upstream v0.2.8 (870aedd9): the 16-commit append delta re-applied clean on the rebuilt chain of #4310 + #4306 + #4307 + #4411 + #3551/#3552/#3553 (nixos == branch tip; 85 signed commits on 870aedd9). Gates re-run on the rebuilt tip: session test family 7/7 (append 1969, file 263, watermark 21), ThreadSanitizer 1969 + 260 checks 0 warnings, full serve suite 1386 passed / 17 skipped, HIP and CUDA+HIP hybrid flavor builds rc=0 with installCheck.
    Failed: none on the submitted tree. (The previous head dd4790a7 failed the macOS metal-link compile — that failure is the compile fix above and the current head is green on the same job.)
    Not run: Windows builds; execution on NVIDIA hardware (the CUDA-flavor evidence is compile-only); Metal execution.

Update (2026-11-07): rebased onto upstream v0.2.12 (123bad4a, engine 0.1.58) with zero conflicts; the append delta re-applies 1:1 and the #4552 fix lands as described in Approach. The branch is fast-forwarded to the rebuilt train tip c3e4cdc4 (93 signed commits: the seven other PR chains of this stack re-merged in order onto 123bad4a, the append delta + #4552 fix riding the tip). Gates on that lineage: session test family 7/7 (conversation_append_test 1969 checks, conversation_file_test 263, session_watermark_test 31 — the battery grew with the #4552 pins: completed-restore marking at upto, mid-transfer failure marks 0, refusal marks nothing, park/borrow/batch prefix pins, the split-gate fold, the post-save raise of every carve —, session_save_reclaim_test 167); ThreadSanitizer 1969 + 260 checks, 0 warnings; full serve suite 1640 OK / 37 skipped; CUDA-13 nvcc (arch 89) compile of strata, conversation_snapshot_test and conversation_stage_split_test rc=0 (GPU execution stays with the validating CUDA hosts); HIP gfx1030 and CUDA+HIP hybrid (gfx1150, CUDA 13) flavor builds with installCheck. Engine identity across this pin (0.1.54 -> 0.1.58; SessionConfig::engine_version is in the file's config fingerprint): the first save of each pre-existing session file is a full rewrite by construction.

Limits:

  • Steady-state eligibility was the open question at submission: engine-internal resumes (park-borrow / slot-mount / file-restore) dirtied the pool from token 0, so only saves with untouched pool state in between appended — analyzed with repro in #4552. The #4552 follow-up above closes the proven-bytes half: those resumes mark the restored prefix, so the normal save-after-request cycle is append-eligible again (pinned by the session_watermark_test prefix pins). The remaining boundary is unchanged and remains correct: a resume that genuinely rewrites rows below the committed boundary (grow/trim churn) still refuses. A live-host re-measure of the steady state follows the owner's re-pin to the 0.2.12 lineage.
  • Stacks on #4310 (format v2): left draft until it lands; I will rebase onto main then. The merge lineage this branch sits on is fetchable at sakuumomo/Strata branch nixos (the run-here lineage: #4310 + #4306 + #4307 + #4411 + #3551/#3552/#3553 re-merged in order onto 123bad4a, the append delta + #4552 fix on the tip; nixos == this branch @ c3e4cdc4; earlier lineage tips stay fetchable as tags pin-*).
Live-host proof tables (click to expand)

Captured 2026-10-29 against the pre-#4552-fix build (engine 0.1.54 lineage dd4790a7). The refusal rows are the real behavior of that build — Proof B rows 2–4 show exactly the defect the #4552 follow-up above fixes; a fresh capture against the 0.2.12 lineage follows the owner's re-pin.

Proof A — chain-re-push shape (session probe-app-e), engine flags --session-save-reclaim --session-save-append:

save shape result
1 fresh file full 1.109 GB, 8.88 s (save gate: full rewrite - no verified checkpoint chain for this file)
2 re-save, no request in between appended — n_written 237,226,496 (delta), 1.97 s, log suffix (appended)
3–5 +31.6k-token re-pushed chain full (2.0 / 2.9 / 3.8 GB) — gate refuses: pool rows at or below the file's saved boundary may differ from what it committed (the K/V grow/trim genuinely churns rows below the boundary)
6 after restore (M3, dirty from 0) full, named reason

Proof B — short-increment shape (session probe-app-f, 28,966 → 29,014 tokens, inside the resident window):

save shape result
1 fresh file full 1.053 GB, 31.5 s
2–4 +7..17-token asks above the boundary full — refused (see #4552: resume re-copies pool rows)
5 re-save, no request in between appended — 237,210,624 bytes, 2.11 s

Engine log excerpts (session-dir paths elided):

session saved 30963 tokens, 1 of 2 checkpoints, 237226496 bytes to <sessions>/ap-probe5 in 1973.7 ms (state 146.3 ms) (appended)
session saved 29014 tokens, 1 of 5 checkpoints, 237210624 bytes to <sessions>/ap-probe6 in 2114.6 ms (state 146.8 ms) (appended)
save gate: full rewrite - pool rows at or below the file's saved boundary may differ from what it committed

🔄 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/4551 **Author:** [@sakuumomo](https://github.com/sakuumomo) **Created:** 10/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/engine-session-save-append` --- ### 📝 Commits (10+) - [`e05bf4a`](https://github.com/Niko1221/Strata/commit/e05bf4a9ef929944dbd2df41fa7a8a072a36f3ec) Add an opt-in build that runs CUDA and HIP in one process - [`f8e0e29`](https://github.com/Niko1221/Strata/commit/f8e0e292c72c3be3223cf083a2d018c393d3da8f) A hybrid build follows 0.2.2's HIP rules for a HIP primary: the early PLE flag and side-thread launch rule, the queue priming, and the integrated-GPU cache reserve - [`b17e8dc`](https://github.com/Niko1221/Strata/commit/b17e8dc18911d4212ceeeeef69c430e7fb58291f) docs: the hybrid CUDA+HIP build (opt-in), its devices and its probe command - [`cf3d713`](https://github.com/Niko1221/Strata/commit/cf3d7135343d443c4d5a1e452368d6231421403e) A hybrid build follows 0.2.3's drafter rules for a HIP primary too: the dflash2 stream priority and fork defaults, the Strix Halo window cap and the 12 GB card line - [`bf40f37`](https://github.com/Niko1221/Strata/commit/bf40f37ec536d0813fbc3df483bf3d63afac00ca) hip_compat: cover the CUDA usages main's drafter brings to the HIP copy - [`8843b4e`](https://github.com/Niko1221/Strata/commit/8843b4ef28911e3df670650cac7918899957b388) hip_compat: drop __grid_constant__ on the HIP copy - [`0d8075f`](https://github.com/Niko1221/Strata/commit/0d8075f9e84b495952a37f0eb967afdf8fc7ee63) hybrid: do not glob the dsv41 engine path into strata - [`256cd07`](https://github.com/Niko1221/Strata/commit/256cd076eb332f76970f7f6a895c8bd90d786683) hybrid: keep the moe_ws family out of the HIP glob - upstream #3752 (GP100 weight-stationary experts) landed with the 0.2.7 rebase, after this file was written. The kernels are pure PTX (prmt/mad.wide/f16x2 asm): on the CUDA side they are strata_mmq sources only under STRATA_EXPERIMENTAL_SM60, gated at run time to machines whose every GPU is cc 6.0. A hip-src copy of them fails on 'invalid output constraint =f' / 'invalid instruction' in the gfx1150 pass, and could never dispatch on an AMD device - so they belong beside the gdn_chunk/mmq_nvfp4/mmq_kq_lib exclusions. moko flavor build was the witness: moe_ws_down/gu_iq2/gu_iq3 were the only FAILED targets. - [`1b8fa69`](https://github.com/Niko1221/Strata/commit/1b8fa69a751a25ef00a1355e5d5dcc45ee38124c) hybrid: speak CUDA 13's plain runtime API names - [`9828162`](https://github.com/Niko1221/Strata/commit/98281626ab1625c859885b3bfbff33454acdb0cb) Let a HIP helper read pinned expert rows in place ### 📊 Changes **58 files changed** (+12173 additions, -222 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+53 -5) 📝 `bench/results/2026-10-10-community-2x-p40-iq3_s/README.md` (+4 -2) ➕ `cmake/hip-host-tramp.py` (+99 -0) ➕ `cmake/hybrid.cmake` (+406 -0) ➕ `cmake/prefix-hip.py` (+97 -0) 📝 `docs/AMD_HIP.md` (+25 -1) 📝 `docs/DETAILS.md` (+59 -6) 📝 `docs/MULTI_GPU.md` (+2 -1) 📝 `docs/QUANTS.md` (+2 -1) 📝 `include/strata/core/conversation_cache.hpp` (+12 -1) 📝 `include/strata/core/conversation_file.hpp` (+186 -5) 📝 `include/strata/core/conversation_snapshot.hpp` (+33 -1) 📝 `include/strata/core/device.hpp` (+3 -4) 📝 `include/strata/core/expert_cache.hpp` (+1 -1) 📝 `include/strata/core/expert_source.hpp` (+19 -0) 📝 `include/strata/core/layer.hpp` (+7 -0) 📝 `include/strata/core/remote_experts.hpp` (+22 -1) 📝 `include/strata/core/session.hpp` (+42 -0) 📝 `include/strata/core/session_save_reclaim.hpp` (+38 -9) 📝 `include/strata/hip_compat/cublas_v2.h` (+4 -0) _...and 38 more files_ </details> ### 📄 Description Problem and result: saves rewrite the whole conversation file every time — a 30k-token session costs ~1.1 GB written per save. This adds an opt-in incremental mode: with `--session-save-append`, a save APPENDS its new generation group onto its own file instead of rewriting it, behind the trailer chain + digest authority cascade that already guards a torn tail. Flag-off behavior is unchanged: a flag-off save is byte-identical to v2 (pinned by `conversation_file_test`'s golden fixture). On a live serve host (proof tables collapsible below): re-save with no request in between went from writing **1,109,307,968 bytes in 8.88 s** to appending **237,226,496 bytes in 1.97 s**; a second shape: 1,053,068,864 / 31.5 s → 237,210,624 / 2.11 s. Related discussion: #4552 (the steady-state blocker: engine-internal mount/borrow watermarks dirtied from token 0 — **fixed on this branch** as of 2026-11-07: every proven-bytes resume now marks the restored prefix, see Approach and Limits). Stacks on #4310 — see Limits. Approach: - v3 format: per-generation groups appended to the file itself (no temp, no rename); header/trailer chain, region-map reader, digest authority + demotion cascade behind a torn tail. - The save gate (`session_save_gate` + the kv watermark M1–M7 in `SessionState`): a save may append only when the pool's first dirty cell, rounded to whole pages, is at or above the file's **whole-page committed prefix**. The whole-page rounding is load-bearing: comparing against the raw `saved_tokens` made every save at an unaligned boundary refuse its own next append — that bug was found by measurement on a live host (13 saves, 0 appends) and is pinned here with an unaligned gate matrix (`conversation_append_test`, `session_watermark_test`). - The append reports its DELTA as `bytes` (appended-only SAVED field) so the serve-side ladder can record `appended` / `delta_bytes` in its save ledger. - Compile portability: the v3 reader held its layer count in `size_t` while the reader's `count(uint64_t& …)` binding needs `uint64_t` — identical types on Linux, `unsigned long` vs `unsigned long long` on macOS arm64, where the reference refuses to bind (`metal-link` CI caught it). The count now follows the file's u64-counts convention; the other twelve `count()` sites already did. - #4552 fix (added 2026-11-07, in the shape the issue thread converged on): engine resumes that rewrite pools **from proven bytes** mark the restored prefix instead of dirtying from token 0. The core backstops `conversation_kv_restore` / `conversation_kv_restore_prefix` (M9) mark a COMPLETED restore at `upto`; a mid-transfer failure marks 0 (partial bytes landed); a refusal that wrote no pools marks nothing, so a rejected attempt cannot invalidate the watermark a previous save earned. The engine sites follow: the file restore (M3) at the restored conversation's whole cells, a park restore (M4) per carve against its own stage image, a prefix borrow (M4) at the borrowed count, a batch slot handing its conversation back (M5) at the tokens it returned; the zeroing sites (M2) keep marking 0 — there nothing was restored — and the checkpoint mount (M8) already marked at spare-row granularity, unchanged. On a layer split the save gate now consults `session_gate_watermark`, the fold (most-dirty carve) over every carve — a stage rewritten below the committed boundary refuses the append, the file-corrupting direction of the same defect — and the post-save raise lifts every carve's watermark, so a split save stops refusing its own next append. Validation (branch tip `f1dbcea0` — the append delta re-applied on the rebuilt 0.2.8 lineage; the v3 content is identical to the gate-verified `d74bcec6` tree; local NixOS x86_64, AMD gfx1030 / ROCm 7.2.3; model Qwen3.8-Flash-Next IQ3_XXS GGUF, `--kv fp16 --max-context 262144 --kv-resident 32768 --layer-split 19`): Passed: - `cmake --build build && ctest --test-dir build -R 'conversation_(file|append|split_failure|cache|memory)_test|session_save_reclaim_test|session_watermark_test'` (nix develop toolchain): 100 % tests passed out of 7. Running the binaries directly: `conversation_append_test` 1969 checks, `conversation_file_test` 263, `session_watermark_test` 21. - ThreadSanitizer build: `conversation_file_test` + `conversation_append_test` — 0 warnings (1969 + 260 checks; 3 filesystem-shape file checks skip under the sanitizer). - Serve-side python suites: session-ladder 112 tests OK, serve 156 tests OK. - Both package flavors build with installCheck on `d74bcec6`: the HIP/gfx1030 build and the CUDA build that also compiles the shared kernels for gfx1150 — rc=0. - GitHub Actions on `d74bcec6`: Metal build (macOS arm64), Minimal serving runtime, Title area — all green; on the rebased tip `f1dbcea0` the Metal and title jobs are green again. Metal is compile-only here; no Metal execution claimed. - Hardware execution (live serve host running the deployed `dd4790a7` build — the same lineage; the one commit on top is the macOS type binding above): the append/refusal/restoration behaviors in the collapsible tables below, from real saves against a running GPU engine, with the append delta round-tripping through the engine result into the serve-side save ledger. - 2026-10-30 rebase onto upstream `v0.2.8` (`870aedd9`): the 16-commit append delta re-applied clean on the rebuilt chain of #4310 + #4306 + #4307 + #4411 + #3551/#3552/#3553 (`nixos` == branch tip; 85 signed commits on `870aedd9`). Gates re-run on the rebuilt tip: session test family 7/7 (append 1969, file 263, watermark 21), ThreadSanitizer 1969 + 260 checks 0 warnings, full serve suite 1386 passed / 17 skipped, HIP and CUDA+HIP hybrid flavor builds rc=0 with installCheck. Failed: none on the submitted tree. (The previous head `dd4790a7` failed the macOS `metal-link` compile — that failure is the compile fix above and the current head is green on the same job.) Not run: Windows builds; execution on NVIDIA hardware (the CUDA-flavor evidence is compile-only); Metal execution. Update (2026-11-07): rebased onto upstream `v0.2.12` (`123bad4a`, engine 0.1.58) with zero conflicts; the append delta re-applies 1:1 and the #4552 fix lands as described in Approach. The branch is fast-forwarded to the rebuilt train tip `c3e4cdc4` (93 signed commits: the seven other PR chains of this stack re-merged in order onto `123bad4a`, the append delta + #4552 fix riding the tip). Gates on that lineage: session test family 7/7 (`conversation_append_test` 1969 checks, `conversation_file_test` 263, `session_watermark_test` 31 — the battery grew with the #4552 pins: completed-restore marking at `upto`, mid-transfer failure marks 0, refusal marks nothing, park/borrow/batch prefix pins, the split-gate fold, the post-save raise of every carve —, `session_save_reclaim_test` 167); ThreadSanitizer 1969 + 260 checks, 0 warnings; full serve suite 1640 OK / 37 skipped; CUDA-13 nvcc (arch 89) compile of `strata`, `conversation_snapshot_test` and `conversation_stage_split_test` rc=0 (GPU execution stays with the validating CUDA hosts); HIP gfx1030 and CUDA+HIP hybrid (gfx1150, CUDA 13) flavor builds with installCheck. Engine identity across this pin (0.1.54 -> 0.1.58; `SessionConfig::engine_version` is in the file's config fingerprint): the first save of each pre-existing session file is a full rewrite by construction. Limits: - Steady-state eligibility was the open question at submission: engine-internal resumes (park-borrow / slot-mount / file-restore) dirtied the pool from token 0, so only saves with untouched pool state in between appended — analyzed with repro in #4552. The #4552 follow-up above closes the proven-bytes half: those resumes mark the restored prefix, so the normal save-after-request cycle is append-eligible again (pinned by the `session_watermark_test` prefix pins). The remaining boundary is unchanged and remains correct: a resume that genuinely rewrites rows below the committed boundary (grow/trim churn) still refuses. A live-host re-measure of the steady state follows the owner's re-pin to the 0.2.12 lineage. - Stacks on #4310 (format v2): left draft until it lands; I will rebase onto `main` then. The merge lineage this branch sits on is fetchable at `sakuumomo/Strata` branch `nixos` (the run-here lineage: #4310 + #4306 + #4307 + #4411 + #3551/#3552/#3553 re-merged in order onto `123bad4a`, the append delta + #4552 fix on the tip; `nixos` == this branch @ `c3e4cdc4`; earlier lineage tips stay fetchable as tags `pin-*`). <details> <summary>Live-host proof tables (click to expand)</summary> Captured 2026-10-29 against the pre-#4552-fix build (engine 0.1.54 lineage `dd4790a7`). The refusal rows are the real behavior of *that* build — Proof B rows 2–4 show exactly the defect the #4552 follow-up above fixes; a fresh capture against the 0.2.12 lineage follows the owner's re-pin. Proof A — chain-re-push shape (session `probe-app-e`), engine flags `--session-save-reclaim --session-save-append`: | save | shape | result | |---|---|---| | 1 | fresh file | full 1.109 GB, 8.88 s (`save gate: full rewrite - no verified checkpoint chain for this file`) | | 2 | re-save, no request in between | **appended** — `n_written` 237,226,496 (delta), 1.97 s, log suffix `(appended)` | | 3–5 | +31.6k-token re-pushed chain | full (2.0 / 2.9 / 3.8 GB) — gate refuses: `pool rows at or below the file's saved boundary may differ from what it committed` (the K/V grow/trim genuinely churns rows below the boundary) | | 6 | after restore (M3, dirty from 0) | full, named reason | Proof B — short-increment shape (session `probe-app-f`, 28,966 → 29,014 tokens, inside the resident window): | save | shape | result | |---|---|---| | 1 | fresh file | full 1.053 GB, 31.5 s | | 2–4 | +7..17-token asks above the boundary | full — refused (see #4552: resume re-copies pool rows) | | 5 | re-save, no request in between | **appended** — 237,210,624 bytes, 2.11 s | Engine log excerpts (session-dir paths elided): ```text session saved 30963 tokens, 1 of 2 checkpoints, 237226496 bytes to <sessions>/ap-probe5 in 1973.7 ms (state 146.3 ms) (appended) session saved 29014 tokens, 1 of 5 checkpoints, 237210624 bytes to <sessions>/ap-probe6 in 2114.6 ms (state 146.8 ms) (appended) save gate: full rewrite - pool rows at or below the file's saved boundary may differ from what it committed ``` </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5084
No description provided.