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

Open
fromthemoonx wants to merge 1 commit from upstream-pr/603 into main
fromthemoonx commented 2026-12-04 15:21:54 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by fromthemoonx on 2026-12-04T15:21:54Z.


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

<!-- greyfinch-sync:readmet3xt-lab/foxhound:issue:5649165368 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/603). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-04T15:21:54Z. --- 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)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/603:upstream-pr/603'
git switch 'upstream-pr/603'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/603'
git switch 'upstream-pr/603'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/603'
git switch 'upstream-pr/603'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/603'
git switch 'main'
git merge --squash 'upstream-pr/603'
git switch 'main'
git merge --ff-only 'upstream-pr/603'
git switch 'main'
git merge 'upstream-pr/603'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
readmet3xt-lab/foxhound!603
No description provided.