GPU: a save before the early list was loaded leaves the early list file alone #2324

Closed
denkencar-sketch wants to merge 1 commit from upstream-pr/2326 into main
denkencar-sketch commented 2026-11-25 10:42:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by denkencar-sketch on 2026-11-25T10:42:31Z.


Summary

save() read the early-list state directly, so a save made before the early list was loaded wrote that file empty and erased the keys earlier runs had recorded. early_text now leaves the file alone when the list was not loaded.

Testing

Test an_unloaded_early_list_is_not_written_empty fails if the unloaded case writes an empty list and passes with this change. It tests early_text, not the file write in save().

cargo test --workspace --locked passes apart from known flakes: modules::dstorage::tests::a_page_list_filled_after_its_request_starts fails now and then on main too, and so does a parallel-run flake in victory-gpu's lib tests (watch:: and descriptor::host:: tests, 2 of 40 runs on pristine main).

This touches save() like #2327 and #2328 do: they conflict textually only in adjacent test blocks in library.rs. Not tried: a run in the game.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6602635925 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2326). Originally posted by [denkencar-sketch](https://github.com/denkencar-sketch) on 2026-11-25T10:42:31Z. --- ## Summary `save()` read the early-list state directly, so a save made before the early list was loaded wrote that file empty and erased the keys earlier runs had recorded. `early_text` now leaves the file alone when the list was not loaded. ## Testing Test `an_unloaded_early_list_is_not_written_empty` fails if the unloaded case writes an empty list and passes with this change. It tests `early_text`, not the file write in `save()`. `cargo test --workspace --locked` passes apart from known flakes: `modules::dstorage::tests::a_page_list_filled_after_its_request_starts` fails now and then on `main` too, and so does a parallel-run flake in `victory-gpu`'s lib tests (`watch::` and `descriptor::host::` tests, 2 of 40 runs on pristine `main`). This touches `save()` like #2327 and #2328 do: they conflict textually only in adjacent test blocks in `library.rs`. Not tried: a run in the game. AI-assisted.
catminou4 commented 2026-11-25 11:04:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:54:09Z.

Review: COMMENTED


A save before the early list was loaded leaves the early file alone (early_text Some/None split). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Pipeline-library save cluster with #2327/#2328 (and #2232 earlier).

<!-- greyfinch-sync:Marvisak/VIctory:review:6056244714 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2326#pullrequestreview-6056244714). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T10:54:09Z. **Review:** COMMENTED --- A save before the early list was loaded leaves the early file alone (early_text Some/None split). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Pipeline-library save cluster with #2327/#2328 (and #2232 earlier).
Marvisak commented 2026-11-25 16:09:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:20:26Z.


Automated triage for the maintainers.

Proposed close. The case this guards against cannot happen on main. In crates/victory-gpu/src/pipeline/library.rs, save() returns early unless added, prebuilt_changed or USED_CHANGED is set, and each of those is only set after USED has been loaded:

  • every title pipeline reaches the workers through make::early, which calls wanted_early and so used(), or through make::ready, which calls note_used before anything is made;
  • the pre-build calls keep_early_list() before it builds anything, and its doc comment says it exists so that a save keeps the list.

So when save() writes, USED is always Some, and the new early_text(None) branch never runs; the added test exercises only the helper, not a reachable path. A call sequence on main where a save writes the early list while USED is None would change this verdict. CI: passing.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166687478 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2326#issuecomment-7166687478). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:20:26Z. --- <!-- victory-triage v1 head=b0fe5f0fe002389070656d789891c610fd9abfd9 verdict=proposed-close at=2026-11-25T15:27:00Z --> Automated triage for the maintainers. **Proposed close.** The case this guards against cannot happen on `main`. In `crates/victory-gpu/src/pipeline/library.rs`, `save()` returns early unless `added`, `prebuilt_changed` or `USED_CHANGED` is set, and each of those is only set after `USED` has been loaded: - every title pipeline reaches the workers through `make::early`, which calls `wanted_early` and so `used()`, or through `make::ready`, which calls `note_used` before anything is made; - the pre-build calls `keep_early_list()` before it builds anything, and its doc comment says it exists so that a save keeps the list. So when `save()` writes, `USED` is always `Some`, and the new `early_text(None)` branch never runs; the added test exercises only the helper, not a reachable path. A call sequence on `main` where a save writes the early list while `USED` is `None` would change this verdict. CI: passing. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-26 00:01:52 +00:00
denkencar-sketch commented 2026-11-26 00:03:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by denkencar-sketch on 2026-11-25T23:12:09Z.


Closing per triage: \save()\ only writes after \USED\ has already been loaded on \main, so \early_text(None)\ is unreachable.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177260069 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2326#issuecomment-7177260069). Originally posted by [denkencar-sketch](https://github.com/denkencar-sketch) on 2026-11-25T23:12:09Z. --- Closing per triage: \save()\ only writes after \USED\ has already been loaded on \main\, so \early_text(None)\ is unreachable.

Pull request closed

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
Marvisak/VIctory!2324
No description provided.