T2: GPU checks for vector float instructions #333

Closed
opened 2026-11-27 21:23:36 +00:00 by NickStallman · 6 comments
NickStallman commented 2026-11-27 21:23:36 +00:00 (Migrated from github.com)
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T21:23:36Z.


Taking this part of T2 from ROADMAP.md: GPU checks for the vector float instructions recorded shaders use and no check runs yet. This is the starter list in the roadmap, plus the float ops just below it in INSTRUCTIONS.md:

  • v_mul_legacy_f32, v_fmac_f32, v_fma_mix_f32
  • v_rsq_f32, v_rcp_iflag_f32, v_exp_f32, v_log_f32
  • v_sin_f32, v_cos_f32, v_fract_f32
  • v_cvt_f32_ubyte0–3
  • the float v_cmpx_* family (gt, lg, lt and the rest that are used)

Plan

  • Add each one to the assembled checks (tools/check_basic_alu_gpu.py and its siblings), with a reference model.
  • Cover the edge cases RDNA 2 defines: legacy multiply's 0 × inf = 0, denormals, NaN and inf inputs, the transcendentals' input ranges and their documented precision, and EXEC writes for v_cmpx.
  • Where a check exposes a translation that differs from the reference, the fix is a separate PR with that check as its test.
  • Run every check on an AMD card (Raphael iGPU, RADV) and an NVIDIA card (RTX 5090), and post the results here. INSTRUCTIONS.md is regenerated from the checks.

Not covered here, so others can take them: the scalar and buffer loads (s_buffer_load_*, buffer_load_*, tbuffer_*), s_inst_prefetch, the scalar ALU (s_cselect_*, …) and the integer v_cmpx_*. If nobody claims them once these are done, we'll pick up the next block and say so here.

<!-- greyfinch-sync:brcly/TuxBox:issue:6654679258 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/333). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-27T21:23:36Z. --- Taking this part of T2 from [ROADMAP.md](../blob/main/docs/ROADMAP.md): GPU checks for the **vector float instructions** recorded shaders use and no check runs yet. This is the starter list in the roadmap, plus the float ops just below it in [INSTRUCTIONS.md](../blob/main/docs/INSTRUCTIONS.md#used-without-a-gpu-check): - `v_mul_legacy_f32`, `v_fmac_f32`, `v_fma_mix_f32` - `v_rsq_f32`, `v_rcp_iflag_f32`, `v_exp_f32`, `v_log_f32` - `v_sin_f32`, `v_cos_f32`, `v_fract_f32` - `v_cvt_f32_ubyte0`–`3` - the float `v_cmpx_*` family (`gt`, `lg`, `lt` and the rest that are used) **Plan** - Add each one to the assembled checks (`tools/check_basic_alu_gpu.py` and its siblings), with a reference model. - Cover the edge cases RDNA 2 defines: legacy multiply's `0 × inf = 0`, denormals, NaN and inf inputs, the transcendentals' input ranges and their documented precision, and EXEC writes for `v_cmpx`. - Where a check exposes a translation that differs from the reference, the fix is a separate PR with that check as its test. - Run every check on an AMD card (Raphael iGPU, RADV) and an NVIDIA card (RTX 5090), and post the results here. INSTRUCTIONS.md is regenerated from the checks. **Not covered here, so others can take them:** the scalar and buffer loads (`s_buffer_load_*`, `buffer_load_*`, `tbuffer_*`), `s_inst_prefetch`, the scalar ALU (`s_cselect_*`, …) and the integer `v_cmpx_*`. If nobody claims them once these are done, we'll pick up the next block and say so here.
brcly commented 2026-11-27 21:25:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-27T21:25:53Z.


I've started work on this, already. Apologies for not stating sooner.

Hold off on doing this for now

<!-- greyfinch-sync:brcly/TuxBox:comment:7228437269 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/333#issuecomment-7228437269). Originally posted by [brcly](https://github.com/brcly) on 2026-11-27T21:25:53Z. --- I've started work on this, already. Apologies for not stating sooner. Hold off on doing this for now
NickStallman commented 2026-11-27 21:49:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T21:49:31Z.


No problem, we'll stop here. We had already written three checks and run them on both cards, so here's what they found. All of it is measured unless marked otherwise.

Setup: AMD Raphael iGPU (1002:13c0, RADV, an RDNA 2 part) and RTX 5090 (10de:2b85, 620.70.10), GE-Proton11-14, main at fa7333b8.

1. v_sin_f32 / v_cos_f32: wrong for large inputs on NVIDIA. The transcendental check covers rsq, rcp_iflag, exp, log, sin, cos, and special values of rcp and sqrt, with 384 inputs each.

  • AMD: 0 wrong.
  • NVIDIA: 27 wrong for sin and 30 for cos. Everything else passes.
  • At ±FLT_MAX the result is NaN, where it should be 0 (sin) and 1 (cos).
  • From about 2^12 turns up, the result is far off. For example, at input 0x497FF004 NVIDIA returns about 1.0 where the answer is about 0.
  • Inferred cause: the translator emits sin(x * 6.28318530718) without first reducing x to a fraction of a turn, so x·2π overflows or loses the fraction. RADV happens to get it right. Reducing to x - trunc(x) first (keeping sin(−0) = −0) should fix it.

2. Float multiply-add forms: 21 of 99 forms wrong on AMD, 23 on NVIDIA. The check covers v_mul_legacy_f32, v_fmac_f32, v_fma_mix_f32, v_fract_f32 and v_cvt_f32_ubyte0–3, in the VOP2/VOP3/SDWA forms and modifiers the recorded shaders use, 128 inputs each. The existing alu check passed 144/144 on both cards in the same run.

  • v_fma_mix_f32 with clamp: 86–110 of 128 wrong in 7 forms, both cards. From the code: emit_fma_mix never reads the VOP3P clamp bit. The recorded shaders have about 3,500 with clamp on this instruction.
  • Plain VOP2 v_fmac_f32 v, v4, v5 (and with an SGPR source): 30 of 128 wrong, both cards. Not yet explained. We haven't ruled out our model, for example f32 denormal-input handling, so treat this as open.
  • NVIDIA only: v_fma_mix_f32 with -v5 (op_sel_hi [1,0,0]), 4–6 wrong, without clamp.
  • These depend on the console's start-up MODE, which we haven't established:
    • VOP3 clamp with a NaN result (saturate() gives 0; DX10_CLAMP off would pass NaN): mul_legacy and fmac clamp forms, 4–9 wrong each.
    • OMOD mul:2/div:2 keeping −0 where IEEE = 0 would give +0: 1–3 wrong each.

3. Float v_cmp/v_cmpx, all 16 predicates plus class. 114 programs in wave32, native wave64 and paired form, with EXEC, VCC and branch readback. It is queued on both cards and hasn't run yet. Predicted from the emitted HLSL:

  • a branch behind s_cbranch_execz after a v_cmpx that some lanes fail is decided per lane in the native forms;
  • a wave32 VOP3 compare into s24 also zeroes s25.

The checks are on local branches: checks/t2-float-transcendental, checks/t2-float-mad and checks/t2-float-cmpx. Each is a separate check_*_gpu.py with a reference model and unit tests. I can push them, or the fixes, whichever is useful to you. Otherwise we'll leave T2 to you.

<!-- greyfinch-sync:brcly/TuxBox:comment:7228787687 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/333#issuecomment-7228787687). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-27T21:49:31Z. --- No problem, we'll stop here. We had already written three checks and run them on both cards, so here's what they found. All of it is measured unless marked otherwise. **Setup:** AMD Raphael iGPU (1002:13c0, RADV, an RDNA 2 part) and RTX 5090 (10de:2b85, 620.70.10), GE-Proton11-14, `main` at `fa7333b8`. **1. `v_sin_f32` / `v_cos_f32`: wrong for large inputs on NVIDIA.** The transcendental check covers rsq, rcp_iflag, exp, log, sin, cos, and special values of rcp and sqrt, with 384 inputs each. - AMD: 0 wrong. - NVIDIA: 27 wrong for sin and 30 for cos. Everything else passes. - At ±FLT_MAX the result is NaN, where it should be 0 (sin) and 1 (cos). - From about 2^12 turns up, the result is far off. For example, at input `0x497FF004` NVIDIA returns about 1.0 where the answer is about 0. - *Inferred cause:* the translator emits `sin(x * 6.28318530718)` without first reducing x to a fraction of a turn, so `x·2π` overflows or loses the fraction. RADV happens to get it right. Reducing to `x - trunc(x)` first (keeping sin(−0) = −0) should fix it. **2. Float multiply-add forms: 21 of 99 forms wrong on AMD, 23 on NVIDIA.** The check covers `v_mul_legacy_f32`, `v_fmac_f32`, `v_fma_mix_f32`, `v_fract_f32` and `v_cvt_f32_ubyte0`–`3`, in the VOP2/VOP3/SDWA forms and modifiers the recorded shaders use, 128 inputs each. The existing `alu` check passed 144/144 on both cards in the same run. - **`v_fma_mix_f32` with clamp: 86–110 of 128 wrong in 7 forms, both cards.** *From the code:* `emit_fma_mix` never reads the VOP3P clamp bit. The recorded shaders have about 3,500 with clamp on this instruction. - **Plain VOP2 `v_fmac_f32 v, v4, v5` (and with an SGPR source): 30 of 128 wrong, both cards.** Not yet explained. We haven't ruled out our model, for example f32 denormal-input handling, so treat this as open. - **NVIDIA only:** `v_fma_mix_f32` with `-v5` (op_sel_hi [1,0,0]), 4–6 wrong, without clamp. - **These depend on the console's start-up MODE,** which we haven't established: - VOP3 clamp with a NaN result (`saturate()` gives 0; DX10_CLAMP off would pass NaN): mul_legacy and fmac clamp forms, 4–9 wrong each. - OMOD `mul:2`/`div:2` keeping −0 where IEEE = 0 would give +0: 1–3 wrong each. **3. Float `v_cmp`/`v_cmpx`, all 16 predicates plus class.** 114 programs in wave32, native wave64 and paired form, with EXEC, VCC and branch readback. It is queued on both cards and hasn't run yet. *Predicted from the emitted HLSL:* - a branch behind `s_cbranch_execz` after a `v_cmpx` that some lanes fail is decided per lane in the native forms; - a wave32 VOP3 compare into `s24` also zeroes `s25`. The checks are on local branches: `checks/t2-float-transcendental`, `checks/t2-float-mad` and `checks/t2-float-cmpx`. Each is a separate `check_*_gpu.py` with a reference model and unit tests. I can push them, or the fixes, whichever is useful to you. Otherwise we'll leave T2 to you.
NickStallman commented 2026-11-27 21:52:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T21:52:10Z.


We've found the cause of the v_fmac_f32 failure I said was still open: double rounding, a translation fault, not our model.

  • What the translator emits: fmac as a * b + dst, which DXC lowers to fmul fast plus fadd fast. Single rounding then depends on the driver fusing the two.
  • Where fusion is lost: in the failing shader, a v_mul_legacy_f32 computes the same v4 * v5. DXC computes the product once and the fmac's add reads it, so the driver can't fuse an add whose product has another user.
  • Measured: the wrong values match two roundings exactly, on both cards:
    • (1+2^-12)² − (1+2^-11) gives 0, where one rounding gives 0x33800000.
    • 2·MAX − MAX gives +inf, where one rounding gives MAX.
  • Not the same in other forms: the VOP3 fmac forms, in shaders without a shared product, passed the same rows.
  • NVIDIA-only v_fma_mix_f32 failures with -v5, no clamp: the same thing. All 8 listed results equal a separately rounded multiply and add, bit for bit. NVIDIA didn't fuse there; AMD did.
  • Not measured: how many recorded shaders have an fmac or fma whose product is shared.

From the title's own data, on the start-up mode: every stage descriptor we sampled (1,109, from 1 in 25 requests, compute included) holds 0x000000c0 at offset +0x44. That is the f32/f64 round-and-denormal byte the translator assumes, so f32 denormals flushed and f16/f64 kept is consistent with the title. Our reading of that field comes from its value alone. We found nothing showing DX10_CLAMP or IEEE (MODE bits 8–9), so the NaN-through-clamp and OMOD −0 questions stay open.

Local branches, not pushed:

  • xshader/fused-fma: writes the fused forms with mad(), which DXC keeps as one FMad. DXIL doesn't promise FMad is fused, so it would need a GPU run to confirm.
  • xshader/fma-mix-clamp: applies the VOP3P clamp bit. It changes 5,212 wave64 and 1,992 wave32 outputs, with nothing newly refused.

Neither has been run on a GPU. Say if you want either.

<!-- greyfinch-sync:brcly/TuxBox:comment:7228826881 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/333#issuecomment-7228826881). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-27T21:52:10Z. --- We've found the cause of the `v_fmac_f32` failure I said was still open: double rounding, a translation fault, not our model. - **What the translator emits:** fmac as `a * b + dst`, which DXC lowers to `fmul fast` plus `fadd fast`. Single rounding then depends on the driver fusing the two. - **Where fusion is lost:** in the failing shader, a `v_mul_legacy_f32` computes the same `v4 * v5`. DXC computes the product once and the fmac's add reads it, so the driver can't fuse an add whose product has another user. - **Measured:** the wrong values match two roundings exactly, on both cards: - (1+2^-12)² − (1+2^-11) gives 0, where one rounding gives `0x33800000`. - 2·MAX − MAX gives +inf, where one rounding gives MAX. - **Not the same in other forms:** the VOP3 fmac forms, in shaders without a shared product, passed the same rows. - **NVIDIA-only `v_fma_mix_f32` failures with `-v5`, no clamp:** the same thing. All 8 listed results equal a separately rounded multiply and add, bit for bit. NVIDIA didn't fuse there; AMD did. - **Not measured:** how many recorded shaders have an fmac or fma whose product is shared. **From the title's own data, on the start-up mode:** every stage descriptor we sampled (1,109, from 1 in 25 requests, compute included) holds `0x000000c0` at offset +0x44. That is the f32/f64 round-and-denormal byte the translator assumes, so f32 denormals flushed and f16/f64 kept is consistent with the title. Our reading of that field comes from its value alone. We found nothing showing DX10_CLAMP or IEEE (MODE bits 8–9), so the NaN-through-clamp and OMOD −0 questions stay open. **Local branches, not pushed:** - `xshader/fused-fma`: writes the fused forms with `mad()`, which DXC keeps as one FMad. DXIL doesn't promise FMad is fused, so it would need a GPU run to confirm. - `xshader/fma-mix-clamp`: applies the VOP3P clamp bit. It changes 5,212 wave64 and 1,992 wave32 outputs, with nothing newly refused. Neither has been run on a GPU. Say if you want either.
NickStallman commented 2026-11-27 22:58:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T22:58:04Z.


Two more findings, from a float v_cmp/v_cmpx check that runs whole waves: 32 or 64 lanes with partial EXEC, in wave32, native wave64 and paired form. The new checks in check_basic_alu_gpu.py run one lane per wave, so they can't see either.

AMD (RADV, 1002:13c0), main at 5324096e: 559 of 1,254 cases fail. The same result came on fa7333b8.

  1. A branch on an empty EXEC after v_cmpx is decided per lane in the native (unpaired) translations: 198 wave32 cases and 144 wave64 cases.
    • The lanes that left EXEC never see a scalar written behind s_cbranch_execz.
    • Example: v_cmpx_lt_f32 passes in 10 lanes, then s_cbranch_execz skips over s_mov_b32 s22, 2. The console runs the block for the whole wave. In the translation, lane 0 (which left) reads s22 = 0.
    • From the emitted HLSL: tb_skip is taken from the lane's own EXEC bit. The paired form tests exec_lo | exec_hi for the wave and passes.
  2. A wave32 VOP3 compare into s24 also zeroes s25: 228 cases, in every native wave32 program with a plain compare. NVIDIA shows the same.
    • From the emitted HLSL: s25 = 0u is emitted unless some VOP3 compare in the program writes an odd SGPR (wave32_compare_masks).

Everything else matched the ISA model on AMD: ordered and unordered NaN, ±0, denormals flushed and kept, modifiers, constants, class bits, the EXEC that v_cmpx leaves, inactive lanes, and VCC.

RTX 5090 (620.70.10): the device was lost, twice, on the same case. The first case with a partly active EXEC in one wave32 program (v_cmp_lt_f32 with a scalar source and with denormals, plus several v_cmp_eq_f32 forms) gives VK_ERROR_DEVICE_LOST and Xid 109 … CTX SWITCH TIMEOUT, at 08:42 and again at 09:20 with nothing else on the GPU. The translated main has no loop. We're narrowing it down to a minimal program now. It matters to us because #232's in-game hang is the same Xid.

Check: tools/check_float_compares_gpu.py on our local branch checks/t2-float-cmpx. Say if you want it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7229763129 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/333#issuecomment-7229763129). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-27T22:58:04Z. --- Two more findings, from a float `v_cmp`/`v_cmpx` check that runs whole waves: 32 or 64 lanes with partial EXEC, in wave32, native wave64 and paired form. The new checks in `check_basic_alu_gpu.py` run one lane per wave, so they can't see either. **AMD (RADV, 1002:13c0), `main` at `5324096e`:** 559 of 1,254 cases fail. The same result came on `fa7333b8`. 1. **A branch on an empty EXEC after `v_cmpx` is decided per lane** in the native (unpaired) translations: 198 wave32 cases and 144 wave64 cases. - The lanes that left EXEC never see a scalar written behind `s_cbranch_execz`. - Example: `v_cmpx_lt_f32` passes in 10 lanes, then `s_cbranch_execz` skips over `s_mov_b32 s22, 2`. The console runs the block for the whole wave. In the translation, lane 0 (which left) reads `s22 = 0`. - *From the emitted HLSL:* `tb_skip` is taken from the lane's own EXEC bit. The paired form tests `exec_lo | exec_hi` for the wave and passes. 2. **A wave32 VOP3 compare into `s24` also zeroes `s25`:** 228 cases, in every native wave32 program with a plain compare. NVIDIA shows the same. - *From the emitted HLSL:* `s25 = 0u` is emitted unless some VOP3 compare in the program writes an odd SGPR (`wave32_compare_masks`). Everything else matched the ISA model on AMD: ordered and unordered NaN, ±0, denormals flushed and kept, modifiers, constants, class bits, the EXEC that `v_cmpx` leaves, inactive lanes, and VCC. **RTX 5090 (620.70.10): the device was lost, twice, on the same case.** The first case with a partly active EXEC in one wave32 program (`v_cmp_lt_f32` with a scalar source and with denormals, plus several `v_cmp_eq_f32` forms) gives `VK_ERROR_DEVICE_LOST` and `Xid 109 … CTX SWITCH TIMEOUT`, at 08:42 and again at 09:20 with nothing else on the GPU. The translated `main` has no loop. We're narrowing it down to a minimal program now. It matters to us because #232's in-game hang is the same Xid. Check: `tools/check_float_compares_gpu.py` on our local branch `checks/t2-float-cmpx`. Say if you want it.
brcly commented 2026-11-27 23:42:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-27T23:42:41Z.


Thanks for posting these, they're useful. T2's one-lane checks are on main now (369 of the 372 used instructions run on both cards, see INSTRUCTIONS.md), and the sine/cosine reduction and mad() for the fused forms are merged.

Your checks cover what ours can't: whole waves with a partly active EXEC, and operand modifiers. Could you open pull requests for these?

  • checks/t2-float-cmpx: the per-lane branch after v_cmpx and the s25 write are both findings we don't have a check for.
  • checks/t2-float-mad: for the clamp, OMOD and SDWA forms.
  • xshader/fma-mix-clamp, with the check as its test.

These are really T3 (#334), so feel free to take that. xshader/fused-fma isn't needed any more.

Two notes from our side:

  • With mad(), NVIDIA fuses in our check and RADV still rounds twice. Your shared-product explanation may be why: our check has v_mul_legacy_f32 and v_fmac_f32 on the same inputs in one shader. We're testing v_fmac_f32 alone on RADV next.
  • The arithmetic check accepts either the fused or the twice-rounded result for now and records which one a card gave, so it won't fail on this.
<!-- greyfinch-sync:brcly/TuxBox:comment:7230349859 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/333#issuecomment-7230349859). Originally posted by [brcly](https://github.com/brcly) on 2026-11-27T23:42:41Z. --- Thanks for posting these, they're useful. T2's one-lane checks are on main now (369 of the 372 used instructions run on both cards, see INSTRUCTIONS.md), and the sine/cosine reduction and `mad()` for the fused forms are merged. Your checks cover what ours can't: whole waves with a partly active EXEC, and operand modifiers. Could you open pull requests for these? - `checks/t2-float-cmpx`: the per-lane branch after `v_cmpx` and the `s25` write are both findings we don't have a check for. - `checks/t2-float-mad`: for the clamp, OMOD and SDWA forms. - `xshader/fma-mix-clamp`, with the check as its test. These are really T3 (#334), so feel free to take that. `xshader/fused-fma` isn't needed any more. Two notes from our side: - With `mad()`, NVIDIA fuses in our check and RADV still rounds twice. Your shared-product explanation may be why: our check has `v_mul_legacy_f32` and `v_fmac_f32` on the same inputs in one shader. We're testing `v_fmac_f32` alone on RADV next. - The arithmetic check accepts either the fused or the twice-rounded result for now and records which one a card gave, so it won't fail on this.
NickStallman commented 2026-11-27 23:49:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T23:49:38Z.


Will do. Rebased PRs for the float-compares check, the float-forms check and fma_mix clamp are on the way, and we'll take that part of T3. We're dropping xshader/fused-fma.

An update on the NVIDIA device loss from the float-compares check. All of it is measured on the RTX 5090 (620.70.10).

  • The trigger: a bisect of the hanging program pins it to the first-active-lane idiom, WaveActiveMin((exec_lo & 1u) ? WaveGetLaneIndex() : 0xffffffffu), run with a partly active EXEC. Replacing it with firstbitlow of a WaveActiveBallot stops the hang, and the check then reads back with no Xid. Changing the WaveReadLaneAt that follows does not stop it.
  • The idiom on its own doesn't hang. Fifteen standalone wave32 programs all pass. They include the same branch-and-phi shape DXC gives the translated code, WaveActiveBitOr and WaveActiveSum on that phi, and a select() form. So the hang needs something else in the translated program as well. We're now trimming the real program down to find what.
  • The workaround: the ballot form is on a branch with a shader-harness run (wave64: 2,846 outputs changed, 0 regressed; wave32: 1,165 changed, 0 regressed). It'll come as its own PR. Whether this is what hangs the game in #232 is not yet tested.
<!-- greyfinch-sync:brcly/TuxBox:comment:7230437688 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/333#issuecomment-7230437688). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-27T23:49:38Z. --- Will do. Rebased PRs for the float-compares check, the float-forms check and `fma_mix` clamp are on the way, and we'll take that part of T3. We're dropping `xshader/fused-fma`. An update on the NVIDIA device loss from the float-compares check. All of it is measured on the RTX 5090 (620.70.10). - **The trigger:** a bisect of the hanging program pins it to the first-active-lane idiom, `WaveActiveMin((exec_lo & 1u) ? WaveGetLaneIndex() : 0xffffffffu)`, run with a partly active EXEC. Replacing it with `firstbitlow` of a `WaveActiveBallot` stops the hang, and the check then reads back with no Xid. Changing the `WaveReadLaneAt` that follows does not stop it. - **The idiom on its own doesn't hang.** Fifteen standalone wave32 programs all pass. They include the same branch-and-phi shape DXC gives the translated code, `WaveActiveBitOr` and `WaveActiveSum` on that phi, and a `select()` form. So the hang needs something else in the translated program as well. We're now trimming the real program down to find what. - **The workaround:** the ballot form is on a branch with a shader-harness run (wave64: 2,846 outputs changed, 0 regressed; wave32: 1,165 changed, 0 regressed). It'll come as its own PR. Whether this is what hangs the game in #232 is not yet tested.
Sign in to join this conversation.
No labels
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.

Reference
brcly/TuxBox#333
No description provided.