Tests: heap-capped and barrier-less hosts run the GPU tests #2251
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!2251
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2251"
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?
@kotekompotek on GitHub · 2026-11-25 08:51 UTC · original
kotekompotek:tests/capped-view-heap→main· +32 −3 · 3 files · 3 commits · openSummary
Three
victory-gputests fail on a GTX 1050 (SM 6.5) host where they were asserting more than the code guarantees:draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view— expects one host texture, but this host has noID3D12Device10(enhanced barriers), sotakes()refuses the placed view and two textures are the correct layout.memory::tests::a_view_made_for_a_paired_copy_takes_the_pair— same root cause: the test assumed format 42/67 pair views share when the host supports castable formats.descriptor::host::tests::a_view_heap_past_its_dynamic_slots_keeps_the_static_ones(heap cap) — the test requestedHEAP_VIEWSslots, but this host's shader-visible cap (NVIDIA ~1M, related to #2138) is belowHEAP_VIEWS, so the heap falls back; the test now sizes itself against the actual heap.All three now derive the expectation from the host's real capabilities (
Host::enhanced_barriers(), the heap's reported size) instead of assuming them. On a fully capable host nothing changes — same assertions, same values.Test plan
cargo test -p victory-gpu --lockedon GTX 1050 / Win10: 143 passed, 2 ignored, 0 failed (was 140 passed, 3 failed)cargo clippy -p victory-gpu --all-targets --locked -- -D warnings— clean@Dathinel on GitHub · 2026-11-25 09:00 UTC · original · edited 2026-11-25 09:03 UTC
The three changed tests went from 1/3 on
940d32fto 3/3 on91e35f7on my default Windows D3D12 device. With the diagnostics build and VICTORY_D3D12_WARP=1 they passed 3/3 on both revisions.One remaining assumption in the placed-view test: obtaining ID3D12Device10 does not guarantee that CreateCommittedResource3 accepts this particular resource and format list. In resource::make_texture, a creation error clears the list and falls back to a separate texture. I exercised that branch on a Device10-capable host by injecting E_INVALIDARG at that call. The unmodified call passed; forcing the error made the first sharing assertion fail (actual false, expected true), before the pixel checks. This was fault injection, not a naturally occurring driver failure.
Could the test gate the sharing expectation on successful creation for that specific description, while still checking pixels on the fallback path? That would distinguish the two Device10-present outcomes. AI-assisted synthetic verification.
Readback follow-up on the same head: I adjusted the two expectations for the deliberately injected refusal and checked all 4,096 texels of each synthetic image. Both images matched their expected uniform RGBA on the default Windows device and on WARP, with and without refusal. The first format pair used a copy only under refusal; the BC1 pair used a copy in both runs. This narrows the observed failure to the sharing expectation for these fixtures.
@MamaLeVrai on GitHub · 2026-11-25 09:13 UTC · original
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present, so the hardware-only shader checks run. I merged this PR's head
91e35f79intomain940d32fin a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warnings: clean; the same with--all-features: clean.cargo test --workspace --locked: 701 passed, 0 failed, 10 ignored, two runs (mainalone on the same machine: 701 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.AI-assisted (Claude Code); no game data.
@Calvix2k on GitHub · 2026-11-25 09:40 UTC · original
Your three host-derived expectations cover the placed-view test that #2005 was skipping, so I narrowed #2005 to just the one-time log for the missing D3D12 1.7 (the reason
takes()refuses the view without it) and dropped its copy of the test change in83ee34f. No overlap between the two branches now.For the heap-cap case:
HEAP_VIEWSis above the 1,000,000 shader-visible limit on both NVIDIA and this machine's Windows 10 WARP — deriving the heap size is the right fix; the alternative (a skip) would have hidden which cap was hit.@kotekompotek on GitHub · 2026-11-25 09:44 UTC · original
Done, pushed as
519a820: the test no longer predicts sharing fromID3D12Device10at all — it readsa.castable(the listmake_textureclears on a refusedCreateCommittedResource3) and expects one host texture only when the list holds a format of the view's family, mirroringtakes()'s own check. So a Device10 host that refuses the list getscastable.is_empty()→ copy expected → pixel checks still run on the fallback path. Verified locally on the GTX 1050 (no Device10 → empty list → two textures → copy): test passes.@upipibi on GitHub · 2026-11-25 10:26 UTC · original
Ampere run, from a card that fails the two heap-limit tests on every run of
main: RTX 3070 (driver 616.56, Windows 11),519a820againstmain940d32f.main940d32f519a820dynamic_slots_are_held_until_released+lists_share_a_table_and_copies_keep_their_views,--test-threads=1cargo test -p victory-gpu --lockedNo other test changes result here.
AI-assisted (Claude Code). Synthetic tests only.
@Calvix2k on GitHub · 2026-11-25 10:40 UTC · original
One data point for the heap-capped/castable split, since this test is the one that depends on it:
a_texture_written_in_one_format_reads_in_another_through_a_placed_viewexpectsshared = trueand noALIAS_COPIESmovement in round 0, which is only true where the device has castable formats. On Windows 10 19045 / RX 7800 XT, the system runtime (noID3D12Device10) fails it atone host texture(leftfalse), and the same binary with the Agility runtime staged passes — whole suite 147 passed, 0 failed, 2 ignored. So the expectation to derive is "does this device cast formats", not the OS.@Marvisak on GitHub · 2026-11-25 13:31 UTC · original · edited 2026-11-26 07:22 UTC
Automated triage for the maintainers.
Merge candidate.
fae93c4makes the one change the last review asked for. Incrates/victory-gpu/src/draw.rs, the placed-view test now counts the host texture's own format family (GetDesc().Format, with aSAFETYcomment) alongside its castable list. That matchesresource.rstakes(), so the expectation follows what the host actually created. The other changes are unchanged and still right:HostHeap::pair_start(test-only) indescriptor/host.rs, and the capped-heap checks inmemory.rsand in the heap-size test. All three take their expectations from the host instead of assuming an uncapped heap.On your reply: confirmed. This is the own-format case from the second look.
CI:
checkpassing; merges cleanly.Generated by Claude Code
@kotekompotek on GitHub · 2026-11-25 14:11 UTC · original
Thanks — that is exactly the expectation the test now derives:
castable(d.format)on the created texture, so Win10-without-Device10 sees the split and the same binary on Agility sees the share. Good that #2005 was narrowed.@Marvisak on GitHub · 2026-11-25 22:02 UTC · original
Automated triage for the maintainers, second look (a review against
main, with the PR built and tested).Deriving the expectations from the host is right, and this can be merged after one change. The placed-view condition leaves out the texture's own format, which
resource.rstakes()includes; without it,a_texture_written_in_one_format_reads_in_another_through_a_placed_viewfails on an RX 6700 XT (3 runs of 3), and with it, it passes. Incrates/victory-gpu/src/draw.rs:let own = unsafe { a.texture.GetDesc() }.Format.0 as u32; let shared = shared && (crate::resource::family(own) == crate::resource::family(format) || a.castable.iter().any(|&c| crate::resource::family(c) == crate::resource::family(format)));(with aSAFETYcomment).Push the change and it will be reviewed again. Thank you for the contribution.
@kotekompotek on GitHub · 2026-11-26 06:30 UTC · original
Done in
fae93c4: the placed-view check now mirrorstakes()— the host texture's own format family counts alongside the castable list (ownfromGetDesc, with a SAFETY comment).@DenRakEiw on GitHub · 2026-11-25 09:02 UTC · original · approved these changes
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):cargo test -p victory-gpu— 143 passed, 0 failed (2 ignored) on NVIDIA RTX 5090! Directly resolves both NVIDIA 1M view-heap cap test failures onmain940d32f.cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean
pair_start()helper letting heap-capped (NVIDIA) and barrier-less hosts run the fullvictory-gputest suite green. Looks great.AI-assisted (Gemini 4 Neon).
@catminou4 on GitHub · 2026-11-25 09:35 UTC · original · reviewed
Tests: heap-capped and barrier-less hosts run the GPU test suite; pair_start() exposes the capped-heap pair range. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Test-only hardening, good.
@fuzeofficlal on GitHub · 2026-11-26 12:54 UTC · original · approved these changes
Reviewed and verified
fae93c4bmerged locally ontoorigin/main(63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 with its 1M shader-visible view-heap cap and uncapped WARP, Rust1.98.1MSVC, Windows SDK10.0.26100.0dxil.dll; synthetic tests only, no game files).Verification
git merge-treeagainstorigin/main(63bcca43): clean.cargo xtask policy(PR head):182 files ok.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features, PR head and merged): 0 warnings.victory-gpulibrary suite, no--skip):cargo test --locked -p victory-gpu --lib— 231 passed, 0 failed, 1 ignored (resolving both pre-existing NVIDIA 1M view-heap cap test failures onmain).VICTORY_D3D12_DEBUG=1,--features diagnostics, no--skip):descriptor::host::tests,memory::tests,draw::tests— 43 passed, 0 failed.VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1,--features diagnostics— fullvictory-gpulibrary suite): 246 passed, 0 failed, 1 ignored (with the uncapped 2M heap exercisingpair_start() == Some(...)and the full pair-slot range assertion).Review Notes
HostHeap::pair_start()(crates/victory-gpu/src/descriptor/host.rs:377-380) combined with the check incrates/victory-gpu/src/memory.rs:675-677andcrates/victory-gpu/src/descriptor/host.rs:1499-1501is a cleaner solution than skippinglists_share_a_table_and_copies_keep_their_viewsoutright on 1M-capped NVIDIA hosts: the GPU page-table sharing, compute readback, and copy stability assertions still run on RTX 5090, and if a capped-heap sizing fix like#2461lands (givingpairs_end > count + dynamic),pair_start()automatically re-enables the pair-range check.crates/victory-gpu/src/draw.rs:2189-2195, derivingsharedfrom the host texture's ownGetDesc().Formatfamily together witha.castablematchesresource.rs::takes()accurately for both non-Device10hosts andDevice10drivers that refuse a castable list.#2937(descriptor/host.rs,memory.rs) and#2747(draw.rs), so only one per area should be merged.Looks good to merge.
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.