GPU: a full early pipeline list drops the oldest runs' keys #983
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!983
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/983/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@LICObr on GitHub · 2026-11-24 14:39 UTC · original
LICObr:gpu/early-pipelines-most-recent→main· +50 −13 · 1 files · 1 commits · merged 2026-11-25 21:49 UTCProblem
Used::listkeeps this run's keys first, then earlier runs' others, cut toEARLY_MAX(8,192). The earlier keys come from aHashSet, so once the list is full, the keys that make room are any earlier keys, not the oldest ones. A key the last run drew with can go while one unused for many runs stays. That key's pipeline is then not started early and compiles on first use.A smaller one:
savereadsUSEDdirectly, not throughused(). If a save runs before anything in this run read the list, it writes an empty list over the saved one.keep_early_listcovers the pre-build; the fix below covers every caller.Change
Used::beforekeeps each earlier key with its place in the list as loaded (HashMap<String, usize>). The list is already saved this run first, so sorting earlier keys by that place gives most recent first. A full list then drops the oldest runs' keys, and the order carries across saves.Used::read.savereads the list throughused().Verification
a_full_early_list_drops_the_oldest_runs_keys: it fills the list from a saved file, uses 10 new keys plus the oldest key again, and checks three things. The 10 keys that go are exactly the oldest ones not used again, the key used again stays, and the order holds after a save and read back. Against the currentmainbehaviour, this test fails.the_early_list_keeps_this_run_first(existing) still passes.cargo clippy -p victory-gpu --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, with and without--all-features: clean.Not exercised in a game run: no game files were used.
@Zipettte on GitHub · 2026-11-24 14:55 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 486b54e:
cargo test -p victory-gpupasses, 52 passed / 0 failed. Workspace baseline on main (ffe310e) was green on the same machine (342 passed).Tested with AI assistance (Claude).
@MichaelSmithAI on GitHub · 2026-11-24 15:01 UTC · original
We checked the save-before-first-use case through
save_pipeline_cache()on an RTX 4090 under Wine/vkd3d-proton 3.2. A temporary cache started with two legacy keys,aaaaandbbbb. After creating a compute PSO, the first save preserved both keys at run 0. Afterready()marked the new pipeline used, a second save placed its key first at run 1 and kept both older entries.Bypassing only the read-before-save step made the first save replace the list with an empty file. Both builds included #844’s empty-library fix so the Wine backend could create and save the host library. This comparison covers preservation and promotion through the save API. Game startup timing remains unmeasured.
@Marvisak on GitHub · 2026-11-25 01:29 UTC · original
Automated triage for the maintainers.
Merge candidate. This closes two gaps in the early pipeline list in
crates/victory-gpu/src/pipeline/library.rs:Used::beforenow keeps each earlier key's place in the loaded list.Used::listsorts earlier keys by that place, so a full list (EARLY_MAX) drops the oldest runs' keys rather than arbitraryHashSetentries. The order carries across saves, and lists saved by older builds still read.savereads the list throughused(), notUSEDdirectly. A save that runs before anything else reads the list no longer overwrites it with an empty one. @MichaelSmithAI reproduced that case throughsave_pipeline_cache().Checked:
used()takes only theUSEDlock, so calling it fromsaveadds no lock-order problem.wanted_earlymoves tocontains_keywith no change in behaviour. The new testa_full_early_list_drops_the_oldest_runs_keysasserts the intended eviction order, not just the current output. The PR merges cleanly with currentmain, including the concurrent-load changes to the same file.CI: no check runs on the head commit. A reviewer reports
cargo test -p victory-gpupassing on an RX 7700 XT.Generated by Claude Code