NVIDIA RTX 4060: test failures and a crash from descriptor heaps capped below HEAP_VIEWS (1 << 21) #3445

Open
opened 2026-11-27 02:54:18 +00:00 by github-bot · 2 comments
Owner

@⁠kalberts0089-hash on GitHub · 2026-11-27 02:52 UTC · original

Hardware / software

  • GPU: NVIDIA GeForce RTX 4060, driver 610.88 (32.0.16.1088)
  • OS: Windows 11 Pro 10.0.26300
  • Commit: 63bcca4 (main, same as upstream/main at time of writing)
  • No game files used; cargo test only.

Summary

HEAP_VIEWS = 1 << 21 (shader.rs:33) is larger than the descriptor heap this NVIDIA card
provides (about 1,000,000, cf. PORTABLE_VIEWS). On this card HostHeap::new takes the
capped fallback, and tests that assume a full-size heap fail. All shader failures below
disappear under VICTORY_WARP=1, so they're specific to the NVIDIA hardware path.

The heap-cap failures (both victory-gpu tests and
a_heap_buffer_read_where_no_buffer_view_is_reads_zeros) look like one root cause. The crash in heap_direct_texture_reads_mark_their_heap_index turned out to be unrelated; see the comment below.
The other stride test (a_heap_buffer_read_by_element_takes_the_views_stride) and the NaN
gather test may be separate; the NaN one may be a test expectation tied to AMD behaviour.
Happy to split those out into their own issues if that's easier to track.

victory-gpu

  • descriptor::host::tests::dynamic_slots_are_held_until_released: assertion
    heap.heap.GetDesc().NumDescriptors >= victory_shader::emit::HEAP_VIEWS fails (host.rs:2226).
    The fallback heap is count + MIN_DYNAMIC.
  • memory::tests::lists_share_a_table_and_copies_keep_their_views: panics
    "past the dynamic slots" (memory.rs:1030). The fallback reserves MIN_DYNAMIC (1 << 16),
    not DYNAMIC (1 << 18).

victory-shader

  • emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index: the test binary
    crashes with 0xc0000005 STATUS_ACCESS_VIOLATION, no output first. Passes under VICTORY_WARP=1.
  • emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros:
    hardware: dispatch failed: The parameter is incorrect. The test heap is HEAP_VIEWS
    slots when views end in View::NullBuffers (emit/host.rs:1545).
  • emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride:
    got [101, 104, 107, ..., 131, 0, ...], expected [200..=231]. Lane l reads dword
    3·(3l+1): the shader's raw element × stride addressing plus the test host's structured
    view (stride 12, emit/host.rs:1790) apply the stride twice on NVIDIA. emit/mod.rs says
    these views should be raw.
  • emit::synthetic_tests::gathers_at_a_level_match_the_hardware: lane 0 (NaN u coordinate)
    got [0.0, 1.0, 0.0, 0.0], expected all zeros. NaN gather results differ by vendor.

Steps to reproduce

  1. cargo test --workspace --no-fail-fast
  2. cargo test -p victory-shader --lib -- --test-threads=1 (shows the crashing test)
  3. cargo test -p victory-shader --lib -- --test-threads=1 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index
    → 298 passed, 3 failed
  4. Same filters with VICTORY_WARP=1 → the crash and both stride tests pass
  5. cargo test -p victory-gpu --lib → 229 passed, 2 failed (the two above)
  • #11 (RTX 4060 device removal) and commit 38277675 ("make tables past a capped host view
    heap afresh"). The HEAP_VIEWS clamp (emit/mod.rs, "Heap indices", 2026-11-24) came
    after #11 closed, and host.rs:156 notes capped NVIDIA heaps still fault on indices past them.
  • The fix/tests-without-gpu branch (66d9dc3) doesn't affect these: it only skips hardware
    checks on a software adapter, and the RTX 4060 is a real hardware adapter.

Investigation done with Claude Code's help. Happy to test any fixes on this card.

**@⁠kalberts0089-hash** on GitHub · 2026-11-27 02:52 UTC · [original](https://github.com/Marvisak/VIctory/issues/3445) ### Hardware / software - GPU: NVIDIA GeForce RTX 4060, driver 610.88 (32.0.16.1088) - OS: Windows 11 Pro 10.0.26300 - Commit: `63bcca4` (`main`, same as `upstream/main` at time of writing) - No game files used; `cargo test` only. ### Summary `HEAP_VIEWS = 1 << 21` (`shader.rs:33`) is larger than the descriptor heap this NVIDIA card provides (about 1,000,000, cf. `PORTABLE_VIEWS`). On this card `HostHeap::new` takes the capped fallback, and tests that assume a full-size heap fail. All shader failures below disappear under `VICTORY_WARP=1`, so they're specific to the NVIDIA hardware path. The heap-cap failures (both `victory-gpu` tests and `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`) look like one root cause. The crash in heap_direct_texture_reads_mark_their_heap_index turned out to be unrelated; see the comment below. The other stride test (`a_heap_buffer_read_by_element_takes_the_views_stride`) and the NaN gather test may be separate; the NaN one may be a test expectation tied to AMD behaviour. Happy to split those out into their own issues if that's easier to track. ### `victory-gpu` - `descriptor::host::tests::dynamic_slots_are_held_until_released`: assertion `heap.heap.GetDesc().NumDescriptors >= victory_shader::emit::HEAP_VIEWS` fails (`host.rs:2226`). The fallback heap is `count + MIN_DYNAMIC`. - `memory::tests::lists_share_a_table_and_copies_keep_their_views`: panics "past the dynamic slots" (`memory.rs:1030`). The fallback reserves `MIN_DYNAMIC` (`1 << 16`), not `DYNAMIC` (`1 << 18`). ### `victory-shader` - `emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index`: the test binary crashes with `0xc0000005` `STATUS_ACCESS_VIOLATION`, no output first. Passes under `VICTORY_WARP=1`. - `emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`: `hardware: dispatch failed: The parameter is incorrect.` The test heap is `HEAP_VIEWS` slots when views end in `View::NullBuffers` (`emit/host.rs:1545`). - `emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride`: got `[101, 104, 107, ..., 131, 0, ...]`, expected `[200..=231]`. Lane l reads dword `3·(3l+1)`: the shader's raw `element × stride` addressing plus the test host's *structured* view (stride 12, `emit/host.rs:1790`) apply the stride twice on NVIDIA. `emit/mod.rs` says these views should be raw. - `emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: lane 0 (NaN u coordinate) got `[0.0, 1.0, 0.0, 0.0]`, expected all zeros. NaN gather results differ by vendor. ### Steps to reproduce 1. `cargo test --workspace --no-fail-fast` 2. `cargo test -p victory-shader --lib -- --test-threads=1` (shows the crashing test) 3. `cargo test -p victory-shader --lib -- --test-threads=1 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index` → 298 passed, 3 failed 4. Same filters with `VICTORY_WARP=1` → the crash and both stride tests pass 5. `cargo test -p victory-gpu --lib` → 229 passed, 2 failed (the two above) ### Possibly related - #11 (RTX 4060 device removal) and commit `38277675` ("make tables past a capped host view heap afresh"). The `HEAP_VIEWS` clamp (`emit/mod.rs`, "Heap indices", 2026-11-24) came after #11 closed, and `host.rs:156` notes capped NVIDIA heaps still fault on indices past them. - The `fix/tests-without-gpu` branch (`66d9dc3`) doesn't affect these: it only skips hardware checks on a software adapter, and the RTX 4060 is a real hardware adapter. Investigation done with Claude Code's help. Happy to test any fixes on this card.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:54:18 +00:00
Author
Owner

@⁠kalberts0089-hash on GitHub · 2026-11-27 03:15 UTC · original

Update on the heap_direct_texture_reads_mark_their_heap_index crash: I ran it under cdb, and it is not related to the heap cap.

The access violation is in NVIDIA's driver (nvwgf2umx.dll), called from Host::dispatch at emit/host.rs:1922 (SetComputeRoot32BitConstants). It is a read from address 0x4.

The test's shader has no user data (shader.user_data has length 0 at the crash), so memory_tests.rs:731 builds vec![0u32; shader.user_data_dwords() as usize], an empty Vec. Its pointer is Rust's dangling placeholder 0x4. That gets passed as SetComputeRoot32BitConstants(0, 0, 0x4, 0). NVIDIA's driver reads from the pointer even when the count is 0; WARP (and presumably AMD) doesn't.

Other code paths already avoid this with .max(1) (emit/host.rs:229 for the root signature, emit/host.rs:610). This test call doesn't. Suggested fix: add .max(1) there, or have Host::dispatch skip Root::Constants with no data. The same unguarded pattern is also at memory_tests.rs:269, 461, 597, 879 and valu_tests.rs:395; those pass here, presumably because their shaders have user data.

So the crash is separate from the heap-cap failures. Happy to open it as its own issue, or send a small PR for the fix, if you prefer.

**@⁠kalberts0089-hash** on GitHub · 2026-11-27 03:15 UTC · [original](https://github.com/Marvisak/VIctory/issues/3445#issuecomment-7208830172) Update on the `heap_direct_texture_reads_mark_their_heap_index` crash: I ran it under `cdb`, and it is **not** related to the heap cap. The access violation is in NVIDIA's driver (`nvwgf2umx.dll`), called from `Host::dispatch` at `emit/host.rs:1922` (`SetComputeRoot32BitConstants`). It is a read from address `0x4`. The test's shader has no user data (`shader.user_data` has length 0 at the crash), so `memory_tests.rs:731` builds `vec![0u32; shader.user_data_dwords() as usize]`, an empty `Vec`. Its pointer is Rust's dangling placeholder `0x4`. That gets passed as `SetComputeRoot32BitConstants(0, 0, 0x4, 0)`. NVIDIA's driver reads from the pointer even when the count is 0; WARP (and presumably AMD) doesn't. Other code paths already avoid this with `.max(1)` (`emit/host.rs:229` for the root signature, `emit/host.rs:610`). This test call doesn't. Suggested fix: add `.max(1)` there, or have `Host::dispatch` skip `Root::Constants` with no data. The same unguarded pattern is also at `memory_tests.rs:269, 461, 597, 879` and `valu_tests.rs:395`; those pass here, presumably because their shaders have user data. So the crash is separate from the heap-cap failures. Happy to open it as its own issue, or send a small PR for the fix, if you prefer.
Author
Owner

@⁠kalberts0089-hash on GitHub · 2026-11-27 04:01 UTC · original

Note: the heap-cap part of this overlaps with #3344, #3411 and #3330 (same cap on other NVIDIA cards), and the by-element stride failure may be #3366. Happy for this to be folded into those. The new finding here is the access violation, which is separate; there's a fix in the linked PR.

**@⁠kalberts0089-hash** on GitHub · 2026-11-27 04:01 UTC · [original](https://github.com/Marvisak/VIctory/issues/3445#issuecomment-7209454839) Note: the heap-cap part of this overlaps with #3344, #3411 and #3330 (same cap on other NVIDIA cards), and the by-element stride failure may be #3366. Happy for this to be folded into those. The new finding here is the access violation, which is separate; there's a fix in the linked PR.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#3445
No description provided.