GPU tests: assert the heaps and slots a host can make #3242
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3244"
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 HailLucifer666 on 2026-11-26T14:23:28Z.
Fixes #3178.
Both tests assert a descriptor-heap layout no D3D12 device can provide, so they fail on every machine with a GPU and pass on CI only because
HostHeap::newreturnsNonewithout a device.Reproduced on
63bcca43with a D3D12 adapter — both fail at the assertions named in the issue.dynamic_slots_are_held_until_released: the heap cannot holdHEAP_VIEWS = 1 << 21against the 1,000,000 shader-visible cap. The test now asserts the design instead:counttitle slots plus the dynamic range the host took (>= MIN_DYNAMIC), and that the view-stride and view-mark tables havemax(count, HEAP_VIEWS)entries each, by reading the mapped buffers' widths.lists_share_a_table_and_copies_keep_their_views: measured here, the host-copy pairs are(2, 4)— inside the dynamic range — because the heap is exactlycount + MIN_DYNAMICand the reserved pair range past it does not fit. The test now asserts one distinct pair per copy and that both are inside the heap, which is what it needs; the slot's range is the host's choice, and asserting>= 1 << 18encoded a layout a capped heap does not have.Test-only. No behaviour changes.
Verification on this machine (Windows 11, D3D12 adapter, Rust 1.98.1):
dynamic_slots_are_held_until_releasedFAILED atNumDescriptors >= HEAP_VIEWS;lists_share_a_table_and_copies_keep_their_viewsFAILED at>= 1 << 18.cargo clippy -p victory-gpu --all-targets --locked -- -D warningsclean.AI-assisted; every run above was executed on this machine.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T14:30:07Z.
Review: APPROVED
Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP):
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:34:14Z.
Windows 11,
63bcca4+ this PR, Radeon RX 7900 XTX:cargo test -p victory-gpu --lib: 231 passed / 0 failed / 1 ignored.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.Worth knowing when reading the result: this host does not cap the view heap (
HEAP_VIEWSfits: 24 GB card), so the tests take the uncapped branch; the capped branch the PR asserts is the one CI's WARP path and an NVIDIA host would exercise. Synthetic only. AI-assisted.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T01:21:26Z.
Review: APPROVED
Looks great. Both assertions now test the real cross-vendor invariants (heap holds
count + dynamicwithdynamic >= MIN_DYNAMIC,stridesandmarkscovercount.max(HEAP_VIEWS), and each copy receives a distinct pair within the heap's capacity) instead of assuming an uncapped 2M shader-visible descriptor heap.Verified on
e493332a0443f9a1b2930fc607f89f58df92b36c:cargo xtask policyandcargo clippy --lib/--tests(default and--features diagnostics,-D warnings) pass cleanly.VICTORY_D3D12_DEBUG=1): all 15/15descriptor::host::testsand all 8/8memory::testspass with zero skips.VICTORY_D3D12_DEBUG=1): all 15/15descriptor::host::testsand all 8/8memory::testspass.Imported from Marvisak/VIctory. Originally posted by kalberts0089-hash on 2026-11-27T08:14:41Z.
NVIDIA test report: RTX 4070 Ti (desktop, driver 621.01), Windows 11 Pro, rustc 1.98.1. Head
e493332(base main63bcca4).cargo test -p victory-gpu --lib -- --test-threads=1: 231 passed, 0 failed, 1 ignored (main: 229 / 2 / 1). Both known capped-heap failures on main here,dynamic_slots_are_held_until_released(>= HEAP_VIEWS) andlists_share_a_table_and_copies_keep_their_views("past the dynamic slots"), pass with this PR, including the new stride/mark table width checks.cargo test -p victory-shader --lib --no-fail-fast, skippingheap_direct_texture_reads_mark_their_heap_index(#2571): 298 passed, 3 failed, 3 ignored, same as main. The 3 are the known NVIDIA failures (a_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zeros,gathers_at_a_level_match_the_hardware), unrelated to this PR.Synthetic tests only, no game files. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by HamsterHyper187 on 2026-11-27T17:34:36Z.
Test report: NVIDIA RTX 3060 12 GB (Ampere), native Windows
OS: Windows 11 x64
GPU: NVIDIA GeForce RTX 3060 12 GB, driver 621.40
rustc/cargo: 1.98.1 (48a229cea 2026-09-01)
Base: main
63bcca4Head:
e493332(based on current main, no rebase needed)Command:
cargo test -p victory-gpu --lib --locked -- --test-threads=1On
main, the two failures are the ones from #3178:descriptor::host::tests::dynamic_slots_are_held_until_released(host.rs:2226)memory::tests::lists_share_a_table_and_copies_keep_their_views(memory.rs:1030)On this PR, both pass, also when run alone with
--exact. No other test changed.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T17:43:41Z.
I ran the two tests on the same app-local WARP 1.0.22 device with Agility 1.620.2, comparing
main63bcca4with this heade493332. To exercise fallback on that same adapter, a temporary test-only guard inHostHeap::newreturnedE_INVALIDARGfor view heap creation requests above 1,000,000. WARP performed the fallback allocations. Each case ran in a fresh process.maine493332(262146, 262148)(2, 4)In the capped control,
mainfailed atNumDescriptors >= HEAP_VIEWSandpast the dynamic slots, respectively. The PR completed both submissions and checked their readbacks in the copy-pair test. The guard and measurement prints were removed after building the test binaries.One wording suggestion for the PR description and test comment: say that a capped host may reject
HEAP_VIEWS. The normal WARP run allocated exactly 2,097,152 shader-visible views. The same PR assertions passed on both allocation paths.Synthetic tests only. AI-assisted with Codex.
Imported from Marvisak/VIctory. Originally posted by artor410 on 2026-11-28T08:19:20Z.
NVIDIA Ampere check of
e493332, merged cleanly ontomain63bcca4(treee493332). RTX 3070 Ti 8 GB (Ampere, view heap capped at 1,000,000), driver 610.88, Windows 11, rustc 1.98.1, hardware adapter. Synthetic tests only.Command:
cargo test -p victory-gpu --lib, then the two #3178 tests with--nocapture --test-threads=1.main: 229 pass / 2 fail (dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views).This is the only PR that still asserts something on the capped path. It checks the title slots plus the dynamic range, and that the stride and mark tables cover
HEAP_VIEWS. For the pairs, it checks they are distinct and inside the heap, where the others skip the check.Side by side with #1770, #2251, #2937, #3191 and #3244 in #3178.
(Claude Code, Claude Opus 5.5.)
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T08:26:39Z.
The RTX 3070 Ti comparison narrows the capped-host test fix to this PR. I also checked that it combines with fyernald's parallel test-hook fix #2585 on the current main. Combined commit e9febc4 preserves both exact heads.
On signed app-local WARP, all 15 descriptor-host tests passed at eight threads, as did the shared-table and copy-pair test. I then used a local test-only shim to simulate the reported 65,540-descriptor ceiling before calling D3D12. The first test used 65,540 descriptors with 65,536 dynamic slots. The shared-table test requests no title slots, so it used 65,536 descriptors and kept both distinct copy pairs at indices 2 and 4. Both capped runs executed their existing assertions and passed. The published branch contains the two PRs' test changes. Strict GPU Clippy and the asset policy passed.
The next step is maintainer review. Please retain HailLucifer666's and fyernald's Git authorship if applying either change directly.
AI-assisted with OpenAI Codex.
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.