Shader translator: GFX10 'a lane mask read as data is not supported' drops two compute shaders' dispatches #3253

Open
opened 2026-11-26 14:47:55 +00:00 by github-bot · 6 comments
Owner

@⁠Moonwolf711 on GitHub · 2026-11-26 14:39 UTC · original

During world streaming, two compute shaders fail to translate and their dispatches are dropped:

WARN victory_gpu::pipeline: shader does not translate; its pipelines' draws are dropped stage="compute" hash=90a0692af4320129 error=GFX10 code at 0x14dc: a lane mask read as data is not supported cached=true
WARN victory_gpu::pipeline: shader does not translate; its pipelines' draws are dropped stage="compute" hash=82a2ad6d07417d36 error=GFX10 code at 0x150c: a lane mask read as data is not supported cached=true

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 a uint4, usable for the common read-the-mask-as-data patterns (counting, comparing, storing).
  • WaveGetLaneIndex() / WaveIsFirstLane() cover index and election semantics.
  • Group-derived masks can be reconstructed from ballot results with select/and/or on the original predicate.

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 exec assumed 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

  • Keep the source value as data and only materialize native constructs at their point of use; a mask read is data, not a resource handle, and should survive SSA as an integer.
  • If the mask is later used both as data and for control flow, both uses should be served: the data use from the ballot result, control flow from the original predicate.
  • A similar data-as-value principle applies to descriptor reads if that error class shows up elsewhere.

Environment: RX 6600 XT (RDNA2 host), current tip. Happy to share the two hashes' surrounding log context or test a fix branch.

**@⁠Moonwolf711** on GitHub · 2026-11-26 14:39 UTC · [original](https://github.com/Marvisak/VIctory/issues/3253) During world streaming, two compute shaders fail to translate and their dispatches are dropped: ``` WARN victory_gpu::pipeline: shader does not translate; its pipelines' draws are dropped stage="compute" hash=90a0692af4320129 error=GFX10 code at 0x14dc: a lane mask read as data is not supported cached=true WARN victory_gpu::pipeline: shader does not translate; its pipelines' draws are dropped stage="compute" hash=82a2ad6d07417d36 error=GFX10 code at 0x150c: a lane mask read as data is not supported cached=true ``` 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 a `uint4`, usable for the common read-the-mask-as-data patterns (counting, comparing, storing). - `WaveGetLaneIndex()` / `WaveIsFirstLane()` cover index and election semantics. - Group-derived masks can be reconstructed from ballot results with select/and/or on the original predicate. 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 `exec` assumed 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 - Keep the source value as data and only materialize native constructs at their point of use; a mask read is data, not a resource handle, and should survive SSA as an integer. - If the mask is later used both as data and for control flow, both uses should be served: the data use from the ballot result, control flow from the original predicate. - A similar data-as-value principle applies to descriptor reads if that error class shows up elsewhere. Environment: RX 6600 XT (RDNA2 host), current tip. Happy to share the two hashes' surrounding log context or test a fix branch.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:47:55 +00:00
Author
Owner

@⁠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):

for &(_, w) in &inst.writes {
    self.vals
        .entry(w)
        .or_insert(Val::Missing("a lane mask read as data"));
}

at 3961-ish (the v_add_co_ci_u32 chain carrying into SCC), 6625 (the v_add_co_ci/v_sub_co_ci forms), and 8062 (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:

  • The mask itself is already represented — 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), and ballots: HashMap<Value, (V, V)> with the balloting set already materialises a mask as data through WaveActiveBallot (lower.rs:261-266, and the note at 358-377 explains why ballots are the console's masks bit for bit).
  • So the missing piece is at the read: when a value with no Val is consumed as data, ask whether lane_bits has a Bool for that register and, if so, ballot it; only fall back to Missing when 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.
  • Doing it in the three or_insert sites 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 around 0x14dc and 0x150c, 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-shader on 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).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 14:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/3253#issuecomment-7195586485) 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`): ```rust for &(_, w) in &inst.writes { self.vals .entry(w) .or_insert(Val::Missing("a lane mask read as data")); } ``` at `3961`-ish (the `v_add_co_ci_u32` chain carrying into SCC), `6625` (the `v_add_co_ci`/`v_sub_co_ci` forms), and `8062` (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: - The mask itself is already represented — `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), and `ballots: HashMap<Value, (V, V)>` with the `balloting` set already materialises a mask as data through `WaveActiveBallot` (`lower.rs:261-266`, and the note at `358-377` explains why ballots are the console's masks bit for bit). - So the missing piece is at the read: when a value with no `Val` is consumed as data, ask whether `lane_bits` has a `Bool` for that register and, if so, ballot it; only fall back to `Missing` when 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. - Doing it in the three `or_insert` sites 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 around `0x14dc` and `0x150c`, 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-shader` on 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)._
Author
Owner

@⁠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.

**@⁠Venom2054** on GitHub · 2026-11-26 15:10 UTC · [original](https://github.com/Marvisak/VIctory/issues/3253#issuecomment-7195893529) 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.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 15:24 UTC · original

I tested the use-site question on current main 63bcca4 with synthetic inputs. Reading VCC_LO as an integer after v_cmp_gt_u32 or v_add_co_ci_u32 already emits WaveActiveBallot. Reading an ordinary SGPR carry after v_mad_u64_u32 does too. All three returned ffffffff / 00000000 for 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 signed v_mad_i64_i32 form with a consumed carry is refused on main with a 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 documentation

AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 15:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/3253#issuecomment-7196212649) I tested the use-site question on current main `63bcca4` with synthetic inputs. Reading VCC_LO as an integer after `v_cmp_gt_u32` or `v_add_co_ci_u32` already emits `WaveActiveBallot`. Reading an ordinary SGPR carry after `v_mad_u64_u32` does too. All three returned `ffffffff` / `00000000` for 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 signed `v_mad_i64_i32` form with a consumed carry is refused on main with `a 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 documentation](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/waveballot) AI-assisted with Codex.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-26 15:36 UTC · original

Both hashes have the same producer and consumer. s_andn2_wrexec_b32 writes SCC at the end of the waterfall loop, s_cbranch_execnz takes the backedge, and s_cselect_b32 is 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 later s_cbranch_execz.

**@⁠Venom2054** on GitHub · 2026-11-26 15:36 UTC · [original](https://github.com/Marvisak/VIctory/issues/3253#issuecomment-7196511401) Both hashes have the same producer and consumer. `s_andn2_wrexec_b32` writes SCC at the end of the waterfall loop, `s_cbranch_execnz` takes the backedge, and `s_cselect_b32` is 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 later `s_cbranch_execz`.
Author
Owner

@⁠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 main or #3016. Setup: RTX 5070 Ti (32-lane), Series S profile, our stack of fork PRs including #993/#994, with VICTORY_BVH_BUILDER=1. One run per setting.

  • 90a0692af4320129 and 82a2ad6d07417d36 translate and their pipelines build there.
  • With the builder on and both passes running, the main character's skin draw is issued with its targets bound and its textures uploaded, but it writes no pixels to the G-buffer.
  • Adding VICTORY_SKIP_PIPELINES=90a0692af4320129,82a2ad6d07417d36 brings 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=1 and the room is ray-traced lit. Please disregard the "output is wrong on 32-lane" reading above.

**@⁠HLVM04** on GitHub · 2026-11-26 15:56 UTC · [original](https://github.com/Marvisak/VIctory/issues/3253#issuecomment-7196956068) · 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 `main` or #3016. Setup: RTX 5070 Ti (32-lane), Series S profile, our stack of fork PRs including #993/#994, with `VICTORY_BVH_BUILDER=1`. One run per setting. - 90a0692af4320129 and 82a2ad6d07417d36 translate and their pipelines build there. - With the builder on and both passes running, the main character's skin draw is issued with its targets bound and its textures uploaded, but it writes no pixels to the G-buffer. - Adding `VICTORY_SKIP_PIPELINES=90a0692af4320129,82a2ad6d07417d36` brings 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=1` and the room is ray-traced lit. Please disregard the "output is wrong on 32-lane" reading above.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 16:07 UTC · original

Thanks for the mnemonic sequence. s_andn2_wrexec_b32 followed by the s_cbranch_execnz backedge 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 review

I ran the same two synthetic tests on main 63bcca4 with only the test hunk and on exact #3016 head 7872701. Both tests are refused on main. On WARP 1.0.22 with DXIL validation, both pass on the PR at the default limit and with VICTORY_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.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 16:07 UTC · [original](https://github.com/Marvisak/VIctory/issues/3253#issuecomment-7197211277) Thanks for the mnemonic sequence. `s_andn2_wrexec_b32` followed by the `s_cbranch_execnz` backedge 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 review](https://git.gtahub.st/github/Marvisak--VIctory/pulls/3016) I ran the same two synthetic tests on main `63bcca4` with only the test hunk and on exact #3016 head `7872701`. Both tests are refused on main. On WARP 1.0.22 with DXIL validation, both pass on the PR at the default limit and with `VICTORY_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.
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#3253
No description provided.