Pipeline record: one that cannot be read is not taken for an empty one #603

Open
github-bot wants to merge 1 commit from github-bot/gh-603 into main AGit
Owner

@⁠fromthemoonx on GitHub · 2026-12-04 15:21 UTC · original
fromthemoonx:fix/unreadable-pipeline-record → main · +152 −53 · 3 files · 1 commits · open

Closes #74.

The fault

A failed read of known-pipelines.bin or known-shaders.bin was taken for a file whose whole entries end at 0.

  • victory warm knew no pipelines and did not say why (#74).
  • open_record cuts a torn end off at that place. So where the file could not be read but could be opened for writing, it was cut to nothing. Seed::open (a title profile's list) and a run with VICTORY_PIPELINE_BOOK=1 both go through it.
  • With only the shaders' file lost, the pipelines' keys are still in the record, so their shaders are not written down again (from reading note and Seed::open).

victory warm on a made-up record, one file held by a handle that shares writing but not reading (Windows error 32), with a list given in VICTORY_PIPELINE_LIST:

file held main (5e44415b) this PR
known-pipelines.bin exit 0, "0 pipelines known"; 110 bytes before, 55 after (the one entry the list had) exit 1, names the file and the error; unchanged
known-shaders.bin exit 0; 50 bytes before, 0 after names the file and the error, adds nothing; unchanged

How often this happens to players I can't say; it takes a read that fails at that moment.

The change

  • Reading the record gives an error that names the file. A missing file is still a first run, and a torn end is still cut off.
  • Nothing is cut off unless both files were read.
  • A run that cannot read the record warns and adds nothing to it. victory warm and title-profile pipelines say what failed. The launcher starts the game after a failed warm as before; the reason is in prepare.log.
  • A warm child process that cannot read the record ends with an error once its other threads are done. The warm then stops with its existing message and counts no pipeline bad. It used to end well, having made nothing.

#87 did the first part for the pipelines' file. #589 also changes Seed::open to io::Result; the two conflict in known.rs, and I'm glad to rebase whichever way round they land.

Tested

b93dc5aa on Windows 11, RTX 3060 12 GB, Ryzen 7 5700X, 16 GB RAM:

  • cargo test --workspace --locked: 1402 passed, 0 failed, 51 ignored (main: 1400, 0, 51).
  • Two new tests: a missing record, and either file held, with and without a torn end. The second fails when read errors count as "no file", and when open_record takes a failed read of either file as 0.
  • Both of CI's Clippy commands and cargo xtask policy: clean.
  • The victory warm runs above, and one with known-shaders.bin held and pipelines to make (debug builds).

Not tested

  • In a game, or with a real record. The run's own warning (VICTORY_PIPELINE_BOOK=1) is covered only through open_record.
  • A read that fails in the middle of a file (a disk error).

AI use

Written and tested with Claude Code (Claude Opus 5.5).

🤖 Generated with Claude Code

**@⁠fromthemoonx** on GitHub · 2026-12-04 15:21 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/603) `fromthemoonx:fix/unreadable-pipeline-record` → `main` · +152 −53 · 3 files · 1 commits · open Closes #74. ## The fault A failed read of `known-pipelines.bin` or `known-shaders.bin` was taken for a file whose whole entries end at 0. - `victory warm` knew no pipelines and did not say why (#74). - `open_record` cuts a torn end off at that place. So where the file could not be read but could be opened for writing, it was cut to nothing. `Seed::open` (a title profile's list) and a run with `VICTORY_PIPELINE_BOOK=1` both go through it. - With only the shaders' file lost, the pipelines' keys are still in the record, so their shaders are not written down again (from reading `note` and `Seed::open`). `victory warm` on a made-up record, one file held by a handle that shares writing but not reading (Windows error 32), with a list given in `VICTORY_PIPELINE_LIST`: | file held | `main` (`5e44415b`) | this PR | |---|---|---| | `known-pipelines.bin` | exit 0, "0 pipelines known"; 110 bytes before, 55 after (the one entry the list had) | exit 1, names the file and the error; unchanged | | `known-shaders.bin` | exit 0; 50 bytes before, 0 after | names the file and the error, adds nothing; unchanged | How often this happens to players I can't say; it takes a read that fails at that moment. ## The change - Reading the record gives an error that names the file. A missing file is still a first run, and a torn end is still cut off. - Nothing is cut off unless both files were read. - A run that cannot read the record warns and adds nothing to it. `victory warm` and `title-profile pipelines` say what failed. The launcher starts the game after a failed `warm` as before; the reason is in `prepare.log`. - A `warm` child process that cannot read the record ends with an error once its other threads are done. The warm then stops with its existing message and counts no pipeline bad. It used to end well, having made nothing. #87 did the first part for the pipelines' file. #589 also changes `Seed::open` to `io::Result`; the two conflict in `known.rs`, and I'm glad to rebase whichever way round they land. ## Tested `b93dc5aa` on Windows 11, RTX 3060 12 GB, Ryzen 7 5700X, 16 GB RAM: - `cargo test --workspace --locked`: 1402 passed, 0 failed, 51 ignored (`main`: 1400, 0, 51). - Two new tests: a missing record, and either file held, with and without a torn end. The second fails when read errors count as "no file", and when `open_record` takes a failed read of either file as 0. - Both of CI's Clippy commands and `cargo xtask policy`: clean. - The `victory warm` runs above, and one with `known-shaders.bin` held and pipelines to make (debug builds). ## Not tested - In a game, or with a real record. The run's own warning (`VICTORY_PIPELINE_BOOK=1`) is covered only through `open_record`. - A read that fails in the middle of a file (a disk error). ## AI use Written and tested with Claude Code (Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A failed read of known-pipelines.bin or known-shaders.bin counted as a file
whose whole entries end at 0. `victory warm` then knew no pipelines without
saying why, and `open_record`, which cuts a torn end off, cut the file to
nothing where it could still be opened for writing.

Reading the record gives an error that names the file, except when there is
none (a first run). Nothing is cut off or added to a record that was not read:
a run warns and keeps no record, `victory warm` and `title-profile pipelines`
say what failed. A process of the warm that cannot read it ends with an error
once its other threads are done, so that no pipeline is counted bad for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 15:25:22 +00:00
github-bot force-pushed github-bot/gh-603 from c28c60d63c to b93dc5aab0 2026-12-04 15:56:54 +00:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/603/head:github-bot/gh-603'
git switch 'github-bot/gh-603'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-603'
git switch 'github-bot/gh-603'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-603'
git switch 'github-bot/gh-603'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-603'
git switch 'main'
git merge --squash 'github-bot/gh-603'
git switch 'main'
git merge --ff-only 'github-bot/gh-603'
git switch 'main'
git merge 'github-bot/gh-603'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.