LEONIDA_TWIN_BIAS (1bb188cf, on by default) breaks the picture on an RX 7900 XT (RDNA 3) #2702
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by Yassan01 on 2026-11-30T08:34:31Z.
Summary
Since
1bb188cf("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=0on the same build makes every frame clean again.Setup
diagbuild (--features diagnostics,mimalloc), Series X profile, 2560x1440 output, ray tracing off-SeriesX -NoDlss -NoFrameGen), plusLEONIDA_SHADER_LOOP_LIMIT=4096How it was narrowed down
Each step: build,
leonida shaders+warm --used, a run withLEONIDA_CAPTURE+LEONIDA_CAPTURE_WORLD=1, the prison-cell frames looked at.32b9f4a3: cleanbbd45f5c(main, 2026-11-30): broken in every rungit bisectover the 32 commits touchingd3d12/cratesandd3d12/apps:d9a75eb8: clean936843f5: cleanb5cb6f58: broken605379ac: clean1bb188cf(TWIN_BIAS) andff1874c6(helper counts by turns)bbd45f5cwithLEONIDA_TWIN_BIAS=0: clean, so1bb188cfis the one.The broken builds also had the card busier: about 36-38 ms a frame, against about 30 on
32b9f4a3in the same scene.Possibly relevant
The commit message says the change was made for an RX 6800, where
move_rawnever 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 wheremove_rawcannot apply, or default it off until checked on RDNA 3.Workaround
LEONIDA_TWIN_BIAS=0.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-30T15:53:28Z.
Opened #2757 fixing three bugs in the LEONIDA_TWIN_BIAS (
1bb188cf5) 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).