GPU: register pipeline demand after asynchronous compilation timeout #1642
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1643"
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?
Imported from Marvisak/VIctory. Originally posted by santiago-andreiu on 2026-11-24T20:19:50Z.
<html>
Problem
Pipeline demand is currently recorded only when
ready()returns a successfully compiled pipeline.When a draw or dispatch exceeds the 500 ms waiting budget and the compilation worker completes afterward, the pipeline may never be registered in the early pipeline list unless another rendering operation requests it.
This can cause the same compilation delay to recur in subsequent runs.
Root Cause
Rendering demand and asynchronous compilation completion were not tracked independently. A successful compilation occurring after the waiting budget expired could therefore remain unregistered.
Implementation
Introduce independent atomic event tracking using
AtomicU8:REQUESTED: actual rendering demand has occurred.COMPILED: pipeline compilation has completed successfully.The operation that adds the second distinct event registers the pipeline through
note_used().This approach:
Supports either event ordering.
Prevents duplicate registration per
Pendinginstance.Excludes purely speculative warmups.
Excludes unsuccessful compilations.
Preserves pipeline publication through
OnceLock.Preserves the existing waiting budget, cache format and retention policy.
Modified Files
crates/victory-gpu/src/pipeline/make.rscrates/victory-gpu/src/pipeline/library.rsRegression Tests
Four CPU-only regression tests were added:
late_success_registers_demand_without_a_second_drawwarmup_registers_only_on_real_demand_and_only_oncefailed_compilation_never_registers_demanddemand_and_compilation_on_separate_threads_register_onceThe late-completion regression test was confirmed to fail before the correction and pass afterward.
Validation
Check | Result -- | -- Default GPU tests | 54 passed, 0 failed, 1 ignored GPU tests with all features | 57 passed, 0 failed, 1 ignored Workspace Clippy, default features | Passed Workspace Clippy, all features | Passed Repository asset policy | Passed Git diff check | PassedExisting rustfmt discrepancies were reproduced on the original code and were intentionally left unchanged.
Testing Environment
CPU: Intel Core i5-12600KF
GPU: NVIDIA GeForce RTX 3060 12 GB
RAM: 20 GB
OS: Windows x64
Known Limitations
This change does not recover rendering operations already discarded after a timeout.
A worker completing after the final cache snapshot during process termination may still produce a registration that is not persisted. Shutdown synchronization is intentionally outside the scope of this contribution.
No in-game rendering or performance improvements have been measured.
Related Work
PR #983 addresses the retention policy of the early pipeline list. This contribution addresses when successfully compiled pipelines become eligible for registration.
The changes are intended to complement each other.
Development Disclosure
Development and testing were assisted by OpenAI Codex. No proprietary game assets were used.
</html>Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T20:26:15Z.
Review: APPROVED
Verified locally merged onto
origin/main(Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):cargo test -p victory-gpu— 54 passed, 0 failed (1 ignored) on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(including the 4 new pipeline demand-registration tests)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— okClean state-machine handling so late async pipeline compilations register demand once without requiring a second draw and without false registration on warmup or failure. Looks good.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:19:54Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Pipeline demand registered after asynchronous creation: keys of successfully built pipelines requested by draws/dispatches feed early-start listing. 4 tests in make.rs/library.rs. Windows-only.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:22:39Z.
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Already in main, and more: ready() lists a pipeline for an early start at its first use whether or not it was made in time (make.rs). Body is pasted HTML.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:33:05Z.
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-gpu/src/pipeline/library.rs,crates/victory-gpu/src/pipeline/make.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
Pull request closed