victory-shader: fix NVIDIA access violation in heap_direct_texture_reads_mark_their_heap_index #3465
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!3465
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3465"
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?
@kalberts0089-hash on GitHub · 2026-11-27 04:00 UTC · original
kalberts0089-hash:fix/empty-root-constants→main· +1 −1 · 1 files · 1 commits · closed without mergingFixes the access violation reported in #3445.
The test's shader has no user data, so it built an empty
Vecand passed its dangling pointer (0x4) toSetComputeRoot32BitConstantswith a count of 0. NVIDIA's driver reads the pointer anyway and crashes (STATUS_ACCESS_VIOLATIONinnvwgf2umx.dll); WARP doesn't.This adds
.max(1)atmemory_tests.rs:731, matching the root signature (emit/host.rs:229) andemit/host.rs:610. I kept it to this one line rather than skipping the call inHost::dispatch, since that would leave a declared root parameter unset.Tested on an RTX 4060 (driver 610.88):
cargo test -p victory-shader --no-fail-fast: 299 passed, 3 failed (the 3 failures are the unrelated ones in #3445)Done with Claude Code's help.
@oni-swr on GitHub · 2026-11-27 04:27 UTC · original
WARP test report (
victory-shader,--lib --locked --no-fail-fast -- --test-threads=1)OS: Windows 11 Pro 10.0.26200 (build 26200.9974), x64
Host adapter: WARP only (VICTORY_WARP=1 and VICTORY_D3D12_WARP=1; d3d10warp.dll 10.0.26100.9818); no physical GPU used
dxil.dll: Windows SDK 10.0.26100.0, version 1.8.2502.11 (via VICTORY_DXIL)
rustc/cargo: 1.98.1 (48a229cea 2026-09-01)
Base: main
63bcca43c6Head:
4beefa7c09(merged onto main, no conflicts, 1 line changed)emit::memory_tests::heap_direct_texture_reads_mark_their_heap_indexruns and passes under WARP on both main and the PR (not skipped, not ignored). As the description says, WARP never faulted on the empty-slice pointer, so this run confirms there is no regression on WARP; it cannot reproduce the NVIDIA access violation.a_mask_joined_with_data_at_a_uniform_loop_is_its_number,gathers_at_a_level_match_the_hardware,permutes_mask_high_address_bits_and_divergent_branches,permutes_read_the_lane_named_and_zero_from_lanes_left_out). They are not touched by this change.Review note: the one-line change
.max(1)is consistent with the root-signature constant count the description cites; the only effect is a one-dword all-zero buffer when a shader has no user data. No concerns.AI-assisted (Claude). Aggregate counts only; no game files used.
@upipibi on GitHub · 2026-11-27 04:29 UTC · original
Confirmed on an RTX 3070 8 GB (Ampere), driver 616.56, Windows 11. This is the crash we have been skipping in every VIctory run (#2571).
cargo test --locked -p victory-shader --lib emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index -- --exact --test-threads=1, each tree in its own target dir:main63bcca4: the process dies with0xc0000005.4beefa7: 1 passed, 0 failed in 3 of 3 runs, with no skip line, so both the hardware and the WARP pass ran.Full
cargo test --locked -p victory-shader --lib -- --test-threads=1on this PR, with nothing skipped: 299 passed, 3 failed, 3 ignored. The 3 failures are the ones already onmainhere:a_heap_buffer_read_by_element_takes_the_views_strideanda_heap_buffer_read_where_no_buffer_view_is_reads_zeros(#1835), andgathers_at_a_level_match_the_hardware(#2323). Onmainthe suite cannot finish without skipping this test.I checked the cited lines: the root signature declares
user_data_dwords().max(1)constants (emit/host.rs:229), and the FMad probe pads its user data the same way (:610).AI-assisted (Claude Code, Claude Opus 5.5).
@kalberts0089-hash on GitHub · 2026-11-27 04:50 UTC · original
Heads-up: I've since found this overlaps with #2739 (same
.max(1)at line 731, plus 269/461/597) and the host-level fixes in #2587, #2596 and #3226, which cover all callers. Happy for this to be closed in favour of whichever approach you prefer. The diagnosis and the RTX 3070 confirmation above should apply to all of them.@kalberts0089-hash on GitHub · 2026-11-27 11:15 UTC · original
Closing in favour of the host-level fixes (#2587, #2596, #3000), which cover every caller; this one only covered one. Thanks upipibi and oni-swr for testing it.
Pull request closed