Shader translator: GFX10 'a lane mask read as data is not supported' drops two compute shaders' dispatches #3253
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#3253
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Moonwolf711 on GitHub · 2026-11-26 14:39 UTC · original
During world streaming, two compute shaders fail to translate and their dispatches are dropped:
Both fire within the first ~500 frames, around when characters and skinned geometry appear in the world. The dropped compute work is a plausible contributor to missing skinned/character geometry (the community-reported faceless-characters symptom).
Suggested direction
The source ISA reads a lane mask as an ordinary data value (RDNA
exec-mask-style access). This is representable in DXIL: SM 6.0 wave intrinsics can materialize the active-lane set as data:WaveActiveBallot()returns the active mask as auint4, usable for the common read-the-mask-as-data patterns (counting, comparing, storing).WaveGetLaneIndex()/WaveIsFirstLane()cover index and election semantics.So the fix would be a lowering in the GFX10 front end — recognize the lane-mask-as-data read and emit the corresponding wave intrinsic — rather than rejecting the shader. Falling back to scalar emulation (uniform
execassumed all-ones) would also run, but changes behavior for shaders that branch on the mask, so the ballot lowering is safer first.Notes from a translator-design review
Environment: RX 6600 XT (RDNA2 host), current tip. Happy to share the two hashes' surrounding log context or test a fix branch.
@zzm1234560621-prog on GitHub · 2026-11-26 14:57 UTC · original
One thing I can add without the title's shaders: the message you are seeing is not a dedicated refusal for a mask-as-data instruction — it is the fallback three instructions share, so the fix belongs at the use site rather than in the instruction that raises it.
All three sites are the same shape (
lower.rs):at
3961-ish (thev_add_co_ci_u32chain carrying into SCC),6625(thev_add_co_ci/v_sub_co_ciforms), and8062(the scalar compare writing SCC/EXEC). Each one records "whatever this instruction wrote and nothing else claims" as missing; the string is the error you see because something later reads that register as data.That matters for the shape of a fix:
lane_bits: HashMap<u32, Bool>holds the per-lane boolean for the register (self.lane_bits.insert(w, carry)is the line right above each site), andballots: HashMap<Value, (V, V)>with theballotingset already materialises a mask as data throughWaveActiveBallot(lower.rs:261-266, and the note at358-377explains why ballots are the console's masks bit for bit).Valis consumed as data, ask whetherlane_bitshas aBoolfor that register and, if so, ballot it; only fall back toMissingwhen it does not. That is the "keep the source value as data, materialize at the point of use" note in your issue, and it keeps the control-flow use of the same register on the original predicate.or_insertsites instead would need the mask at a point where the instruction's result is not yet known to be read as data, which is why I would not start there.What I cannot do from here is test it: I have no title shaders (no game files), so I cannot tell whether one of your two hashes goes through
add_co_ci(SCC), the scalar compare (EXEC), or both, and a fix that only covers one of the three would move the failure rather than remove it. If you can paste the three or four instructions around0x14dcand0x150c, that would say which shape is needed; with that I can write the lowering plus synthetic GFX10 tests for both cases, and you would still be the one running it against the hashes.This machine has an Intel Arc (Xe-LPG) and WARP and can run
victory-shaderon any branch, so I can also take the review side of a patch if you would rather write it.No game files. AI-assisted (Claude).
@Venom2054 on GitHub · 2026-11-26 15:10 UTC · original
There is an existing fix for both hashes in #3016. On a physical RTX 5070 Ti,
main(63bcca43) refused the two programs at the exact offsets reported here. On the PR head (7872701), both passed the Windows DXIL validator and D3D12 created both compute pipelines. An unrelated compute control gave byte-identical DXIL on both revisions.The effect definitions identify both as BVH skinning passes for character blend-shape velocity. In six prologue captures from a separate fork that already translates both, the secondary-motion variant (
82a2ad6d07417d36) had 12 nonzero dispatches in total, at least one in each capture. Both pipelines were bound during the runs. Whether either changes the appearance of faces remains unmeasured.@andrewpozdnakov7-jpg on GitHub · 2026-11-26 15:24 UTC · original
I tested the use-site question on current main
63bcca4with synthetic inputs. Reading VCC_LO as an integer afterv_cmp_gt_u32orv_add_co_ci_u32already emitsWaveActiveBallot. Reading an ordinary SGPR carry afterv_mad_u64_u32does too. All three returnedffffffff/00000000for the set/clear cases on a full Wave32 on WARP 1.0.22. I checked the emitted DXIL as well as the readbacks.Two controls help narrow this down. A one-thread version returned zero for the set case in both translated DXIL and independently compiled HLSL, while the 32-thread HLSL returned
ffffffff. The signedv_mad_i64_i32form with a consumed carry is refused on main witha lane mask from a carry, a different diagnostic. The three passing full-wave cases already have the use-site ballot, so I do not have a synthetic match for your two refusals yet. Can you share just the producer and consumer mnemonic names from the failing sites? That would help choose the next synthetic case. WaveActiveBallot documentationAI-assisted with Codex.
@Venom2054 on GitHub · 2026-11-26 15:36 UTC · original
Both hashes have the same producer and consumer.
s_andn2_wrexec_b32writes SCC at the end of the waterfall loop,s_cbranch_execnztakes the backedge, ands_cselect_b32is the first instruction after loop exit that reads that SCC. The intervening vector compare writes VCC_LO and preserves SCC. I verified the sequence in both programs. The offsets in the issue point to a laters_cbranch_execz.@HLVM04 on GitHub · 2026-11-26 15:56 UTC · original · edited 2026-11-26 17:26 UTC
A data point on the open question of whether these two passes change how characters look. It comes from the fork (fxceless/victory-fork), which already translates both hashes, so it is not
mainor #3016. Setup: RTX 5070 Ti (32-lane), Series S profile, our stack of fork PRs including #993/#994, withVICTORY_BVH_BUILDER=1. One run per setting.VICTORY_SKIP_PIPELINES=90a0692af4320129,82a2ad6d07417d36brings the skin draw back, and the room keeps part of its ray-traced light. Red blotches on the shirt remain either way.So on a 32-lane NVIDIA card, translating these two is not enough. Their output appears to break the skinned geometry that the BVH and the skin draw depend on. That is our reading of the results; we haven't checked their output against a reference. I'd treat "faceless characters" as possibly caused by these passes producing wrong data, not only by them being dropped, at least on wave32 hosts.
Edit (2026-11-26), correction: these two passes were not the cause. They are native 32-lane shaders, and the fork already handles their SCC/exec pair. The missing skin draw came from a local change of ours that deferred some title memory merges to the next submission, so draws read stale bytes. With that fixed, the skin draw is back with
VICTORY_BVH_BUILDER=1and the room is ray-traced lit. Please disregard the "output is wrong on 32-lane" reading above.@andrewpozdnakov7-jpg on GitHub · 2026-11-26 16:07 UTC · original
Thanks for the mnemonic sequence.
s_andn2_wrexec_b32followed by thes_cbranch_execnzbackedge and an SCC consumer is the keyed waterfall case in #3016. The SCC at normal exit is false because EXEC has become zero. This accounts for the refusal without changing numeric compare or carry masks. Current #3016 reviewI ran the same two synthetic tests on main
63bcca4with only the test hunk and on exact #3016 head7872701. Both tests are refused on main. On WARP 1.0.22 with DXIL validation, both pass on the PR at the default limit and withVICTORY_SHADER_LOOP_LIMIT=64. Both keep the original lowering refusal at limit 63. The full-wave test includes 1, 2, 8 and 32 distinct keys. This verifies translation and scalar selection in the fixture. The visual effect in the reported scenes remains open.AI-assisted with Codex.