test(gpu): honor VICTORY_D3D12_WARP in alias_rt D3D12 test #1887
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1887"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by steven-seagull27 on 2026-11-29T01:31:18Z.
What it changes
Fixes D3D12 aliasing-barrier over-emission (and missing intra-list handoffs) for physical-page aliased transient render targets introduced in
6ba7fa8(VICTORY_ALIAS_TARGETS=1):host.rs):HostList::prelude()previously pushed aD3D12_RESOURCE_BARRIER_TYPE_ALIASING(NULL -> resource) for every aliased RT instates, even when the list only read the RT (PIXEL_SHADER_RESOURCE,NON_PIXEL_SHADER_RESOURCE,COPY_SOURCE,DEPTH_READ). Under D3D12 aliasing rules, an aliasing barrier targeting an RT/DSV invalidates its prior contents and compression metadata until re-initialized viaClear*/DiscardResource/Copy*, causing read-after-write corruption across command lists.host.rs,alias_rt.rs):HostList::transition()previously emittedALIASING(NULL -> resource)on every intra-list transition of an aliased RT into a write state even when no other aliased resource touched its physical pages in between (e.g.,RTV -> SRV -> RTVor cross-list multi-pass blending).alias_rt.rs,resource.rs,host.rs):HostTexturenow carries its coalesced physicalAliasFootprint(section+ sorted(start_page, count)runs) instead of a barebool.ListAliasTracker(perHostList, cleared onHostList::reset()) tracks touched physical page spans during recording:ALIASING(NULL -> resource)barrier immediately (including when the new alias isVacantinstatesor re-enters the same write state).HostList::prelude(),alias_rt::resolve_prelude()checks prelude candidates against the global per-sectionOwnerTable(cleared onsection_gone()), emitting a prelude aliasing barrier only when any page is currently owned by a different resource, and advances global ownership with the list's writes. Read-only lists skip locking globalalias_rtstate altogether.How it was tested
--locked). Synthetic unit and D3D12 hardware tests only (no game files or assets).ALIASING(NULL -> resource)barrier regardless of read/write state or active page owner, and every intra-list write transition on the same resource emitted another aliasing barrier while first-use intra-list alias handoffs (Vacantinstates) emitted none inside the list.cargo test --locked -p victory-gpu --lib -- alias_rt --nocapture: 6 passed, 0 failed, including 4 new ownership/handoff unit tests (read_only_list_emits_no_aliasing_barrier,same_resource_rmw_emits_no_spurious_aliasing_barrier,cross_list_and_partial_overlap_handoffs_emit_prelude_barrier,intra_list_read_then_alias_write_defers_barrier_past_read) and a synthetic D3D12 hardware test (aliased_rt_read_after_write_and_handoff_on_d3d12) exercising two64x64 R8G8B8A8_UNORMreserved RTs aliased onto the same 64 KiB Tier-2 heap tile across read-after-write, cross-list handoff, and intra-list read-then-alias-write command lists with pixel readback verification.cargo test --locked -p victory-gpu --lib -- --test-threads=1: 594 passed, 0 failed, 44 ignored.cargo clippy --locked -p victory-gpu --lib --tests: zero warnings in touched code (alias_rt.rs, modified hunks inhost.rsandresource.rs).cargo testpassed for the crates it touches: yes (victory-gpu).Checked for overlap
alias_rtphysical-page ownership or fixHostList::prelude()/transition()aliasing barriers).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by upipibi on 2026-11-29T03:17:50Z.
Test report for #1887 (head
bf8a6d6b), merged--no-ffonto main568c5e5d. Synthetic tests only: no title run, nogame files.
Setup: RTX 3070, driver 616.56, Windows 11 (10.0.26100), rustc 1.98.1. Every run logged the GPU and driver from
nvidia-smibefore it started.alias_rt::tests (-- alias_rt::, 6 tests): all pass, 3/3 runs. That covers the four new ownership/handofftests,
coalesce_runs_merges_contiguous_tile_rangesand the D3D12 test.coalesce_runs_merges_contiguous_tile_rangesare CPU-only.aliased_rt_read_after_write_and_handoff_on_d3d12reaches the device.D3D12CreateDevice(None, ...)).is below 2.
resource heap tier 2 and tiled resources tier 4, and every pixel check ran and passed. So these passes are real
runs, not skips.
VICTORY_D3D12_WARP=1 --features diagnostics. The D3D12 test doesnot read that switch: it ran on the RTX 3070 each time and passed. There is no WARP coverage of this test as
written.
Negative control:
ListAliasTracker::resolve_preludeno longer asks for any prelude aliasing barrier. 3 of the 6tests fail, the same with and without the switch above:
cross_list_and_partial_overlap_handoffs_emit_prelude_barrier(alias_rt.rs:827):[]instead of[2];intra_list_read_then_alias_write_defers_barrier_past_read(alias_rt.rs:864):[]instead of[100];aliased_rt_read_after_write_and_handoff_on_d3d12(alias_rt.rs:1119):[]instead of[1]. That is the test'sown check of the tracker's output for the cross-list handoff, before list 3 is recorded. So it stops there and
does not show what the missing barrier would do to pixels on this card.
The other three (read-only list, same-resource read-modify-write, coalescing) still pass, as expected: none of them
needs a prelude barrier.
cargo test -p victory-gpu --lib --locked568c5e5d--features diagnosticsThe five extra tests are the PR's own.
Not tested: the effect in a title.
Tested with the help of Claude Code (Claude Opus 5.5).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by amazedturnip on 2026-11-29T05:38:56Z.
Tested on RTX 5070 Ti 16 GB across 20+ min sessions (Series X 1440p DLSS). Physical-page ownership tracking for alias_rt D3D12 aliasing barriers ran cleanly with zero RT/render-target artifacts or D3D12 issues.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by steven-seagull27 on 2026-11-29T08:06:09Z.
Thanks @upipibi and @amazedturnip for the independent verifications!
Pushed follow-up commit
1267309addressing @upipibi's WARP coverage note:alias_rt::tests::aliased_rt_read_after_write_and_handoff_on_d3d12now honorsVICTORY_D3D12_WARP=1viainplace::tests::warp()(serialized underindirect::tests::warp_turn()) and logs whether it ran or skipped with itswarp,heap_tier, andtiled_tiervalues under--nocapture.Verified locally (Windows 11 x64, Rust 1.98.1 MSVC,
--locked):alias_rt D3D12 test running: warp=false heap_tier=2 tiled_tier=4-> 6/6 passedVICTORY_D3D12_WARP=1:alias_rt D3D12 test running: warp=true heap_tier=2 tiled_tier=3-> 6/6 passed (default and--features diagnostics)Synthetic tests only.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-29T08:28:35Z.
Thank you! An earlier version of this pull request was merged into main with its original commits and is part of v2026.11.29.01, where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by steven-seagull27 on 2026-11-29T08:34:21Z.
Since
bf8a6d6already merged intomainviaa332fa37, this PR is now rebased onto829188e9with just the 1-commit WARP test follow-up (e73807c6):warp=false heap_tier=2 tiled_tier=4):alias_rt6/6 passedVICTORY_D3D12_WARP=1,warp=true heap_tier=2 tiled_tier=3):alias_rt6/6 passedSynthetic tests only.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by upipibi on 2026-11-29T23:12:11Z.
Re-check of the WARP follow-up at head
e73807c6on RTX 30. Synthetic tests only: no title run, no game files.Setup: RTX 3070, driver 621.40, Windows 11 (10.0.26100), rustc 1.98.1.
cargo test -p victory-gpu --lib --locked alias_rt:: -- --nocapture, 3 runs on the card and 3 withVICTORY_D3D12_WARP=1.alias_rt D3D12 test running: warp=false heap_tier=2 tiled_tier=4VICTORY_D3D12_WARP=1, 3/3alias_rt D3D12 test running: warp=true heap_tier=2 tiled_tier=3So the variable now reaches
aliased_rt_read_after_write_and_handoff_on_d3d12: it runs on WARP when asked and on the card otherwise, and neither run printed theskippedline. That closes the WARP note in my earlier report. Therunning:line is a good addition, since it shows which device a pass came from.Tested with the help of Claude Code (Claude Fable 5.2).
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.