Revert "Recompiler: eliminate local array and branches in pixel-shader PRELUDE::rla()" (#2247) #2929
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2929
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2929"
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?
@Decodere on GitHub · 2026-11-27 00:29 UTC · original
Decodere:revert-2247-rla-branchless→main· +6 −127 · 1 files · 1 commits · openClean revert of #2247 (
5081dc8b6e22fc74f6fe7d31de333182e8f7ec92, merged in2898511), restoring the exact pre-#2247PRELUDE::rla()implementation incrates/xcl/src/gpu/recomp/emit.rs.Reverts #2247
Related to #1452
In #1452#issuecomment-7205972665,
@SergeAxbisected 140 first-parent merges onmain(568e7db..b49be18) on an RTX 5080 (NVIDIA driver 621.14, Windows 10 22H2) and isolated #2247 (2898511) as the first commit introducing0x887a0005(DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT) during retail world load (f9f6d49/ #2257:0/4removals;2898511/ #2247: removed). Confirmation onb49be18+ #1435 hit6/7device removals with5081dc8bpresent versus0/5removals with only5081dc8breverted.Note on branch ancestry:
5081dc8bis also an ancestor oforigin/nvidia-dev(ecc0bb57) andorigin/amd-dev(bf7c82ee), so maintainers may want to cherry-pick or merge this revert into those branches once landed onmain.What is in it
git revert 5081dc8b6e22fc74f6fe7d31de333182e8f7ec92(crates/xcl/src/gpu/recomp/emit.rs,+6/-127lines):xcl_lv[min(h >> 5, 3u)], scalar?:forq/r, and theif (nib != 0u && ...)/if ((l >> 2) == ...)guards in pixel-shaderPRELUDE::rla().#2247-specific branchless-rla()unit tests added by5081dc8b, leaving all otheremit::tests::andgpu::recomp::tests intact.Tested
rustc 1.100.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5, debug (WARP) and release (RTX 4060).cargo clippy --all-targets -- -A clippy::approx_constant: exit 0, 0 new warnings and 0 errors incrates/xcl/src/gpu/recomp/emit.rs.XCL_WARP=1):cargo test -p xcl --lib -- gpu::recomp::emit::tests:: --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored (0 skipped).cargo test -p xcl --lib -- gpu::recomp:: --test-threads=4: 398 passed, 0 failed, 20 ignored (23 expectedSKIPPEDnotices: 20 wave64, 3 per-lane refusals).cargo test --release -p xcl --lib -- gpu::recomp::emit::tests:: --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored (0 skipped).cargo test --release -p xcl --lib -- gpu::recomp:: --test-threads=4: 398 passed, 0 failed, 20 ignored (23 expectedSKIPPEDnotices: 20 wave64, 3 per-lane refusals).cargo build --release --workspace && cargo test --release --workspace --no-fail-fast -- --test-threads=4: 1439 passed, 0 failed, 47 ignored across 37 top-level test targets (29 expectedSKIPPEDnotices: 21 wave64, 3 per-lane refusals, 3 D3D12 debug layer, 1 heap-window fallback, 1 Windows driver-cache toggle).git merge-tree --write-tree origin/main HEADexits0against liveorigin/main(8b957bec).Regression run
Paired quiet 60 s release runs (
scripts/smoke.ps1 -Seconds 60,XCL_NETWORK=0, default flags, RTX 4060 8 GB, driver 621.14) on exact parent onmain(e120925e, ancestor of8b957bec) and revert head (a87d3c2a):Exact parent on
main(e120925e, ancestor of8b957bec):PR (
a87d3c2a):Not tested
@SergeAx's RTX 5080 (Blackwell, Win10 22H2) world-load0x887a0005removal from #1452 (#1452#issuecomment-7205972665already verified0/5removals with5081dc8breverted vs6/7without it).d3d12SDKLayers.dllnot installed), and Linux / Wine / vkd3d-proton.AI use
5081dc8bbranch ancestry (main,nvidia-dev,amd-dev), prepared the cleangit revertcommit offe120925e, ran clippy, Debug WARP + Release RTX 4060 unit/recompiler/workspace suites and paired 60 s retail smokes on the hardware above, and drafted this PR description.@JJAutoCompare on GitHub · 2026-11-27 01:00 UTC · original
Tested
Clean PR head
a87d3c2ac52bac1e7d2df4e6050171fb2dee0887and parente120925e3abc9956a8b9bae631969d32e8ccd43con Intel Arc A770 driver 32.0.101.9175, Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC and DXC/DXIL 1.9.2602.17. Built withcargo test -j 2 --locked -p xcl --lib --test console_shaders --no-run --message-format=jsonusing separate target directories,CARGO_PROFILE_TEST_DEBUG=0andCARGO_INCREMENTAL=0.With
XCL_ADAPTER=A770, ran the libtest executable with--exact --nocapture --test-threads=1for each of the following checked-in synthetic tests under the shared Arc mutex.gpu::recomp::tests::gpu_ps_masks_hold_helper_lanes_on_triangle_edgesgpu::recomp::tests::gpu_ps_readfirstlane_loop_on_a_primitive_edge_endsgpu::recomp::tests::gpu_ps_mask_loop_on_a_primitive_edge_endsgpu::recomp::tests::gpu_ps_helper_lanes_see_ballots_and_quads_are_lanes_4kAll four passed on both revisions, with zero failures, ignores or skips. The derivative and loop cases reported no pixel mismatches. The ballot/quad test matched the expected layout across 1,024 pixels and ballot values in the tested helper neighbors. The parent-only
gpu::recomp::emit::tests::gpu_rla_pixel_shader_matches_reference_including_helper_lanesalso passed all 1,024 pixel assertions.Not tested
Retail crash, performance, native wave64 hardware, full workspace suite and retail smoke.
AI use
T3 Code / Codex (
gpt-6.2-solfor the worker run) built and ran the fixtures. Codex in the coordinator session reran the four shared GPU tests and the parent-only control and drafted this report.@DarkPanda69 on GitHub · 2026-11-27 01:03 UTC · original
AMD and RTX 3060 run, moved here since #2930 closed as a duplicate. Its diff is byte-identical to this one (
a87d3c2), so the results apply here.Tested: pass, the diff applied on
main8b957be, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17,XCL_DIRECT_DXILunset (the HLSL path), card picked withXCL_ADAPTER.cargo test -p xcl --lib -- gpu:: --test-threads=4 --nocapture,mainand the revert one after the other on each card:main708 passed, 2 failed, 6 SKIPPED; revert 705 passed, 2 failed, 6 SKIPPED. The 2 failures arefuzz_validate_and_gpu_1and_3(#2115), the same onmain.main710 passed, 0 failed, 24 SKIPPED; revert 707 passed, 0 failed, 24 SKIPPED.On both cards the only differences are the three #2247 tests the revert removes. The SKIPPED sets are the same. This doesn't touch the Blackwell world-load removal; I have no RTX 50 card.
Not tested: a title run, an RTX 50 card, Windows 10, release, Intel.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@throny on GitHub · 2026-11-27 01:48 UTC · original
Testing this now on
nvidia-dev(ecc0bb57+ #684 + #2794, RTX 4080 16 GB, driver 621.40): the revert applies cleanly there, shaders are being re-translated for it, then two world runs against two runs of the same build without it. On this head our device losses (0x887a0005, no DRED breadcrumbs) came 147 s and 588 s after the first frame; details in #2688. I will post the four results here and on #1452. AI use: Claude Code (Claude Fable 5.2).@SergeAx on GitHub · 2026-11-27 01:49 UTC · original · edited 2026-11-27 06:24 UTC
Test report:
a87d3c2aon the RTX 5080 from #1452: no device removal in 5 of 5 runs. All of them passed the world-load step at 99–128 s and ran to 240 s without a crash.Tested
a87d3c2awith #1435's14c8a2dcherry-picked (461eddc8; #1435 only changeshle/xg.rs, for the title's crash at ~98 s in #662),cargo build --release -p xclXCL_PRESS_A_AT=20,24,…,140 XCL_DRED=1 XCL_NETWORK=0, warm caches:mainb49be18with #1435 lost the device after the step in 6 of 7 runs.b49be18with #1435 and this revert, whoseemit.rsis identical toa87d3c2a's, lost it in 0 of 5.Not tested
e120925e(this PR's base) with #1435 but without the revert; the removal rate above is fromb49be18, 3 merges olderAlso on
nvidia-dev, which still contains #2247:ecc0bb57+ this PR's commit + #1435's14c8a2d(9ff0bc8a), same machine, release.XCL_PREPARE=0 XCL_DRED=1 XCL_NETWORK=0and the same presses: 1800, 600, 1800, 240 and 240 s, the two short ones withXCL_PAGE_MAPPINGS=0orXCL_DISPATCH_LOOP_BUDGET=0.mainruns above, and less than in @throny's runs here, which kept drawing withXCL_GFX_PSO_WAIT_MS=200and still lost the device with the revert. These runs do not contradict that.XCL_GFX_PSO_WAIT_MS=200is going now; I will add how it ends.nvidia-devwithout this commit on this card.AI use: Claude Code (Claude Opus 5.5) built the tree, ran the title unattended, read the logs and wrote this report.
@throny on GitHub · 2026-11-27 03:34 UTC · original
Result on
nvidia-dev(ecc0bb57+ #684 + #2794), RTX 4080 16 GB, driver 621.40, Windows 11 26300, 64 GB RAM without a page file - same save,XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_GFX_PSO_WAIT_MS=200 XCL_TEXTURE_LEVEL_PAGES=1 XCL_CS_PSO_WAIT_MS=200, up to 700 s from the first game frame, shaders re-translated for the revert (12,101 pixel shader records in 26 min, 0 errors):So with the revert the title lived more than twice as long in both runs, but one of the two still lost the device (again without DRED breadcrumbs, see #2920, and without an Aftermath dump). Two runs a side is thin: it agrees with the bisect in #1452 in direction, and it shows that on this card the revert alone is not the whole story. In the longer runs the next limit is commit: 45.6 GB at 352 s and 51.7 GB at 265 s, against about 40 GB at 150 s in the runs without it.
I can add runs if a larger sample helps the decision here; say how many. Numbers are from the logs of these runs. AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this.
@throny on GitHub · 2026-11-27 04:55 UTC · original
More runs, same setup as the table above: without the revert a third run lost the device at 146 s (so 147, 156, 146 s). With the revert, two further runs on
a5e2d851that also carried a portedXCL_CHAIN_WHOLE=1prototype lost it at 212 s and 202 s (so 352 s, not within 265 s, 212 s, 202 s). The revert still roughly doubles the time to the loss here and does not remove it; the last two differ from the first two by the extra switch and the newer base, so they are not a clean repeat. AI use: Claude Code (Claude Fable 5.2).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.