[PR #2098] [CLOSED] disk park: the profile tag carries the engine version, and the blob carries the tag #3859

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2098
Author: @leocoic
Created: 10/12/2026
Status: ❌ Closed

Base: main ← Head: f-disk-park-0143


📝 Commits (10+)

  • 56c51e9 gitignore: keep the disk-park working residue out of git
  • d7870e6 serve: a failed conversation checkpoint restore no longer exits the engine
  • c88e7e3 conversation cache: hand the evicted entry to the caller instead of dropping it
  • 792444c disk park: a disk tier under the parked-conversation cache
  • 381e845 serve: wire the disk park tier into the request path
  • 9b4160a merge origin/main (v0.1.43) into f-disk-park
  • af5456a disk park: the out-of-range blob case was not testing an out-of-range offset
  • 598d2f8 merge f-disk-park (the disk-park defect fixes) into f-disk-park-0143
  • 65426f0 serve: after non-finite logits this request does not read K/V back from the disk tier
  • 8364dea disk park: the profile tag carries the engine version, and the blob carries the tag

📊 Changes

41 files changed (+11525 additions, -16 deletions)

View changed files

📝 .gitignore (+13 -0)
📝 CMakeLists.txt (+18 -1)
➕ bench/results/2026-10-12-rtx3090-disk-park-tag-gate/README.md (+61 -0)
➕ bench/results/2026-10-12-rtx3090-disk-park-tag-gate/checksums.sha256 (+3 -0)
➕ bench/results/2026-10-12-rtx3090-disk-park-tag-gate/data/summary.json (+43 -0)
➕ bench/results/2026-10-12-rtx3090-disk-park-tag-gate/provenance.json (+36 -0)
📝 include/strata/core/conversation_cache.hpp (+27 -3)
➕ include/strata/core/disk_park_blob.hpp (+130 -0)
➕ include/strata/core/disk_park_bridge.hpp (+181 -0)
➕ include/strata/core/disk_park_digest.hpp (+94 -0)
➕ include/strata/core/disk_park_image.hpp (+113 -0)
➕ include/strata/core/disk_park_logs.hpp (+309 -0)
➕ include/strata/core/disk_park_session.hpp (+258 -0)
➕ include/strata/core/disk_park_spool.hpp (+109 -0)
➕ include/strata/core/disk_park_store.hpp (+204 -0)
➕ include/strata/core/p13_blob_compact.hpp (+257 -0)
➕ include/strata/core/p13_draft_kv.hpp (+212 -0)
➕ include/strata/core/p13_pooled.hpp (+134 -0)
➕ include/strata/core/p13_session_id.hpp (+196 -0)
📝 serve/server.py (+59 -0)

...and 21 more files

📄 Description

Title

disk park: the profile tag carries the engine version, and the blob carries the tag

Summary

The parked tier had no idea which engine wrote it. DiskParkProfile::tag() hashed model / kv format / context / rope only, so 62 GB of pages stored by 0.1.41 are read back verbatim by 0.1.43 — after any version that changes numerics, that is recurrent state computed by the previous routing. The blob layer was worse: checkpoints.bin carries no tag at all and is one file shared by every tag directory.

Both layers now carry the version. This branch also lands the disk park tier itself (a disk tier under the parked-conversation cache) and the fixes found while building it.

What changed

  • disk_park_digest.hpp/.cpp/_test.cpp — describe() now includes STRATA_VERSION (and STRATA_DISK_PARK_KEY for a manual key); the field table goes v1 → v2, so a version bump opens a new tag-XXXXXXXX/ directory instead of reusing the old one.
  • disk_park_blob.hpp/.cpp/_test.cpp — magic SKB1 → SKB2. The profile tag is written into the file header at @8 (those 4 bytes were reserved padding, so the 16-byte header and 32-byte entry header keep their exact layout — no record moves) and into every entry header at @+4 (which used to hold a version field nothing read back). On a tag mismatch the layer is neither read nor appended to, the old file is moved with a single rename to checkpoints.bin.tag-XXXXXXXX.stale (bytes untouched, not deleted) and a fresh file for the current tag is opened; STRATA_BLOB_STALE=off disables it instead. The scan skips entries whose tag does not match, which is safe because each entry carries its own length.
  • p13_blob_compact.hpp + tools/park-gc.cpp — p13_session_dirs used to sweep root/tag-*/*/, mixing live keys from every tag into one blob. park-gc now reads the tag from the blob header (--tag overrides) and compacts only that tag's session dirs.
  • generate.cpp — both the snapshot layer and the blob layer get disk_park.profile().tag().
  • conversation_cache.hpp + serve — an evicted entry is handed to the caller instead of dropped; a failed checkpoint restore no longer exits the engine; after non-finite logits a request does not read K/V back from the disk tier.
  • tools/p13-park-sweep.sh — the default park root comes from $HOME instead of one machine's home path; systemd units should set Environment=STRATA_PARK_STREAM=… explicitly.

Version-gate commit alone: 9 files, +175 / −32. Whole branch: 11 commits, 35 files.

Extra Notes

Tested on the 3090 with strata 0.1.43: snapshot dir renamed tag-A812110E → tag-AA00AEC7 — the tag algorithm changed, the numerics did not, so 68 GB was not re-stored. After restart the first requests show hit_rate 0.90–0.92 with prompt_read of only 686–1326. The old checkpoints.bin was archived rather than relabelled (its records were written by 0.1.41 before 13:27 and by 0.1.43 after, so relabelling it would be a lie); the new file has header SKB2 with tag AA00AEC7.

Tests: blob 68 (new version-gate section) / digest 28 / spool 64 / logs 98 / session 136 / bridge 54 / image 19 = 467 checks, 0 failures.

For anyone with existing caches: the new engine will not read an old tag-XXXXXXXX/ directory. If the numerics did not change across the upgrade, rename the directory to the new tag (no re-store). If they did, let it cold start — that is exactly what this gate is for. checkpoints.bin in the old SKB1 format is unreadable by design: archive it or delete it.


🔄 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/2098 **Author:** [@leocoic](https://github.com/leocoic) **Created:** 10/12/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `f-disk-park-0143` --- ### 📝 Commits (10+) - [`56c51e9`](https://github.com/Niko1221/Strata/commit/56c51e9c0777fde1da15df42bd425302e4a879a2) gitignore: keep the disk-park working residue out of git - [`d7870e6`](https://github.com/Niko1221/Strata/commit/d7870e6d51399fec2b43e7d157cca9529d47904b) serve: a failed conversation checkpoint restore no longer exits the engine - [`c88e7e3`](https://github.com/Niko1221/Strata/commit/c88e7e3b768a088b2077b24820d9216deaee4d60) conversation cache: hand the evicted entry to the caller instead of dropping it - [`792444c`](https://github.com/Niko1221/Strata/commit/792444c58b4f5b1e7b5658558584a4259b16e328) disk park: a disk tier under the parked-conversation cache - [`381e845`](https://github.com/Niko1221/Strata/commit/381e8455c91e271ee9b8efe78b584323f05f4d62) serve: wire the disk park tier into the request path - [`9b4160a`](https://github.com/Niko1221/Strata/commit/9b4160aa669029d0b4695aa9b440a70c8e1c8f56) merge origin/main (v0.1.43) into f-disk-park - [`af5456a`](https://github.com/Niko1221/Strata/commit/af5456a377a8bf47d8a54a69ee860d185ea1e8f5) disk park: the out-of-range blob case was not testing an out-of-range offset - [`598d2f8`](https://github.com/Niko1221/Strata/commit/598d2f836bf3a9fc1c46d0d6e22727204bcc70eb) merge f-disk-park (the disk-park defect fixes) into f-disk-park-0143 - [`65426f0`](https://github.com/Niko1221/Strata/commit/65426f0ede1e55db130b2a4adebafc363a767f06) serve: after non-finite logits this request does not read K/V back from the disk tier - [`8364dea`](https://github.com/Niko1221/Strata/commit/8364dea7f1a34764f7d830f15dd8910464cd825d) disk park: the profile tag carries the engine version, and the blob carries the tag ### 📊 Changes **41 files changed** (+11525 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+13 -0) 📝 `CMakeLists.txt` (+18 -1) ➕ `bench/results/2026-10-12-rtx3090-disk-park-tag-gate/README.md` (+61 -0) ➕ `bench/results/2026-10-12-rtx3090-disk-park-tag-gate/checksums.sha256` (+3 -0) ➕ `bench/results/2026-10-12-rtx3090-disk-park-tag-gate/data/summary.json` (+43 -0) ➕ `bench/results/2026-10-12-rtx3090-disk-park-tag-gate/provenance.json` (+36 -0) 📝 `include/strata/core/conversation_cache.hpp` (+27 -3) ➕ `include/strata/core/disk_park_blob.hpp` (+130 -0) ➕ `include/strata/core/disk_park_bridge.hpp` (+181 -0) ➕ `include/strata/core/disk_park_digest.hpp` (+94 -0) ➕ `include/strata/core/disk_park_image.hpp` (+113 -0) ➕ `include/strata/core/disk_park_logs.hpp` (+309 -0) ➕ `include/strata/core/disk_park_session.hpp` (+258 -0) ➕ `include/strata/core/disk_park_spool.hpp` (+109 -0) ➕ `include/strata/core/disk_park_store.hpp` (+204 -0) ➕ `include/strata/core/p13_blob_compact.hpp` (+257 -0) ➕ `include/strata/core/p13_draft_kv.hpp` (+212 -0) ➕ `include/strata/core/p13_pooled.hpp` (+134 -0) ➕ `include/strata/core/p13_session_id.hpp` (+196 -0) 📝 `serve/server.py` (+59 -0) _...and 21 more files_ </details> ### 📄 Description ## Title disk park: the profile tag carries the engine version, and the blob carries the tag ## Summary The parked tier had no idea which engine wrote it. `DiskParkProfile::tag()` hashed model / kv format / context / rope only, so 62 GB of pages stored by 0.1.41 are read back verbatim by 0.1.43 — after any version that changes numerics, that is recurrent state computed by the previous routing. The blob layer was worse: `checkpoints.bin` carries no tag at all and is one file shared by every tag directory. Both layers now carry the version. This branch also lands the disk park tier itself (a disk tier under the parked-conversation cache) and the fixes found while building it. ## What changed - `disk_park_digest.hpp/.cpp/_test.cpp` — `describe()` now includes `STRATA_VERSION` (and `STRATA_DISK_PARK_KEY` for a manual key); the field table goes `v1` → `v2`, so a version bump opens a new `tag-XXXXXXXX/` directory instead of reusing the old one. - `disk_park_blob.hpp/.cpp/_test.cpp` — magic `SKB1` → `SKB2`. The profile tag is written into the file header at `@8` (those 4 bytes were reserved padding, so the 16-byte header and 32-byte entry header keep their exact layout — no record moves) and into every entry header at `@+4` (which used to hold a `version` field nothing read back). On a tag mismatch the layer is neither read nor appended to, the old file is moved with a single rename to `checkpoints.bin.tag-XXXXXXXX.stale` (bytes untouched, not deleted) and a fresh file for the current tag is opened; `STRATA_BLOB_STALE=off` disables it instead. The scan skips entries whose tag does not match, which is safe because each entry carries its own length. - `p13_blob_compact.hpp` + `tools/park-gc.cpp` — `p13_session_dirs` used to sweep `root/tag-*/*/`, mixing live keys from every tag into one blob. `park-gc` now reads the tag from the blob header (`--tag` overrides) and compacts only that tag's session dirs. - `generate.cpp` — both the snapshot layer and the blob layer get `disk_park.profile().tag()`. - `conversation_cache.hpp` + serve — an evicted entry is handed to the caller instead of dropped; a failed checkpoint restore no longer exits the engine; after non-finite logits a request does not read K/V back from the disk tier. - `tools/p13-park-sweep.sh` — the default park root comes from `$HOME` instead of one machine's home path; systemd units should set `Environment=STRATA_PARK_STREAM=…` explicitly. Version-gate commit alone: 9 files, +175 / −32. Whole branch: 11 commits, 35 files. ## Extra Notes Tested on the 3090 with `strata 0.1.43`: snapshot dir renamed `tag-A812110E` → `tag-AA00AEC7` — the tag algorithm changed, the numerics did not, so 68 GB was not re-stored. After restart the first requests show `hit_rate 0.90–0.92` with `prompt_read` of only 686–1326. The old `checkpoints.bin` was archived rather than relabelled (its records were written by 0.1.41 before 13:27 and by 0.1.43 after, so relabelling it would be a lie); the new file has header `SKB2` with tag `AA00AEC7`. Tests: blob 68 (new version-gate section) / digest 28 / spool 64 / logs 98 / session 136 / bridge 54 / image 19 = **467 checks, 0 failures**. For anyone with existing caches: the new engine will not read an old `tag-XXXXXXXX/` directory. If the numerics did not change across the upgrade, rename the directory to the new tag (no re-store). If they did, let it cold start — that is exactly what this gate is for. `checkpoints.bin` in the old `SKB1` format is unreadable by design: archive it or delete it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:31:15 +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#3859
No description provided.