Skip to content

LEONIDA_TWIN_BIAS (1bb188cf, on by default) breaks the picture on an RX 7900 XT (RDNA 3) #2702

Done

Description

@Yassan01

Summary

Since 1bb188c ("d3d12: raw twins off 16 bytes kept with a bias the shaders add (LEONIDA_TWIN_BIAS)"), the d3d12 runtime renders badly on an RX 7900 XT: stretched triangles across the screen, whole frames black, white, yellow or magenta, blocky noise, and a blown-out window. LEONIDA_TWIN_BIAS=0 on the same build makes every frame clean again.

Setup

  • AMD Radeon RX 7900 XT (RDNA 3), driver 32.0.32029.2010, Resizable BAR on
  • Ryzen 7 5800X3D, 32 GB, Windows 11 (build 26200)
  • d3d12 diag build (--features diagnostics,mimalloc), Series X profile, 2560x1440 output, ray tracing off
  • Settings: play-nvidia.ps1's Series X set (-SeriesX -NoDlss -NoFrameGen), plus LEONIDA_SHADER_LOOP_LIMIT=4096
  • Scene: the opening cutscenes into the prison cell (Continue from the save), standing

How it was narrowed down

Each step: build, leonida shaders + warm --used, a run with LEONIDA_CAPTURE + LEONIDA_CAPTURE_WORLD=1, the prison-cell frames looked at.

The broken builds also had the card busier: about 36-38 ms a frame, against about 30 on 32b9f4a in the same scene.

Possibly relevant

The commit message says the change was made for an RX 6800, where move_raw never applied. On this RDNA 3 card the biased twins (or the stride-word bias bits 24..27 the translated programs add) seem to give wrong reads, which would explain geometry stretched to infinity and whole frames of garbage. Untested idea: limit the bias to cards where move_raw cannot apply, or default it off until checked on RDNA 3.

Workaround

LEONIDA_TWIN_BIAS=0.

Activity

  1. zmasi commented on Nov 30, 2026

    @zmasi
    Contributor

    Opened #2757 fixing three bugs in the LEONIDA_TWIN_BIAS (1bb188c) path (sub-dword �y % 4 != 0 raw twins accepted by settle_twin, 32-bit unsigned wrap-around on sentinel offset + bias wrapping into the 16-byte pre-view prefix of the preceding suballocation, and stale twin-bias bits on recycled dynamic slots).

    AI-assisted: Gemini 4 Carbon (High), reviewed with Gemini 4 Neon (XHigh).

  2. added a commit that references this issue on Nov 30, 2026
    de66085
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