Skip to content

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

Done

Description

@Kalmarv

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

Activity

  1. Conrage commented on Nov 24, 2026

    @Conrage

    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.

  2. DavidM1911 commented on Nov 24, 2026

    @DavidM1911
    Contributor

    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.

  3. ivall commented on Nov 24, 2026

    @ivall
    Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions