Recompiler: int PS inputs read as bits take the right branches in a synthetic UI-text shader (#107 regression) #246

Closed
opened 2026-11-23 21:50:59 +00:00 by Kalmarv · 3 comments
Kalmarv commented 2026-11-23 21:50:59 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-23T21:50:59Z.


A follow-up to the #107 regression in HANDOFF ("XDefiant's UI text"). That thread is closed, so I'm opening this instead. In a synthetic reproduction of that UI shader's pattern, the ISA's bit copy takes the right branches and both draw correctly on main. So on NVIDIA at least, the instructions inside the branches aren't what drew nothing.

The fixture is a translated console VS and PS pair:

  • The VS exports int4 RenderType (as int4 p2) next to float attributes.
  • The PS reads it with v_interp_mov_f32 P0, compares it with 1 and 2 (v_cmpx_eq_u32), and gives each branch its own output:
    • branch 1: image_sample_d with explicit gradients;
    • branch 2: four image_sample_lz taps at offsets built from ds_swizzle derivatives.
VS value pixels main (converted, 58309b9) only the P0 read changed to asuint(xi.a2[0])
0 64 default branch default branch
1 96 default branch (register 0x3f800000) image_sample_d: 96 / 96 correct
2 96 default branch (0x40000000) four lz taps: 96 / 96 correct

Separate probes on main also pass for each piece on its own:

  • v_cmpx_eq_u32 then image_sample_d: 128 pixels, masked pixels untouched;
  • ds_swizzle quad-perm and bit-mode derivatives, including 16 reads from helper lanes;
  • the four lz taps;
  • image_sample_lz_o.

A possible reason the retail branches drew nothing then (a guess, not tested): the bisect and 58309b9 came before #211 (f17a5ee, merged at f159441). #211 keeps small render targets that the CPU fills (glyph caches) in step with the GPU. If that title's font texture is one of those, branches 1 and 2 sampled an empty texture before #211, and the converted value's default branch drew the text red instead. A run of the bit copy (58309b9 reverted) on current main would show it.

Tested

  • RTX 5070 Ti, NVIDIA 610.74, native D3D12, DXC 1.7.2308.16, main 60565c4 with test-only additions (not pushed).
  • The table's fixture: main gives the default branch for all 192 selector-1 and selector-2 pixels. The bit-copy control gives 256 / 256 correct words, branches and payloads.

Not tested

  • AMD.
  • The retail title or its shader.
  • Whether its font texture is CPU-filled.

🤖 GPT-6.2 Astra, Claude Opus 5.5

<!-- greyfinch-sync:ivall/xcl:issue:6569550319 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/249). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-23T21:50:59Z. --- A follow-up to the #107 regression in HANDOFF ("XDefiant's UI text"). That thread is closed, so I'm opening this instead. **In a synthetic reproduction of that UI shader's pattern, the ISA's bit copy takes the right branches and both draw correctly on `main`.** So on NVIDIA at least, the instructions inside the branches aren't what drew nothing. The fixture is a translated console VS and PS pair: - The VS exports `int4 RenderType` (as `int4 p2`) next to float attributes. - The PS reads it with `v_interp_mov_f32 P0`, compares it with 1 and 2 (`v_cmpx_eq_u32`), and gives each branch its own output: - branch 1: `image_sample_d` with explicit gradients; - branch 2: four `image_sample_lz` taps at offsets built from `ds_swizzle` derivatives. | VS value | pixels | `main` (converted, `58309b9`) | only the P0 read changed to `asuint(xi.a2[0])` | |---|---:|---|---| | 0 | 64 | default branch | default branch | | 1 | 96 | default branch (register `0x3f800000`) | `image_sample_d`: 96 / 96 correct | | 2 | 96 | default branch (`0x40000000`) | four `lz` taps: 96 / 96 correct | Separate probes on `main` also pass for each piece on its own: - `v_cmpx_eq_u32` then `image_sample_d`: 128 pixels, masked pixels untouched; - `ds_swizzle` quad-perm and bit-mode derivatives, including 16 reads from helper lanes; - the four `lz` taps; - `image_sample_lz_o`. **A possible reason the retail branches drew nothing then** (a guess, not tested): the bisect and `58309b9` came before #211 (`f17a5ee`, merged at `f159441`). #211 keeps small render targets that the CPU fills (glyph caches) in step with the GPU. If that title's font texture is one of those, branches 1 and 2 sampled an empty texture before #211, and the converted value's default branch drew the text red instead. A run of the bit copy (`58309b9` reverted) on current `main` would show it. ### Tested - RTX 5070 Ti, NVIDIA 610.74, native D3D12, DXC 1.7.2308.16, `main` `60565c4` with test-only additions (not pushed). - The table's fixture: `main` gives the default branch for all 192 selector-1 and selector-2 pixels. The bit-copy control gives 256 / 256 correct words, branches and payloads. ### Not tested - AMD. - The retail title or its shader. - Whether its font texture is CPU-filled. 🤖 GPT-6.2 Astra, Claude Opus 5.5
Conrage commented 2026-11-24 11:05:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Conrage on 2026-11-24T10:07:26Z.


2e67909 ("Recompiler: preserve flat pixel parameter bits (#249)") on main makes V_INTERP_MOV_F32 P0 keep the parameter's bits and adds a GPU regression test for signed and unsigned selectors. Is anything left here, or can this be closed?

AI use: checked by Claude Code (Claude Opus 5.5) at my request.

<!-- greyfinch-sync:ivall/xcl:comment:7128346463 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/249#issuecomment-7128346463). Originally posted by [Conrage](https://github.com/Conrage) on 2026-11-24T10:07:26Z. --- 2e67909 ("Recompiler: preserve flat pixel parameter bits (#249)") on main makes `V_INTERP_MOV_F32 P0` keep the parameter's bits and adds a GPU regression test for signed and unsigned selectors. Is anything left here, or can this be closed? AI use: checked by Claude Code (Claude Opus 5.5) at my request.
DavidM1911 commented 2026-11-24 11:06:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T10:55:48Z.


Confirming on main: 2e67909 ("Recompiler: preserve flat pixel parameter bits (#249)") is merged and adds the GPU regression gpu_ps_p0_reads_flat_integer_selectors covering signed and unsigned selectors through V_INTERP_MOV_F32 P0, plus retained P2 interpolation coverage. That is the instruction pattern this issue's synthetic repro isolated, so the recompiler side looks done; what remains unverified is only the retail title itself. Safe to close unless someone wants to keep it open for a retail run.

AI use: checked by Devin (Cognition, SWE-2) at the author's suggestion thread.

<!-- greyfinch-sync:ivall/xcl:comment:7129430702 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/249#issuecomment-7129430702). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T10:55:48Z. --- Confirming on `main`: `2e67909` ("Recompiler: preserve flat pixel parameter bits (#249)") is merged and adds the GPU regression `gpu_ps_p0_reads_flat_integer_selectors` covering signed and unsigned selectors through `V_INTERP_MOV_F32 P0`, plus retained P2 interpolation coverage. That is the instruction pattern this issue's synthetic repro isolated, so the recompiler side looks done; what remains unverified is only the retail title itself. Safe to close unless someone wants to keep it open for a retail run. AI use: checked by Devin (Cognition, SWE-2) at the author's suggestion thread.
ivall commented 2026-11-24 11:06:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T11:03:02Z.


The synthetic recompiler case is addressed by 2e67909 and its GPU regression test. The retail title itself remains unverified.

<!-- greyfinch-sync:ivall/xcl:comment:7129588452 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/249#issuecomment-7129588452). Originally posted by [ivall](https://github.com/ivall) on 2026-11-24T11:03:02Z. --- The synthetic recompiler case is addressed by 2e67909 and its GPU regression test. The retail title itself remains unverified.
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
xcl-dev/xcl#246
No description provided.