GPU: add opt-in VICTORY_BURY_LAG for delayed resource retirement #3473
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!3473
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3473"
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?
@pushkarreddyy on GitHub · 2026-11-27 04:34 UTC · original
pushkarreddyy:perf/gpu-bury-lag→main· +96 −10 · 1 files · 1 commits · openSummary
Adds opt-in
VICTORY_BURY_LAG(default0) to delay releasingretired hostID3D12Resourceobjects forNadditional completed submissions via aVecDequelag queue incrates/victory-gpu/src/host.rs.Motivation
By default (
VICTORY_BURY_LAG=0),release_retired()continues to release retired host resources immediately after the completed submission, preserving existing memory behavior. WhenVICTORY_BURY_LAG=Nis set, retired resources remain alive forNextra submissions beforerelease_laterdrops them on the background release thread, helping diagnose or avoid late GPU reads when title threads rewrite descriptors across submissions.Changes
crates/victory-gpu/src/host.rs:bury_lag()readingVICTORY_BURY_LAG(default0).RETIRED: Mutex<Vec<ID3D12Resource>>withRetired<T>(pending: Vec<T>,lagging: VecDeque<Vec<T>>) andRetired::drain_ready(lag).retireandrelease_retiredto respectbury_lag().retired_resources_release_immediately_when_lag_is_zeroandretired_resources_wait_for_bury_lag_submissions.Testing & Verification
lag = 0andlag > 0behavior.VICTORY_BURY_LAG=64as well as default0.No game files used.
AI-assisted: yes (Gemini 4 Neon)
@oni-swr on GitHub · 2026-11-27 04:46 UTC · original
WARP test report (
victory-gpu,--features diagnostics --lib --locked --no-fail-fast -- --test-threads=1)OS: Windows 11 Pro 10.0.26200 (build 26200.9974), x64
Host adapter: WARP only (VICTORY_WARP=1 and VICTORY_D3D12_WARP=1; d3d10warp.dll 10.0.26100.9818); no physical GPU used.
victory-gpuonly honoursVICTORY_D3D12_WARPwith thediagnosticsfeature, so the run uses it; a test that prints its adapter reported "Microsoft Basic Render Driver".dxil.dll: Windows SDK 10.0.26100.0, version 1.8.2502.11 (via VICTORY_DXIL)
rustc/cargo: 1.98.1 (48a229cea 2026-09-01)
Base: main
63bcca43c6Head:
d611cfaf13(fast-forwards onto main, no conflicts, 1 file)host::present_plane_tests::retired_resources_release_immediately_when_lag_is_zero,host::present_plane_tests::retired_resources_wait_for_bury_lag_submissions. They test the queue with plain integers, not real resources. No other test changed result.Review note (diff read):
bury_lag()is 0 whenVICTORY_BURY_LAGis unset or does not parse. With 0,drain_readyreturns the pending resources as one batch and the lagging queue stays empty, so what is released and when is the same as before (the only change is thatrelease_laternow gets aVecof batches instead of aVecof resources, which is dropped the same way).OnceLock), so changing it needs a restart. Theretirereformat is whitespace only.AI-assisted (Claude). Aggregate counts only; no game files used.
@pushkarreddyy on GitHub · 2026-11-27 05:17 UTC · original · edited 2026-11-27 06:54 UTC
@oni-swr Thank you for the WARP verification (
248 passed, 0 failed, 1 ignored) and diff review!@Marvisak Please review and merge this PR when convenient (CI is green). Testers on untested GPU models and drivers are welcome to test both default
VICTORY_BURY_LAG=0andVICTORY_BURY_LAG=64.AI-assisted: yes (Gemini 4 Neon)
@cloph-dsp on GitHub · 2026-11-27 09:30 UTC · original
Independent verification of PR #3473 (CPU-only, synthetic inputs, no game data).
Windows / Rust 1.100.0 / MSVC, per-worktree CARGO_TARGET_DIR=D:\Victory-Contrib\target-3473-verify, CARGO_BUILD_JOBS=2.
Head
d611cfa, base/merge base63bcca4. The two new tests are gated by#[cfg(all(test, feature = "diagnostics"))]in crates/victory-gpu/src/host.rs (modulehost::present_plane_tests), so the feature flag and the full module path are required.Commands and results:
cargo test --locked -p victory-gpu --lib --features diagnostics -- host::present_plane_tests::retired_resources_release_immediately_when_lag_is_zero --exact --test-threads=1 --quiet-> 1 passed, 0 failed, 248 filtered, exit 0.cargo test --locked -p victory-gpu --lib --features diagnostics -- host::present_plane_tests::retired_resources_wait_for_bury_lag_submissions --exact --test-threads=1 --quiet-> 1 passed, 0 failed, 248 filtered, exit 0.git grep -F <test name> 63bcca4 -- crates/victory-gpu/src/host.rs-> no hits (both tests new on this PR).git diff --check 63bcca4 HEAD-> clean.Notes: only the two named synthetic tests were replayed; full crate suite not run. Only pre-existing
fetch_updatedeprecation warnings. GPU/driver N/A for these CPU-only tests. AI-assisted (Hy4 flash). No game data or extracted assets used.@futurepro62 on GitHub · 2026-11-27 10:35 UTC · original
NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head
d611cfa(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 866 passed, 0 failed, 10 ignored.retired_resources_release_immediately_when_lag_is_zero,retired_resources_wait_for_bury_lag_submissionsonly build with thediagnosticsfeature, so the run above doesn't include them; they pass incargo test -p victory-core -p victory-gpu -p victory-hle -p victory-loader -p victory-shader -p victory --lib --locked --features victory-core/diagnostics,victory-gpu/diagnostics,victory-hle/diagnostics,victory-loader/diagnostics,victory-shader/diagnostics,victory/diagnostics(same skips).--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.