fix(victory-gpu): clear per-list table caches when replaying onto a new host list #433
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!433
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-433"
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?
@mauroalvare on GitHub · 2026-11-26 18:42 UTC · original
mauroalvare:fix/victory-cut-replay-fresh-tables→main· +305 −3 · 2 files · 1 commits · openSummary
Fixes constant-buffer corruption and scratch-buffer lifetime bugs when a title command list is cut onto a new
HostList(list::cutat a memory wait, orlist::value_writtenunderVICTORY_CUT_WRITES=1) and continues recording viadraw::State::replay.When a descriptor table containing a constant buffer (
View::Constant) is prepared on Part 1 (HostList#1),State::tablesallocates a dynamic descriptor slot pointing into Part 1's scratch upload buffer (list1.scratch(...)), scheduleslist1.defer_constants(...), and caches that dynamic slot inState::fresh_tables.Previously,
State::replaydid not clearfresh_tables(norready_tables,seen_tables, orwindow) when switching to Part 2 (HostList#2):fresh_tablesand reused Part 1's dynamic descriptor slot, skippinglist2.scratch(...)andlist2.defer_constants(...).list::detach_partsruns Part 1 first (before Part 2's memory wait is satisfied),list::recyclecallslist1.reset()(returning Part 1's scratch chunks to the globalSPAREpool) or drops Part 1 entirely (when the idle pool is full orVICTORY_LIST_POOL=0) before Part 2 even executes.What changed
draw::State::replay(third_party/victory/crates/victory-gpu/src/draw.rs): Clearfresh_tables,ready_tables,seen_tables, andwindowwhen replaying state onto a newHostListafter a cut. Already-allocated dynamic descriptor slots remain tracked inState::dynamicso Part 1's slots stay alive until the last part finishes.draw::State::dispatch(third_party/victory/crates/victory-gpu/src/draw.rs): Callself.after_our_pass(list)instead ofself.replay(list)afterself.ambient(list, p), since the ambient compute pass runs on the sameHostList(preservingfresh_tablesfor that list while still forcing heaps, root signatures, and PSO to rebind).third_party/victory/crates/victory-gpu/src/draw/cut_tables_tests.rs): Added three synthetic tests exercising real compute shader CBV reads across aState::replaycut (both when Part 1 recycles its scratch chunk and another list overwrites it with0xBAD0F00D, and when Part 1 is dropped before Part 2 runs), plus same-listafter_our_passcache preservation.Reproduction and test results
8e32daa(LooperSalty/AnyXboxX:main)32.0.16.2140), Rust1.98.1.d3d12SDKLayers.dll) is not installed on this machine, so GPU validation checks real shader execution and readback buffers on both RTX 5070 Ti and WARP.Before fix (base
8e32daa+ tests, RTX 5070 Ti)Result: 1 passed, 2 failed:
cut_list_replayed_cbv_table_reads_updated_constants_after_part1_recycles: FAILED — Part 2 reused Part 1's dynamic slot (slot1=64, slot2=64) and the GPU read0xbad0f00d(from another command list that reused Part 1's pooled scratch chunk) instead of0x33334444.cut_list_replayed_cbv_table_survives_dropped_part1: FAILED — Part 2 reused Part 1's dynamic slot (slot1=64, slot2=64) and read stale0xaaaabbbbinstead of0x55667788.After fix (synthetic tests)
cargo test --locked -p victory-gpu draw::cut_tables_tests -- --test-threads=1 --nocaptureVICTORY_D3D12_DEBUG=1 cargo test --locked -p victory-gpu --features diagnostics draw::cut_tables_tests -- --test-threads=1diagnostics)VICTORY_D3D12_WARP=1 VICTORY_D3D12_DEBUG=1 cargo test --locked -p victory-gpu --features diagnostics draw::cut_tables_tests -- --test-threads=1diagnostics)cargo test --locked -p victory-gpu depth_bounds_pipeline_loads_and_filters_draws -- --test-threads=1State::replayGPU test)cargo test --locked -p victory-gpu draw:: -- --test-threads=1drawtests)cargo test --locked -p victory-loader --test load_probehle-probe)cargo xtask policy(inthird_party/victory)cargo clippy --locked -p victory-gpu --testsdraw.rsandcut_tables_tests.rsAI assistance
Developed and verified with AI assistance (Antigravity / Gemini 4 Neon). All code changes, synthetic GPU tests, and local RTX 5070 Ti and WARP runs were inspected and verified on this machine.
a4f706aae8to7fa7e26ac1View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.