Shaders: the test host never passes NVIDIA an empty root-constant slice #3226
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!3226
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3226"
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?
@Indy2l on GitHub · 2026-11-26 13:44 UTC · original
Indy2l:shader/nvidia-heap-direct-crash→main· +17 −12 · 1 files · 1 commits · openWhat
On NVIDIA, the
victory-shaderunit tests abort the whole test process withSTATUS_ACCESS_VIOLATION. The first casualty isemit::memory_tests::heap_direct_texture_reads_mark_their_heap_index, and every test after it goes unreported.Under
cdb, the fault is inside the driver, reading address0x4:Fixes #2571.
That shader has no user data, so
user_data_dwords() == 0and the test passesRoot::Constants(vec![]).root_signature_forstill declaresuser_data_dwords().max(1)values. An emptyVec's pointer is dangling (0x4), and NVIDIA's driver dereferences it even for a count of 0. WARP doesn't, so CI never sees it.Change
The test host (
emit/host.rs) gets aconstants()helper that returns one zero for empty data, matching the declared parameter. It's used at all three root-constant call sites.The runtime is not affected:
victory-gpu'spipeline/host.rsleaves the parameter out whendwords == 0.Testing
cargo test -p victory-shader --lib --locked: no longer aborts. 299 passed, 3 ignored.cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings: clean.With the abort gone, three NVIDIA failures that were hidden behind it now show up. They're separate issues and not part of this PR:
stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros: "dispatch failed: The parameter is incorrect".View::NullBuffersasks for a 2^21-slot view heap, above NVIDIA's 1,000,000 cap (the same cap as #3122).stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride: hardware reads[101, 104, ...], then zeros, where[200, 201, ...]is expected.synthetic_tests::gathers_at_a_level_match_the_hardware: lane 0 gathers[0, 1, 0, 0]where[0, 0, 0, 0]is expected.🤖 Generated with Claude Code
@Dukestar69 on GitHub · 2026-11-26 13:47 UTC · original · approved these changes
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-shader --lib emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index -- --test-threads=1: PASSED on RTX 5090! (Previously crashed with0xc0000005under#2571on cleanorigin/main.)cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Great NVIDIA driver workaround: passing
&[0]instead of an empty dangling slice avoids NVIDIA'sSet*Root32BitConstantsread at0x4.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.