perf(vk): the pipeline notes are stored without their zeros #3027

Merged
HumanBean merged 1 commit from HumanBean/Longshot:perf/note-pack into mod-api 2026-12-02 21:06:21 +00:00
Owner

Summary

A pipeline note is the draw state as it lies in memory, about 27 KB of which about 105 bytes are not zero. After a preparation longshot_pipelines.bin is about 1.05 GB (38,774 notes here), 99.7% of it zeros. Each note is now stored as its runs of non-zero bytes.

On top of mod-api (#2822). See #1649: with #3023 this covers what it proposes, so it can be closed once both are in.

Read first: gpu/vk/note_pack.h (the format, the walk, the append and the conversion), then notes_pack_file, notes_open_locked, pipe_notes_refs and pipe_note_at in gpu/vk/vk_draw.cpp.

  • The head's second word is the note size with its top bit set for a packed file; records are [length][runs].
  • An existing file is converted once, before it is first read or opened to add to, keeping its notes and stamp: no new preparation. If the new file can't be written, the old one is read and added to as before.
  • The conversion writes a staging file of its own and replaces the notes only if they did not change meanwhile. A note that is not written whole is rolled back and none is added again that run. A file that can't be walked is left alone and not added to.
  • A reference's place carries a bit saying its record is packed, so the by-position readers are unchanged.
  • No new library. PipeNote and kNotesFormat are unchanged.

Testing

Tested: Linux, RTX 3090, NVIDIA 620.70.06, head 355a203bc9 on mod-api d6b5bd5123.

  • A runtime with an existing 1,052,481,472-byte notes file (38,774 notes). dev.py smoke PASS twice: the first start logs stored without their zeros, 1003 MB made 7 MB, and both find 38774 noted pipelines. Those two confined runs had no kept programs, so built nothing from the notes.
  • One play run with HOS_SANDBOX=0 (in play, then the Market): 38,774 notes found, 9,346 graphics pipelines made at load from the packed records (0 not in a cache), 5,196 loads, no read failures.
  • The game run found a bug the tests did not: the preparation's state list opens the file to add to before anything reads it, so it was never converted. Fixed, with a check in test_pipelines_outlive_cache_format.
  • A harness over note_pack.h on a copy of a real file: all 38,774 records read back byte for byte, 1052.5 MB to 7.6 MB, converted in 1.36 s.
  • mise run test (before that last fix): 825 passed, 35 failed, 12 skipped; the same 35 names fail on untouched mod-api 582b6a1a (not rerun on the newer base): test_astc_upload_chunking, test_async_astc_upload_chunks, test_bind_memo, test_blocks_at_start, test_direct_buffer_writes, test_drawn_page_map, test_draw_stream_visibility, test_early_split_before_draw, test_flat_map, test_fsr_image_retirement, test_fsr_uniform_ownership, test_image_reaper_threads, test_import_reach, test_late_fix_build, test_lifter, test_menu_i18n, test_mirror_bookkeeping, test_pass_barrier, test_present_acquire_ahead, test_present_image_free, test_readback_timeout_reuse, test_recorder_sync, test_recording_admission, test_report_words, test_staging_burst, test_target_retention, test_tex_desc_memo, test_text_keyboard_policy, test_ub_snapshot_default, test_ub_snapshot_gpu_writes, test_vk_wb_cpu_words_fast, test_vram_compact, test_wb_diff_stale_shadow, test_wb_pending_capture, test_wrote_regions. After the fix: the note tests, 15 passed. dev.py vk builds the renderer.
  • New tests/test_note_pack.py: round trips, damaged runs, conversion, a part record, a length no record has, a write that fails.

Still to test:

  • Windows and Steam Deck: build, an existing notes file converted, a preparation, a restart and play that adds notes, with the same note count each start (by hand or @Beanstalk).

Measurements

Verdict: the notes take 139x less disk. Frame rate was not measured.

Setup: Linux, RTX 3090. Size and conversion: the harness above on a copy of one file. The start's walk of the notes: the log's the notes' file walked 1 times this start, in N ms, from different runtimes and not interleaved, so rough. main itself was not run: the first column is the unpacked format, which main and this PR's base share, measured on builds of the base.

Before: main @ b40214d2bb After: this PR @ 355a203b
longshot_pipelines.bin 1052.5 MB 7.6 MB
the start's walk of the notes 483 and 610 ms 51 ms
conversion, once 1.4 s

Risks

  • A build from before this that shares the folder takes a packed file for another layout and starts its notes again (the state list brings many back).
  • The start's walk reads and unpacks every record (measured above).
  • A wrong reader here means pipelines not prepared, and draws left out while they compile in play.
  • A revert alone does not read a converted file: it starts the notes again.

Checklist

This PR's base is mod-api: read main below as the base.

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

🤖 Generated with Claude Code

## Summary A pipeline note is the draw state as it lies in memory, about 27 KB of which about 105 bytes are not zero. After a preparation `longshot_pipelines.bin` is about 1.05 GB (38,774 notes here), 99.7% of it zeros. Each note is now stored as its runs of non-zero bytes. On top of `mod-api` ([#2822](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2822)). See [#1649](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1649): with [#3023](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3023) this covers what it proposes, so it can be closed once both are in. Read first: `gpu/vk/note_pack.h` (the format, the walk, the append and the conversion), then `notes_pack_file`, `notes_open_locked`, `pipe_notes_refs` and `pipe_note_at` in `gpu/vk/vk_draw.cpp`. - The head's second word is the note size with its top bit set for a packed file; records are `[length][runs]`. - An existing file is converted once, before it is first read or opened to add to, keeping its notes and stamp: no new preparation. If the new file can't be written, the old one is read and added to as before. - The conversion writes a staging file of its own and replaces the notes only if they did not change meanwhile. A note that is not written whole is rolled back and none is added again that run. A file that can't be walked is left alone and not added to. - A reference's place carries a bit saying its record is packed, so the by-position readers are unchanged. - No new library. `PipeNote` and `kNotesFormat` are unchanged. ## Testing **Tested:** Linux, RTX 3090, NVIDIA 620.70.06, head 355a203bc94f on `mod-api` d6b5bd51230b. - A runtime with an existing 1,052,481,472-byte notes file (38,774 notes). `dev.py smoke` PASS twice: the first start logs `stored without their zeros, 1003 MB made 7 MB`, and both find `38774 noted pipelines`. Those two confined runs had no kept programs, so built nothing from the notes. - One play run with `HOS_SANDBOX=0` (in play, then the Market): 38,774 notes found, 9,346 graphics pipelines made at load from the packed records (0 not in a cache), 5,196 loads, no read failures. - The game run found a bug the tests did not: the preparation's state list opens the file to add to before anything reads it, so it was never converted. Fixed, with a check in `test_pipelines_outlive_cache_format`. - A harness over `note_pack.h` on a copy of a real file: all 38,774 records read back byte for byte, 1052.5 MB to 7.6 MB, converted in 1.36 s. - `mise run test` (before that last fix): 825 passed, 35 failed, 12 skipped; the same 35 names fail on untouched `mod-api` 582b6a1a (not rerun on the newer base): `test_astc_upload_chunking`, `test_async_astc_upload_chunks`, `test_bind_memo`, `test_blocks_at_start`, `test_direct_buffer_writes`, `test_drawn_page_map`, `test_draw_stream_visibility`, `test_early_split_before_draw`, `test_flat_map`, `test_fsr_image_retirement`, `test_fsr_uniform_ownership`, `test_image_reaper_threads`, `test_import_reach`, `test_late_fix_build`, `test_lifter`, `test_menu_i18n`, `test_mirror_bookkeeping`, `test_pass_barrier`, `test_present_acquire_ahead`, `test_present_image_free`, `test_readback_timeout_reuse`, `test_recorder_sync`, `test_recording_admission`, `test_report_words`, `test_staging_burst`, `test_target_retention`, `test_tex_desc_memo`, `test_text_keyboard_policy`, `test_ub_snapshot_default`, `test_ub_snapshot_gpu_writes`, `test_vk_wb_cpu_words_fast`, `test_vram_compact`, `test_wb_diff_stale_shadow`, `test_wb_pending_capture`, `test_wrote_regions`. After the fix: the note tests, 15 passed. `dev.py vk` builds the renderer. - New `tests/test_note_pack.py`: round trips, damaged runs, conversion, a part record, a length no record has, a write that fails. **Still to test:** - Windows and Steam Deck: build, an existing notes file converted, a preparation, a restart and play that adds notes, with the same note count each start (by hand or @Beanstalk). ## Measurements **Verdict:** the notes take 139x less disk. Frame rate was not measured. Setup: Linux, RTX 3090. Size and conversion: the harness above on a copy of one file. The start's walk of the notes: the log's `the notes' file walked 1 times this start, in N ms`, from different runtimes and not interleaved, so rough. `main` itself was not run: the first column is the unpacked format, which `main` and this PR's base share, measured on builds of the base. | | Before: main @ b40214d2bb8d | After: this PR @ 355a203b | |---|---|---| | `longshot_pipelines.bin` | 1052.5 MB | 7.6 MB | | the start's walk of the notes | 483 and 610 ms | 51 ms | | conversion, once | | 1.4 s | ## Risks - **A build from before this that shares the folder** takes a packed file for another layout and starts its notes again (the state list brings many back). - The start's walk reads and unpacks every record (measured above). - A wrong reader here means pipelines not prepared, and draws left out while they compile in play. - A revert alone does not read a converted file: it starts the notes again. ## Checklist This PR's base is `mod-api`: read `main` below as the base. ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
perf(vk): the pipeline notes are stored without their zeros
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
a95f7d7d65
A note is ~27 KB of draw state, ~105 bytes of it not zero: 1.05 GB after
a preparation. Each is kept as its runs (gpu/vk/note_pack.h); an existing
file is converted in place.

See #1649.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
HumanBean changed title from WIP: perf(vk): the pipeline notes are stored without their zeros to perf(vk): the pipeline notes are stored without their zeros 2026-12-02 20:08:05 +00:00
BeanBot left a comment

Recommendation: Request changes. A read error during the packed-file scan can truncate valid pipeline notes, and concurrent conversions can corrupt the replacement file. The existing checks also need updating, and neither the claimed space saving nor the startup cost has been measured.

Stores pipeline notes as runs of non-zero bytes and converts existing files to reduce cache size. It adds a conversion step and packed-record reads at startup and during pipeline loading; their cost and the actual saving are unmeasured.

Blocking (4): must change before merging.

  1. L1 gpu/vk/note_pack.h:118: Do not truncate the file when the scan fails to read or seek. (more on the line) Do: Return a separate scan status for I/O failures and only resize after positively identifying a partial trailing record; leave the file untouched on a failed scan.
  2. L2 gpu/vk/note_pack.h:138: Conversion uses one predictable staging file without coordinating with other processes that share the cache. (more on the line) Do: Serialize conversion across processes or use unique staging files and an atomic replacement protocol that verifies the source has not changed before replacing it.
  3. L3 gpu/vk/vk_draw.cpp:2658: A failed packed-record write is ignored after the key has been marked as noted, and subsequent records are still appended. (more on the line) Do: Check the write and flush results, stop appending or roll back to the last complete record on failure, and do not report the key as successfully recorded.
  4. L4 gpu/vk/vk_draw.cpp:14546: Update the existing source-cut checks for the changed readers and add behavioral coverage for the packed format. (more on the line) Do: Update the affected fixtures without weakening their existing cases, and add game-free round-trip, conversion, damaged-record, partial-tail and write-failure cases that exercise the real implementation.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L5: Measure the space saving and startup costs against the base before choosing this format for every installation. When: Conversion reads and rewrites the existing file once, and subsequent starts unpack every indexed record; the PR has no measurements showing the resulting file size, conversion time, or cold and warm startup time. Do: Compare the base and head with the same prepared cache and hardware, reporting file size, conversion time, repeated cold and warm startup times, and relevant frame timing.
  • L6: Verify conversion and pipeline loading in the game on the supported systems this cache path affects. When: No build or game run has checked that existing notes survive conversion and that new packed notes are loaded during preparation and play on Windows, Linux or Steam Deck. Do: Build and exercise an existing notes file, preparation, restart and play that adds notes on Windows and Linux, including affected Tier 1 hardware and Steam Deck; compare note counts and check for missing pipelines.

@fix can do L1, L2, L3 and L4.

Checks: Still running: PR description / Title and description (pull_request_target).

More: does it help, other systems, switches, what was read

Does it help: Unproven. The PR reports a 1.05 GB existing file with 38,774 notes, but provides no size or timing results for the packed file, conversion, or subsequent starts.

Other systems: The format is shared by preparation, startup indexing, pipeline loading and play-time note writes on Windows and Linux, including Steam Deck and all GPU vendors. No game or platform runs are reported. Older builds and reverts will discard the packed notes as described in the PR.

Switches: None added, changed or removed.

Reviewed: a95f7d7d65 against 582b6a1abf: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md and the pull request template; docs/review-checklist.md and the adjacent Tooling checkout were absent. Read the complete diff, commit message, note_pack.h and vk_pipelines.h, and the changed sections and relevant callers in vk_draw.cpp. Inspected the affected source-cut checks and searched related readers and path handling. The rest of vk_draw.cpp and the full test suite were not read. No recorded runs or translations were supplied.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance with a Co-Authored-By trailer.
  • The diff contains no game-derived output, generated files, third-party changes, renderer API changes or new switches.
  • Packed record lengths and run counts are bounded before unpacking, and the note-file format flag is accessed under note_mu.

Testing: Read-only review; no code, tests or project scripts were run. The PR reports no testing.

Overlaps and merge order: The PR is based on #2822 and identifies #3023 as related; no independent overlap search was available with the network closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as HumanBean took it out of WIP. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** A read error during the packed-file scan can truncate valid pipeline notes, and concurrent conversions can corrupt the replacement file. The existing checks also need updating, and neither the claimed space saving nor the startup cost has been measured. Stores pipeline notes as runs of non-zero bytes and converts existing files to reduce cache size. It adds a conversion step and packed-record reads at startup and during pipeline loading; their cost and the actual saving are unmeasured. **Blocking (4)**: must change before merging. 1. **L1** `gpu/vk/note_pack.h:118`: Do not truncate the file when the scan fails to read or seek. (more on the line) **Do:** Return a separate scan status for I/O failures and only resize after positively identifying a partial trailing record; leave the file untouched on a failed scan. 2. **L2** `gpu/vk/note_pack.h:138`: Conversion uses one predictable staging file without coordinating with other processes that share the cache. (more on the line) **Do:** Serialize conversion across processes or use unique staging files and an atomic replacement protocol that verifies the source has not changed before replacing it. 3. **L3** `gpu/vk/vk_draw.cpp:2658`: A failed packed-record write is ignored after the key has been marked as noted, and subsequent records are still appended. (more on the line) **Do:** Check the write and flush results, stop appending or roll back to the last complete record on failure, and do not report the key as successfully recorded. 4. **L4** `gpu/vk/vk_draw.cpp:14546`: Update the existing source-cut checks for the changed readers and add behavioral coverage for the packed format. (more on the line) **Do:** Update the affected fixtures without weakening their existing cases, and add game-free round-trip, conversion, damaged-record, partial-tail and write-failure cases that exercise the real implementation. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L5**: Measure the space saving and startup costs against the base before choosing this format for every installation. *When:* Conversion reads and rewrites the existing file once, and subsequent starts unpack every indexed record; the PR has no measurements showing the resulting file size, conversion time, or cold and warm startup time. **Do:** Compare the base and head with the same prepared cache and hardware, reporting file size, conversion time, repeated cold and warm startup times, and relevant frame timing. - **L6**: Verify conversion and pipeline loading in the game on the supported systems this cache path affects. *When:* No build or game run has checked that existing notes survive conversion and that new packed notes are loaded during preparation and play on Windows, Linux or Steam Deck. **Do:** Build and exercise an existing notes file, preparation, restart and play that adds notes on Windows and Linux, including affected Tier 1 hardware and Steam Deck; compare note counts and check for missing pipelines. `@fix` can do L1, L2, L3 and L4. **Checks:** Still running: `PR description / Title and description (pull_request_target)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The PR reports a 1.05 GB existing file with 38,774 notes, but provides no size or timing results for the packed file, conversion, or subsequent starts. **Other systems:** The format is shared by preparation, startup indexing, pipeline loading and play-time note writes on Windows and Linux, including Steam Deck and all GPU vendors. No game or platform runs are reported. Older builds and reverts will discard the packed notes as described in the PR. **Switches:** None added, changed or removed. **Reviewed:** a95f7d7d65a2 against 582b6a1abf03: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md and the pull request template; docs/review-checklist.md and the adjacent Tooling checkout were absent. Read the complete diff, commit message, note_pack.h and vk_pipelines.h, and the changed sections and relevant callers in vk_draw.cpp. Inspected the affected source-cut checks and searched related readers and path handling. The rest of vk_draw.cpp and the full test suite were not read. No recorded runs or translations were supplied.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance with a Co-Authored-By trailer. - The diff contains no game-derived output, generated files, third-party changes, renderer API changes or new switches. - Packed record lengths and run counts are bounded before unpacking, and the note-file format flag is accessed under note_mu. **Testing:** Read-only review; no code, tests or project scripts were run. The PR reports no testing. **Overlaps and merge order:** The PR is based on #2822 and identifies #3023 as related; no independent overlap search was available with the network closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as HumanBean took it out of WIP. Nothing was run; a maintainer decides.</sub>
@ -0,0 +115,4 @@
FILE* f = std::fopen(path.c_str(), "rb");
if (!f) return false;
walk(f, n, end);
std::fclose(f);
Member

L1 (blocking): Do not truncate the file when the scan fails to read or seek. walk returns the last position reached for both a partial tail and an I/O failure, so cut cannot distinguish them.

When: If a packed file has valid records but a seek or read fails partway through, walk stops at that record and cut resizes the file to that point, permanently deleting the remaining valid notes.

Do: Return a separate scan status for I/O failures and only resize after positively identifying a partial trailing record; leave the file untouched on a failed scan.

**L1** (blocking): Do not truncate the file when the scan fails to read or seek. walk returns the last position reached for both a partial tail and an I/O failure, so cut cannot distinguish them. *When:* If a packed file has valid records but a seek or read fails partway through, walk stops at that record and cut resizes the file to that point, permanently deleting the remaining valid notes. **Do:** Return a separate scan status for I/O failures and only resize after positively identifying a partial trailing record; leave the file untouched on a failed scan.
@ -0,0 +135,4 @@
return false;
}
const std::string fresh = path + ".packing";
FILE* out = std::fopen(fresh.c_str(), "wb");
Member

L2 (blocking): Conversion uses one predictable staging file without coordinating with other processes that share the cache.

When: If two game processes convert the same old notes file at once, both open the same .packing file with truncation and write through separate handles. One can rename it over the original while the other is still writing, leaving the packed notes corrupted or incomplete.

Do: Serialize conversion across processes or use unique staging files and an atomic replacement protocol that verifies the source has not changed before replacing it.

**L2** (blocking): Conversion uses one predictable staging file without coordinating with other processes that share the cache. *When:* If two game processes convert the same old notes file at once, both open the same .packing file with truncation and write through separate handles. One can rename it over the original while the other is still writing, leaving the packed notes corrupted or incomplete. **Do:** Serialize conversion across processes or use unique staging files and an atomic replacement protocol that verifies the source has not changed before replacing it.
@ -2610,3 +2656,3 @@
if (!note_file) notes_open_locked(nullptr);
if (!note_file || !note_new_locked(key)) return false;
fwrite(rec.get(), sizeof(PipeNote), 1, note_file), fflush(note_file);
if (note_file_packed) note_pack::write_record(note_file, (const uint8_t*)rec.get(), sizeof(PipeNote));
Member

L3 (blocking): A failed packed-record write is ignored after the key has been marked as noted, and subsequent records are still appended.

When: If the disk fills partway through a record and space later becomes available during the same run, later notes are appended after the incomplete body. Readers stop at the damaged record or consume part of a later one, so those later pipelines are not recovered at the next start.

Do: Check the write and flush results, stop appending or roll back to the last complete record on failure, and do not report the key as successfully recorded.

**L3** (blocking): A failed packed-record write is ignored after the key has been marked as noted, and subsequent records are still appended. *When:* If the disk fills partway through a record and space later becomes available during the same run, later notes are appended after the incomplete body. Readers stop at the damaged record or consume part of a later one, so those later pipelines are not recovered at the next start. **Do:** Check the write and flush results, stop appending or roll back to the last complete record on failure, and do not report the key as successfully recorded.
@ -14478,0 +14543,4 @@
auto full = std::make_unique<PipeNote>();
std::vector<uint8_t> scratch;
for (int64_t at = 16; packed;) {
if (_fseeki64(f, at, SEEK_SET)) break;
Member

L4 (blocking): Update the existing source-cut checks for the changed readers and add behavioral coverage for the packed format.

When: test_note_refs_once expects three seek calls in the extracted reader, but the packed loop adds a fourth; its fixture rejects the changed function before testing. Other extracted fixtures also lack the new packing dependencies.

Do: Update the affected fixtures without weakening their existing cases, and add game-free round-trip, conversion, damaged-record, partial-tail and write-failure cases that exercise the real implementation.

**L4** (blocking): Update the existing source-cut checks for the changed readers and add behavioral coverage for the packed format. *When:* test_note_refs_once expects three seek calls in the extracted reader, but the packed loop adds a fourth; its fixture rejects the changed function before testing. Other extracted fixtures also lack the new packing dependencies. **Do:** Update the affected fixtures without weakening their existing cases, and add game-free round-trip, conversion, damaged-record, partial-tail and write-failure cases that exercise the real implementation.
HumanBean force-pushed perf/note-pack from a95f7d7d65
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
to 83adeeb6ae
Some checks failed
PR description / Title and description (pull_request_target) Failing after 4s
2026-12-02 20:28:10 +00:00
Compare
HumanBean force-pushed perf/note-pack from 83adeeb6ae
Some checks failed
PR description / Title and description (pull_request_target) Failing after 4s
to 355a203bc9
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
2026-12-02 20:59:27 +00:00
Compare
Author
Owner

All four blocking points are addressed in the new head.

  • L1 (a failed scan must not truncate): note_pack::walk now says how it ended. cut_tail resizes only for a part record or a length no record has; on a read or seek failure the file is left as it is and nothing is added to it.
  • L2 (concurrent conversion): each conversion stages to a name of its own and renames only if the source's size and write time are unchanged. A note appended between that check and the rename can still be lost; it is noted again when its pipeline is next met in play.
  • L3 (failed writes): note_pack::append checks the write and flush, closes and cuts back to the last whole record; the key is not kept as noted and nothing more is added that run.
  • L4 (checks): the three source-cut checks are updated with their existing cases kept, and tests/test_note_pack.py covers round trips, damaged records, the partial tail, conversion and a failed write.
  • L5, L6: size, conversion time and the start's walk are in Measurements; the in-game run on Linux is in Testing (it found, and the head fixes, a conversion skipped during preparation). Windows and Steam Deck are still to test.

🤖 Generated with Claude Code

All four blocking points are addressed in the new head. - **L1** (a failed scan must not truncate): `note_pack::walk` now says how it ended. `cut_tail` resizes only for a part record or a length no record has; on a read or seek failure the file is left as it is and nothing is added to it. - **L2** (concurrent conversion): each conversion stages to a name of its own and renames only if the source's size and write time are unchanged. A note appended between that check and the rename can still be lost; it is noted again when its pipeline is next met in play. - **L3** (failed writes): `note_pack::append` checks the write and flush, closes and cuts back to the last whole record; the key is not kept as noted and nothing more is added that run. - **L4** (checks): the three source-cut checks are updated with their existing cases kept, and `tests/test_note_pack.py` covers round trips, damaged records, the partial tail, conversion and a failed write. - **L5, L6**: size, conversion time and the start's walk are in Measurements; the in-game run on Linux is in Testing (it found, and the head fixes, a conversion skipped during preparation). Windows and Steam Deck are still to test. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
HumanBean merged commit 7d5f971833 into mod-api 2026-12-02 21:06:21 +00:00
HumanBean deleted branch perf/note-pack 2026-12-02 21:06:21 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot!3027
No description provided.