Tests: bind a constant where a shader has no user data #2739
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!2739
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2739"
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?
@Therecalloftheonion on GitHub · 2026-11-25 19:23 UTC · original
Therecalloftheonion:pr/shader-test-constants→main· +4 −4 · 1 files · 1 commits · openWhat
The host root signature always declares at least one 32-bit constant (
Num32BitValues.max(1)), but four memory tests sized their constant array fromuser_data_dwords()and could pass a count of 0 toSetComputeRoot32BitConstants.Why
On the RX 6700 XT,
SetComputeRoot32BitConstants(..., 0, ...)access-violates and aborts the test process; WARP tolerates it. That made the wholevictory-shadersuite unusable on this GPU (heap_direct_texture_reads_mark_their_heap_indexdied withSTATUS_ACCESS_VIOLATION). Every other shader test already uses.max(1).Testing
cargo test -p victory-shader --lib: 268 passed; the suite no longer aborts. Two pre-existing hardware assertions remain on this GPU (stride_tests::a_heap_buffer_read_by_element...andsynthetic_tests::gathers_at_a_level_match_the_hardware), outside this change.@kotekompotek on GitHub · 2026-11-25 20:05 UTC · original
Correct: user_data_dwords()==0 would panic on ud[u.index] in the loop or pass an empty slice to dispatch; .max(1) keeps both paths safe without changing semantics for shaders that do have user data.
@fuzeofficlal on GitHub · 2026-11-25 20:10 UTC · original
Verified
f237a3cfon Windows 11 + NVIDIA GeForce RTX 5090 (rustc 1.98.1MSVC,VICTORY_WARPunset).cargo test --locked -p victory-shader --lib --features host emit::memory_tests: 4 passed, 0 failed — this directly resolves the0xc0000005crash inheap_direct_texture_reads_mark_their_heap_indexon RTX 5090 as well (not just RX 6700 XT).cargo clippy --locked -p victory-shader --all-targets -- -D warnings(default &--features host): 0 warnings;cargo xtask policy: 184 files ok.git merge-treeagainst13f91caand#2587(complementary:#2587guards empty slices inemit/host.rs,#2739fixes the 4memory_tests.rscallers).@HAL9000RELOADED on GitHub · 2026-11-25 22:53 UTC · original
RDNA3 data point for
f237a3c: RX 7900 XTX, driver 32.0.32015.7029, Windows 10 22H2 (19045), Agility SDK 1.620 through #969 (VICTORY_D3D12_AGILITY). Base:3e8c00a(main13f91ca+ #969).victory-shader273 passed, 0 failed, no abort.heap_direct_texture_reads_mark_their_heap_indexpasses there too, so on this card a count of 0 toSetComputeRoot32BitConstantsis tolerated, as on WARP.a_heap_buffer_read_by_element_takes_the_views_strideandgathers_at_a_level_match_the_hardware.So the abort looks specific to RDNA2 (or its driver). The
.max(1)change is harmless here.@KainanP on GitHub · 2026-11-25 22:53 UTC · original
Measured in the #2571 comparison: it fixes the 4
memory_testscallers, but #2587's host-level test still crashes on an RTX 4060 with only this PR. It merges cleanly alongside the host fix as optional hygiene: #2571 (AI-assisted)@Marvisak on GitHub · 2026-11-25 23:23 UTC · original
Automated triage for the maintainers.
The change is harmless and matches how the root signature is declared (
Num32BitValues: s.user_data_dwords().max(1)inHost::root_signature_for,crates/victory-shader/src/emit/host.rs), but it fixes only four callers. On currentmainthere are still callers that size root constants fromuser_data_dwords()without.max(1): the straddling-write test incrates/victory-shader/src/emit/memory_tests.rs(around line 879, added after this PR's base) andcrates/victory-shader/src/emit/valu_tests.rs(around line 395), so the description's "every other shader test already uses.max(1)" does not hold any more. The root cause (an empty slice's dangling pointer reachingSetComputeRoot32BitConstants) is addressed for every caller at the host level by open PR #2587 (Host::dispatch/Host::draw), which needs a rebase.What would change the verdict: either rebase and cover all remaining callers, or a maintainer decides to take #2587 instead, in which case this PR is not needed. CI (
check) passes.Generated by Claude Code
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.