Skip to content

Recompiler: pixel shader loops end on primitive edges (helper lanes) - #2305

Merged
ivall merged 2 commits into
xcl-dev:mainfrom
madaraXor:recomp-readfirstlane-live-lane
Nov 25, 2026
Merged

ivall merged 2 commits into
xcl-dev:mainfrom
madaraXor:recomp-readfirstlane-live-lane

Conversation

@madaraXor

@madaraXor madaraXor commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

In a pixel shader EXEC holds helper lanes (s_wqm). On AMD's Windows driver (RX 6700 XT, RDNA2) a helper lane's registers stop being kept inside loops: once a wave op ran in a loop, or from a loop's second pass when the shader has another loop before it, everything a helper lane holds reads as 0. Two shapes of console loop then never end, and run every lane to the loop budget:

  • a loop whose state is carried in a vector register and read back with v_readfirstlane (v_mov v, s … v_readfirstlane s, v) when the first lane of EXEC is a helper lane: it reads 0 back each time round;
  • a loop that goes on as long as a lane is left in a mask taken from EXEC (s_andn2 mask, mask, vcc; s_cbranch_scc1): a helper lane's "done" condition comes from registers that no longer change, so its bit stays in the mask.

A retail title's spot-light volumetric pass has both. On this card it was the draw running when the GPU was reset at the title's world start (#675, comment 7158635084): 72 vertices × ~6 000 instances, running for seconds. Part of #675.

What is in it

  • Recompiler: v_readfirstlane in a pixel shader reads a live lane first (gpu/recomp/emit.rs): first_lane_live reads the first lane of EXEC that is live (ballot(true), per half in the wave32-in-64 form) when EXEC has one, else the first lane of EXEC as before. The value is the same: the console's compiler reads the first lane of a value equal in every lane, or of a lane it then removes from EXEC. Test gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends (gpu/recomp/tests.rs).
  • Recompiler: a lane-mask test in a pixel shader counts live lanes only (gpu/recomp/emit.rs): in a pixel shader the SCC of s_and_b32 / s_andn2_b32 with EXEC or VCC as an operand or destination counts the live lanes only (mask_live); the helper lanes leave the loop with the live ones (they only feed derivatives of live lanes, which have left too). Test gpu_ps_mask_loop_on_a_primitive_edge_ends.

Both tests draw the loop shape on two triangles sharing a diagonal, so that waves on it start with helper lanes, and check every pixel's pass count.

Tested

  • AMD Radeon RX 6700 XT 12 GB (RDNA2, driver 32.0.21045), Ryzen 5 5600X, 16 GB RAM, Windows 10 22H2 (19045), rustc 1.90.0; debug tests, release smoke. On 8fcc111 (these two commits on main 06c9f55).

  • The new tests, alone, on this card:

    test lanes per wave the driver used without the change in emit.rs with it
    gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends 32 69 of 1024 pixels run 65 536 passes (the budget) 0 wrong, at most 16 passes
    gpu_ps_mask_loop_on_a_primitive_edge_ends 64 256 of 1024 pixels run 65 534 passes 0 wrong

    (For the second, "without" was run with its HLSL-text assertion on mask_live removed, so the GPU result shows.)

  • The title's volumetric draw, replayed alone from a capture of it on this card (a local capture/replay tool, not part of this PR): before, the device was removed after 4 852 ms; with the loop budget lowered to 1024, 782 passes per lane on average. With both commits and the full budget: 7.20 passes per lane, 13 at most, 13.8 ms of GPU time.

  • The title itself (a local tree with other open PRs, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1): with both changes the world drew for about 25 s, up to 30 presents, 7 900 draws and 47 000 dispatches per 2 s, and the volumetric draw never showed among the slow ops; before, the GPU was reset in that draw within seconds of the world start in every run. The run then ended in another GPU reset that the profiler did not name; that is not this PR.

  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1263 passed, 4 failed, 46 ignored. The 4: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 540), hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory (Tests: align XMemVirtualQuery buffers and verify CPU flags #650), and the e2e tests test_title_runs_and_game_folder_is_untouched, test_title_draws_with_a_root_signature_under_the_debug_layer; they fail on main on this machine too. SKIPPED: the six per-lane cases of f16_programs_on_the_gpu / f32_programs_on_the_gpu (refused), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).

Regression run

scripts/smoke.ps1, 60 s, release builds, run back to back.

main:

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: AMD Radeon RX 6700 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 770 (PresentX 771)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19836 MB

PR:

xcl-smoke v1
commit: 8fcc11131f9fe3daec6cfb207bacf87f73f75463
gpu: AMD Radeon RX 6700 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 684 (PresentX 684)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17519 MB

Not tested

  • The smoke runs reach this code only where the menus' pixel shaders use these patterns; the world, where the volumetric pass runs, is past their 60 s.
  • On an RX 9070 XT (RDNA4) a tester saw the first test run its pixel shader in 64-lane waves and 5 pixels still wrong with the first commit alone; this driver runs that test in 32-lane waves, so I could not check whether the second commit changes that.
  • NVIDIA / Intel: on a driver that keeps helper lanes' values in loops, both changes give the same results.
  • 64-bit lane-mask ops (wave64 pixel programs), masks kept only in SGPR copies, execz / vccz branches and the direct DXIL graphics path are unchanged.

AI use

  • Claude Code with Claude Fable 5.2 (the reproductions, the cause, both changes and their tests, the capture/replay used to find the second) and Claude Opus 5.5 (the runs in the title, the rebase, the test runs and this description).

🤖 Generated with Claude Code

@DarkPanda69

DarkPanda69 commented Nov 25, 2026 •

Copy link
Copy Markdown

Update for head 8fcc111 (rerun as asked by @madaraXor): the new mask test passes on RDNA4, the readfirstlane test still has the same 5 wrong pixels.

Head 8fcc111 as is (on main 06c9f55), debug, cargo test -p xcl --lib -- _on_a_primitive_edge_ends --test-threads=1 --nocapture, RX 9070 XT 3 runs, RTX 3060 1 run:

RX 9070 XT (RDNA4, 64-lane waves) RTX 3060 (32-lane waves)
gpu_ps_mask_loop_on_a_primitive_edge_ends (new) ok, 0 of 1024 pixels wrong, 3 of 3 runs ok, 0 wrong
gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends fails, 5 of 1024 wrong, most iterations 16, 3 of 3 runs: the same 5 pixels with the same values as on 6ec402b (listed below) ok, 0 wrong

So the second commit doesn't change the readfirstlane case on 64-lane waves. Whole gpu:: filter at this head: RX 9070 XT 639 passed, 3 failed (the readfirstlane test plus the #2115 fuzz seeds); RTX 3060 642 passed, 0 failed.


With 64-lane pixel waves the new test still fails: the loop now ends, but 5 pixels are wrong. On an RX 9070 XT (RDNA4) the driver runs this test's pixel shader in 64-lane waves (lane counts {64}), where your RX 6700 XT ran it in 32-lane waves.

Tested: head 6ec402b applied on main afc5ee8, debug, Windows 11 Pro 26200, cargo test -p xcl --lib -- gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends --test-threads=1 --nocapture:

RX 9070 XT (32.0.32029.2010), 64-lane waves RTX 3060 (32.0.16.1088), 32-lane waves
test only, without the emit.rs change 74 of 1024 pixels wrong, most iterations 65536 (the budget) (not run)
with this PR 5 of 1024 pixels wrong, most iterations 16, same 5 pixels in 3 of 3 runs 0 wrong, ok

The 5 pixels with this PR (iterations, wave OR, own word, lane count):

(19, 20, [13.0, 65143.0, 4104.0, 64.0])
(19, 21, [13.0, 65143.0, 8200.0, 64.0])
(30, 30, [10.0, 16368.0, 16448.0, 64.0])
(31, 30, [10.0, 16368.0, 16512.0, 64.0])
(31, 31, [10.0, 16368.0, 32896.0, 64.0])

So the change ends the runaway loop on 64-lane waves too (no pixel reaches the budget any more), but at least two 64-lane waves on primitive edges finish with a wave OR (65143, 16368) that misses some live lanes' words: on these pixels the loop stops after 10 or 13 passes while their own word is not yet in the OR.

Whole gpu:: filter with this PR: RX 9070 XT 629 passed, 3 failed (this test, plus the AMD fuzz seeds tracked in #2115, which fail on main too); RTX 3060 632 passed, 0 failed.

Not tested: RDNA2/RDNA3 in 64-lane pixel waves, a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

@fromthemoonx

fromthemoonx commented Nov 25, 2026 •

Copy link
Copy Markdown

Rerun on the new head 8fcc111 (rebased onto main 06c9f55, plus the lane-mask commit): passes on NVIDIA. Here too both new GPU tests pass without their fix, so on this card only the mask_live text check catches a missing fix.

result
cargo test --workspace --no-fail-fast -- --test-threads=4 at 8fcc111 1267 passed, 0 failed, 46 ignored; 25 SKIPPED lines (no wave64, refused per-lane forms)
gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends, 10 runs 10 of 10 ok, lane counts {32}; most iterations 16; 0 of 1024 pixels wrong
gpu_ps_mask_loop_on_a_primitive_edge_ends, 10 runs 10 of 10 ok, lane counts {32}; 0 of 1024 pixels wrong
that test with emit.rs from 0306d10 (the second fix removed), 3 runs fails at tests.rs:9495, the assert!(pt.hlsl.contains("scc = (uint)(mask_live(")) text check
same, with that one assert also removed (scratch), 3 runs ok 3 of 3, 0 of 1024 pixels wrong

The driver ran these pixel shaders in 32-lane waves, so this card runs the 32-bit s_and_b32 / s_andn2_b32 forms the new commit changes. As with the first commit, the driver keeps the helper lanes' values in the loop, so the GPU result is the same with or without the change.


First run, on 6ec402b: Whole suite passed on NVIDIA (wave32), at the head and merged onto main 379725a, and the new test passed here without the fix too. At the head: 1251 passed, 0 failed, 46 ignored. Merged: 1255 passed, 0 failed, 46 ignored. gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends passed 10 of 10, and 3 of 3 with only the emit.rs call reverted to first_lane (0 of 1024 pixels wrong).

Tested: RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.

Not tested: a title, a release build, Intel.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

@SlopTart

Copy link
Copy Markdown

Third AMD data point, Linux/RADV (RDNA3) over Wine: the new test fails deterministically, 39 of 1024 pixels wrong.

Tested: origin/main 379725ae + PR head 6ec402b1 (merge c76cb974, no conflicts). Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, official MS DXC (binaries 2026-09-29).

  • gpu_ suite (--release --locked, --test-threads=2): 142 passed / 4 failed / 1 ignored. The 3 other failures are this rig's known baseline (fuzz seed 1003 of DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115, gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_depth_buffer_created_for_unordered_access_is_placed), so the PR's only net change on this rig is its own new test.
  • gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends solo, --exact --test-threads=1: red 3 of 3.
  • Failure signature from the test's own line: 39 of 1024 pixels wrong; most iterations 21 (the bit loop should need at most 16); first bad pixels e.g. x=4,y=6 with iterations 21, wave OR 1057746300, own word 16400; WaveGetLaneCount() reads 64 for every pixel (adapter: AMD Radeon RX 7900 XT (RADV NAVI31)).

This lines up with DarkPanda69's shape: the loop now ends, but pixels are still wrong, and the hardware wave runs 64 lanes even though the recompiler emits the wave32-in-64 form. On RDNA3 with Mesa 26.2.5 the damage is larger (39 wrong pixels, some past the 16 iteration bound) than their RDNA4 observation (5).

Not tested: Windows on this card; RDNA2.

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

@nnonno91

nnonno91 commented Nov 25, 2026 •

Copy link
Copy Markdown

@madaraXor I retested both pixel-loop fixtures on the updated head 8fcc11131f9fe3daec6cfb207bacf87f73f75463 with the same Windows/DXC setup as below and added the RTX 5090 (driver 32.0.16.1742).

  • cargo test --locked -p xcl --lib _loop_on_a_primitive_edge_ends -- --nocapture --test-threads=1 on each adapter selected via XCL_ADAPTER. Both runs reported 2 passed, 0 failed, 0 ignored, no skips.
  • Radeon iGPU: the new mask-loop test reported 64 lanes and 0 of 1,024 pixels wrong. The readfirstlane test reported 32 lanes, 0 of 1,024 pixels wrong, and a maximum of 16 iterations.
  • RTX 5090: both tests reported 32 lanes and 0 of 1,024 pixels wrong. The readfirstlane test again hit at most 16 iterations.

This covers 64-lane execution of the mask test on this Radeon driver. The 64-lane readfirstlane case and retail-title hang were outside this run.


Independent Windows Radeon iGPU check of exact PR head 6ec402b16a2d5ce076361a1fb6d01cfa7e15370b and parent 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6. This driver ran the pixel shader in 32-lane waves on both revisions and reproduced the 69-pixel failure before the fix.

Tested

  • AMD Radeon(TM) Graphics iGPU, driver 32.0.21042.62, Ryzen 7 9800X3D, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, Windows SDK DXC/DXIL 1.8.2502.11, unoptimized test profile.
  • cargo test --locked -p xcl --lib gpu::recomp::tests::gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends -- --exact --nocapture --test-threads=1 with XCL_ADAPTER=AMD Radeon and XCL_REQUIRE_GPU=wave64. The test itself read back the pixel shader wave size as 32. The parent had only the PR's test source diff applied temporarily.
  • Parent: 69 of 1,024 pixels wrong, maximum 65,536 loop iterations. Test result was 0 passed, 1 failed.
  • PR head: 0 of 1,024 pixels wrong, maximum 16 iterations. Test result was 1 passed, 0 failed. Both runs had 0 ignored and no skips.

Not tested

64-lane execution of this pixel shader, other adapters, retail smoke, and the full workspace suite.

AI use

OpenAI Codex (GPT-6.2 Sol) ran the tests, verified the logged results and wrote this report.

@ivall

ivall commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

On AMD RDNA4, Windows, DXC 1.8.2502.11 the pass still hung the GPU with this PR in my run, and a loop budget of 1024 for that one shader went past it. Same title and shader as in your description. (Edited: the first version of this comment said two runs and "nothing else changed"; both were wrong.)

  • Your test here: lane counts {64}; most iterations 16; 5 of 1024 pixels wrong, the same five pixels as DarkPanda69's report (it fails, so I am not merging the PR as it is).
  • In the title: one run with this PR merged (and D3D12.X: a draw does not wait for a graphics pipeline still being built #1798, draws do not wait for their pipelines) ended in 0x887a0006 at the same DrawIndexedInstanced as two runs without this PR: the spot light volume's draw (the pixel shader of your description). A run with this PR and without D3D12.X: a draw does not wait for a graphics pipeline still being built #1798 did not reach the draw (the title waited on compiles) and says nothing.
  • Experiment: the same tree with the HLSL of that shader compiled with static uint xcl_budget = 1024u instead of 1u << 16. The card passed the draw and drew frames of the world for ~100 s; that run ended in 0x887a0007 with no list left unfinished. The last two of those runs also left out big compute programs that were not built (XCL_PSO_IMAGE_SKIP=1, and programs over a size cap refused), so I cannot say the budget alone did it; the first, with only the budget, had not reached the draw when I stopped it.
  • [WaveOpsIncludeHelperLanes] with ps_6_7 and entry EXEC, live-lane reads from !IsHelperLane() gave the same five wrong pixels in your test, so that attribute does not fix it here.

My reading, not tested: the whole-wave OR reductions (s_or_saveexec -1, v_cndmask, dpp8 x3, dpp row_mirror, permlanex16, readlane 0) lose live lanes' words on a partly covered 64-lane wave, so the loop range is wrong. A recogniser that lowers them to a wave op over the half's live lanes is what I would try.

AI use: Claude Code (Claude Opus 5.5) ran this and wrote the comment on the maintainer's behalf.

madaraXor and others added 2 commits November 25, 2026 15:51
In a pixel shader EXEC holds helper lanes (s_wqm), and on a primitive's
edge the first lane of EXEC is often one. v_readfirstlane read that lane.
An RDNA2 driver (RX 6700 XT, 32.0.21045) gives 0 for everything a helper
lane holds once a WaveReadLaneAt ran inside a loop, quad reads included.
A loop whose state the console's compiler carries in a vector register
(v_mov v, s ... v_readfirstlane s, v) then read 0 back on each pass and
ran to the loop budget: a retail title's volumetric light pass took
seconds per draw at its world start and Windows reset the GPU (xcl-dev#675).

v_readfirstlane now reads the first lane of EXEC that is live
(ballot(true), per half in the wave32-in-64 form) when EXEC has one, and
the first lane of EXEC as before when it has none. The value is the same:
the console's compiler reads the first lane of a value equal in every
lane, or of a lane it then removes from EXEC (a waterfall loop).

The new GPU test draws that title's list-loop shape on two triangles
sharing a diagonal. Without the change, on the RX 6700 XT, 69 of 1024
pixels run the loop 65 536 times (the budget) with wrong results; with
it, none, and at most 16 passes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retail title's volumetric light pass (72 vertices x 6003 instances) ran
nearly every lane to the loop budget on an RX 6700 XT, and Windows reset
the GPU at its world start (xcl-dev#675). Replayed alone from a capture of that
draw: with the budget at 1024, 782 loop passes per lane on average, 99 %
of them in the march loop that follows the light list; the light list's
data was sane.

The march goes on as long as a lane is left in a mask taken from EXEC
(s_andn2 mask, mask, vcc; s_cbranch_scc1). Probes in the replayed HLSL
showed the helper lanes' registers right through the first pass and
reading as 0 from the second pass on (their pass counter included) when
the shader has another loop before the march; the driver ran it in
64-lane waves. A helper lane's "done" condition then never became true,
its bit stayed in the mask and the live lanes waited for it.

In a pixel shader, the SCC of s_and_b32 / s_andn2_b32 with EXEC or VCC as
an operand or destination now counts the live lanes only (mask_live):
the helper lanes leave the loop with the live ones. Helper lanes only
feed derivatives of the live lanes, which have left too.

Replay of the captured draw with the full budget: 7.20 passes per lane,
13 at most, 13.8 ms of GPU time, no device removal (before: removed after
4 852 ms). gpu_ps_mask_loop_on_a_primitive_edge_ends draws that loop
shape on two triangles sharing a diagonal: without the change, 256 of
1024 pixels run to the budget on the RX 6700 XT (64-lane waves); with it,
none.

Not changed: 64-bit mask ops (wave64 pixel programs), masks only kept in
SGPR copies, the direct DXIL path.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
@madaraXor
madaraXor force-pushed the recomp-readfirstlane-live-lane branch from 6ec402b to 8fcc111 Compare November 25, 2026 15:00
@madaraXor madaraXor changed the title Recompiler: v_readfirstlane in a pixel shader reads a live lane first Recompiler: pixel shader loops end on primitive edges (helper lanes) Nov 25, 2026
@madaraXor

Copy link
Copy Markdown
Contributor Author

Thanks for the runs. Updated to 8fcc111 (rebased on main 06c9f55), with a second commit for what was left in 64-lane waves:

  • Recompiler: a lane-mask test in a pixel shader counts live lanes only. In a pixel shader, the SCC of s_and_b32 / s_andn2_b32 with EXEC or VCC now counts only the live lanes. On this RX 6700 XT, the helper lanes' registers also read as 0 from a loop's second pass on, so a loop that runs while a lane is left in a mask taken from EXEC never ended. New test: gpu_ps_mask_loop_on_a_primitive_edge_ends. Here the driver runs it in 64-lane waves: 256 of 1024 pixels run to the budget without the change, and none with it.
  • In the title, the two commits together end the volumetric pass's hang on this card. The world drew for about 25 s, then hit an unrelated reset.

@DarkPanda69, @SlopTart: could you rerun both gpu_ps_*_on_a_primitive_edge_ends tests at the new head on RDNA4 and RADV? I can't reproduce the 5 / 39 wrong pixels here, because this driver runs the readfirstlane test in 32-lane waves.

AI use: Claude Code (Claude Opus 5.5) wrote this comment.

@SlopTart

Copy link
Copy Markdown

@madaraXor rerun at the new head on the Wine/RDNA3 lane, as asked.

Head: 8fcc1113 (both commits) merged onto current origin/main, clean merge.
Env: Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), x86_64-pc-windows-gnu under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC.

  • New test gpu_ps_mask_loop_on_a_primitive_edge_ends: passes on this lane (in the gpu_ suite, no failure recorded).
  • gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends: still fails, 3/3 solo runs, same assertion (crates/xcl/src/gpu/recomp/tests.rs:9432). Shape changed though: lane counts {64}, most iterations now 32 (the loop ends; it is no longer running to the budget), still 39 of 1024 pixels wrong, first entries changed values, e.g. (4, 6, [13.0, 4278239200.0, 16400.0, 64.0]), (12, 14, [25.0, 4290692000.0, 16400.0, 64.0]) (iterations, wave OR, own word, lane count).
  • Suite on this head: 142 passed / 5 failed / 1 ignored. Five failures = the rig's three baseline reds (fuzz seed 1003 of DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115, gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_depth_buffer_created_for_unordered_access_is_placed) + the known wave32-prefix flake (solo 2/2 green on the sibling branch today) + this test.

So the live-lane mask commit fixed the mask-loop case for this driver (64-lane waves, RADV, Wine) but the readfirstlane case still lands 39 wrong pixels here, now with different per-pixel values than at the first head. Consistent with the NVIDIA lane (wave32) never seeing it: this remains a wave64 readfirstlane-selection issue on AMD.

AI use: Hermes agent (local Qwen-class) ran the rig and drafted this; I checked it before posting.

@ivall

ivall commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Merged as part of main with your second commit, plus one of mine on top (12f25f1, below). It fixes my test too, so my earlier comment about 5 wrong pixels is out of date.

  • Tested on the merged tree: AMD RDNA4 (64-lane pixel waves), Windows, DXC 1.8.2502.11, debug. gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends and gpu_ps_mask_loop_on_a_primitive_edge_ends: 0 of 1024 pixels wrong in both, most iterations 16. cargo test --workspace --no-fail-fast -- --test-threads=4: 1265 passed, 2 failed (DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115, as on main), 46 ignored.
  • The other cause, in my commit: the whole-wave OR reductions in that pass (s_or_saveexec -1, v_cndmask, three DPP8 steps, row mirror, v_permlanex16, v_readlane 0) pass partial results through lanes that were never launched. Here those lanes do not exist, so a 64-lane wave that is not full lost the words of live lanes: 5 wrong pixels of 1024 in your test before it, 0 after. A wave32 VS / PS now takes the reduction from a wave operation over its half, and a helper lane from a live lane of its quad. Integer OR / AND / min / max with their identity as the seed; nothing else is touched.
  • In the title: the earlier commit of yours (without 8fcc111, with mine) ran 306 s from start (about 180 s of them in its world) with no device removal in the log, with the loop budget of this shader at 4096. It ended when the machine ran out of memory and froze, which is a separate problem of that build. The final state has not been run in a title yet.

Read before the merge: both commits.

AI use: Claude Code (Claude Opus 5.5) wrote the second commit, ran the tests and wrote this on the maintainer's behalf.

@ivall
ivall merged commit 7906df7 into xcl-dev:main Nov 25, 2026
3 checks passed
@SlopTart

Copy link
Copy Markdown

All-clear follow-up: gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends now passes on this lane, 3/3 solo runs, at origin/main 08294413 (so with 12f25f14 included). Same rig and env as the failing rows above (RX 7900 XT / RADV / wine-11.0, wave64): lane counts {64}, most iterations 16, 0 of 1024 pixels wrong.

So 12f25f14 closed the 39-pixel case on RDNA3 under Wine as well; the RDNA3/Wine lane is back to its normal baseline.

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

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants