Recompiler: a pixel shader's carry ballot reads its quad lane by lane, not through quadOp #3455
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3455"
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 ivall/xcl. Originally posted by ArtuArtaza on 2026-11-29T19:40:40Z.
On an RX 6700 XT the retail title (TitleID 7952987A, Series S profile) ends at its first world load:
unhandled exception 0xc0000005 in amdxc64.dll(a null read) about 1 ms into the build of one graphics pipeline, the one of pixel shader record7381166e806847c9. It is the same on drivers 32.0.21030.2001 (+0x65d678) and 32.0.21045.29003 (+0x671f78), with one pipeline worker too, and 3,000+ other graphics pipelines build fine before it.The cause is in the direct translator's pixel-shader ballot outside compares (
Lw::ballot_ps: carry masks and the like). It collected its quad's 4 bits throughQuadReadAcrossX/Y/Diagonal(quadOp). In this PS 10 of its 27 such ballots take a value that derives fromWaveReadLaneAt. That is the driver bug the compare path already avoids (#134,lower_valu: "amdxc64 crashes on quadOp of values derived from WaveReadLaneAt"); this path was not covered. The ballot now reads its quad with 4QuadReadLaneAt, as the compare path does. Related: #134, #2996.Rebased on main
9dfbe3ea. #3501 had addednote_own_bittoballot_pssince the first head (8363f77a), and that head returned before it: the two merged without a conflict, but the new form then tested a lane's own bit through the mask's word, and helper lanes drew another value than in thequadOpform. saintwolf found it (16 pixels of the GPU test, on an RTX 4070 SUPER; I get the same 16 on RDNA2). Both forms now end in the sameballot_ps_quad+note_own_bit.How it was narrowed (on
fa204595with local per-PS debug switches, not in this PR): the pipeline builds without its PS (397 ms); it still dies without blending and in the plain wave64 form. With the ballots lane by lane, the same VS and description (byte-identical) and a PS that differs only inquadOp81 → 0,quadReadLaneAt172 → 280 build in 4.3 s.How to test
git fetch origin pull/3455/head:pr-3455,git checkout pr-3455,cargo build --release -p xcl. Nothing to clear: an edit ofgpu/dxilchanges the translations' cache identity, and the driver builds again only the pixel shaders whose DXIL changed.mainwithXCL_PREPARE=0 XCL_PSO_TRACE=1 XCL_ACTIVITY=1(I usedXCL_DEVICE_TYPE=lockhart) and go into the world. It isunhandled exception 0xc0000005 in amdxc64.dllright afterdriver compile start …: graphics PSO, … record 7381166e806847c9, and the process ends. Here that came 4 – 7 minutes in on a cold driver cache, most of them without frames (the wait of #2996).driver compile finishfor that record and goes on.cargo test -p xcl --lib ps_ballot_tests(its GPU test draws both forms and compares the pixels) and ascripts/smoke.ps1pair.driver compile startline before a crash.What is in it
crates/xcl/src/gpu/dxil/lanes.rs:ballot_psorsquad_read_lane_at(cond, p) << pforpin 0..4 (bitpis the quad's memberp, whichown << (lane & 3)relied on too), then records the own bit as before. Only tests can ask for thequadOpform (cfg(test)). NoTRANSLATOR_VERSIONbump: agpu/dxiledit changes the direct translations' cache identity by itself.lanes.rs:direct_ps_non_vopc_carry_ballot_reads_its_quad_lane_by_lane(was..._uses_quad_op) checks both forms' DXIL, also with the carry's operand coming throughv_readfirstlane, and thatv_cndmasktakes the carry itself in both;gpu_direct_ps_carry_ballot_draws_the_same_lane_by_lane_as_through_quadopdraws a carry mask, its DPPddx(helper lanes on the triangles' edge) and the mask's bit of the lane to the right (from the mask's word) in both forms, and compares every pixel; away from that edge it also compares with the known values.crates/xcl/src/gpu/dxil/kernel.rs: the test-only choice of the form is handed to the translator's thread, likeNO_SELECT_FOLD.Tested
cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4(with--nocapture, on this tree just before it was committed as4dd68427): 2881 passed, 7 failed, 51 ignored (44 test binaries). The 7 are 6 tests, and all 6 failed with the same values on unmodified main9dfbe3eaon this card (ran them there alone, for4dd1796f; not again for4dd68427):gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form(what #3473 fixes),gpu_direct_image_get_resinfo_d16(see #3513),f32_programs_on_the_gpu,gpu_f32_compares_with_nan,gpu_float_compares_random(all three ingpu/recomp), andtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(parent and child run). 4SKIPPED(2 no heap windows, 1 no GPU_UPLOAD heaps, 1 cannot disable the driver cache).cargo test -p xcl --lib ps_ballot_testson the same tree: 9 passed, 0 failed. On4dd1796f: withnote_own_bittaken out of the new form both changed tests fail (the v_cndmask tests the mask's word; 32 pixels differ). WithXCL_ADAPTER=warp: 9 passed, the 3 GPU tests of the moduleSKIPPED(no wave32 / no wave64).8363f77a, against its main0fe06eb0; not repeated on9dfbe3ea): the retail title,XCL_DEVICE_TYPE=lockhart XCL_PREPARE=0 XCL_PSO_TRACE=1, A pressed every 15 s from 30 s, 720 s, one run each:0fe06eb0:driver compile start #3221: graphics PSO, 138304 B DXIL, record 7381166e806847c9at 259.6 s, the null read inamdxc64.dll+0x671f78at 260.3 s, the process ends (exit 0xc0000005).8363f77a: the pipeline of record7381166e806847c9(138944 B of DXIL) builds and the run ends by itself at 720 s (exit 0x0, 3075 frames), 0 device removals, 0 pipelines rejected. The driver took 2797 ms for it the first time (at 237.0 s, onebcc28f5) and 1 ms from its cache in that run (at 167.6 s).v_readfirstlanevalue) does not crash this driver in thequadOpform, so there is no small reproduction: the tests check the form and the pixels, not the crash.Regression run
60 s (menus, the pipeline is not reached),
scripts/smoke.ps1,XCL_DEVICE_TYPE=lockhart XCL_PREPARE=0, A pressed at 30 s and 45 s: main9dfbe3ea(this PR's merge base, which ran first), then this PR's head.Not tested
4dd1796f: maind0832e61dies on this record on an RX 9070 XT (RDNA4) and an RDNA2 iGPU, and with this PR it builds on both.ps_ballot_testson an RTX 5070 Ti is in the comments, from before #3501.)quadOp); the 60 s frame counts above are my only measure. In the comments, 60 s, one run per side: 101 % of main's frames on an RTX 5070 Ti, 93 % on an RTX 3090 (cold cache).AI use
XCL_PS_BALLOT_QUADOPswitch after review, and wrote this version of the description. All on my machine; the PR was submitted from my Claude Code session at my request, with me present.🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-29T19:57:06Z.
Ran the pixel-shader carry-ballot tests at
8363f77aon an NVIDIA Blackwell desktop part.System
Results
XCL_ADAPTER=NVIDIA cargo test -p xcl --lib ps_ballot_tests -- --test-threads=1: 8 passed, 0 failed, 0 ignored.What this adds
All eight tests pass, including the GPU draw that compares the
QuadReadLaneAtform against thequadOpform pixel by pixel, with carry masks and helper lanes on triangle edges. The author's run was on an AMD RX 6700 XT, where the crash occurs; this is an independent NVIDIA datapoint on driver 32.0.16.2140. The current head is8363f77a, not theebcc28f5named in the description. The AMD driver crash itself was not reproduced here.Not tested
A retail title, an AMD adapter, a paired smoke run, the full workspace suite here, native wave64 hosts, Wine, release profile, game data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - ran the commands above on this machine and wrote this report; no game data was used.
Imported from ivall/xcl. Originally posted by moombathepilot on 2026-11-29T20:08:32Z.
merge-check
base:
0fe06eb0f0head:
8363f77a0bmerge: clean. Tested local trial merge
5d268fbb10cb842b9df2626185fe2ed61b642c78.build:
cargo build --workspaceandcargo build --release -p xcl-> ok.tests:
cargo test -p xcl --lib ps_ballot_tests -- --test-threads=1 --nocapture-> 8 passed, 0 failed, 0 ignored, 0 skipped. The GPU draw matched both ballot forms pixel by pixel on RX 7800 XT, including triangle-edge helper lanes, in wave32 and wave64.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture-> 2,736 passed, 2 failed, 49 ignored. There were 12 explicitSKIPPEDnotices: 6 unsupported per-lane f16/f32 cases, 2 no heap windows, 3 missing D3D12 debug layer, and 1 driver cache could not be disabled. Both failures matched earlier targeted runs on this exact unmodified base and machine:fuzz_validate_and_gpu_1(seed 722) andtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(two-pass state release assertion).review: Read the full diff. The lane-by-lane lowering preserves the quad bit positions and reuses the existing quad ballot assembly. The disassembly test also covers the carry input derived from a lane read.
git diff --cached --checkpassed. GitHub's Windows build check passed. The PR description check remains red, and the supplied PR-side smoke blocks still nameebcc28f.performance: 60-second release smokes on the Series S profile, title
817b32af, withXCL_PREPARE=0, networking off, and no input. Both exited 0 with zero crashes and device removals.A separate 300-second trial-merge run used the same profile, PSO tracing, and scheduled A presses starting at 30 seconds. It exited 0 with 2,491 presents, zero crashes or device removals, and 27,803 MB peak commit. The last three two-second windows had zero presents. The affected record
7381166e806847c9did not appear in the trace, so the run leaves that pipeline and world entry unverified on RDNA3. Frame cost of the extra quad-lane read was not isolated.verdict: not yet: the PR description check is failing on the current head, and the specific retail pipeline remains unverified on this AMD setup.
hardware / tool and model: Radeon RX 7800 XT (driver 32.0.32029.2010), Ryzen 7 5700X3D, Windows 11 Home build 26300, Rust 1.100.0 x86_64-pc-windows-msvc, DXC 1.9.2602.17. Codex (GPT-6, exact variant unavailable) verified refs, reviewed the diff, ran the build, tests and smokes, compared baseline logs, and drafted this report.
Reviewed by the posting user before submission.
Imported from ivall/xcl. Originally posted by ArtuArtaza on 2026-11-29T20:15:24Z.
@moombathepilot thanks for the merge-check. On your two points:
8363f77a: the suite, both PR-side smoke blocks and the 720 s run were redone on it, and the three checks are green. (The first headebcc28f5failed CI because my new GPU test drew on the runner's software adapter; it now skips there, as its neighbours do.)7381166e806847c9between 168 s and 260 s once the driver's cache has the compute programs that come before it, and at 386 s the first time on a cold cache; most of that wait is without frames. A 720 s run withXCL_PSO_TRACE=1and the A presses was enough here. On main look fordriver compile start …: graphics PSO, … record 7381166e806847c9followed by theamdxc64.dllexception; with the PR, adriver compile finishfor the same record. If your driver builds it on main too, RDNA3 does not have this bug, which would be worth knowing as well.@Aniseto thanks for the NVIDIA run.
Written with Claude Code (Claude Fable 5.2), from my runs on the hardware in the description.
Imported from ivall/xcl. Originally posted by moombathepilot on 2026-11-29T20:19:33Z.
Thanks, that explains it: my 300 s run was likely too short. I still need to run 720 s on main and the trial merge to check record 7381166e806847c9 on RDNA3. ETA 21:45UTC
Imported from ivall/xcl. Originally posted by JR-Wiederkehr on 2026-11-29T20:40:37Z.
Confirmed test run on Radeon 7700XT, gets past 7381166e806847c9 shader without crashing at [143.158].
Imported from ivall/xcl. Originally posted by moombathepilot on 2026-11-29T22:19:52Z.
merge-check
base:
1bd9cee1e5head:
8363f77a0bmerge: clean, trial merge bfa9aef78b7dad5c356c992f3876ba91ef2c4f2e. Main advanced again during testing. The description now names this head in both PR-side smoke blocks, and the latest three GitHub checks are green.
build:
cargo build --workspacepassed on the merge. Both release builds passed.tests:
cargo test -p xcl --lib ps_ballot_tests -- --test-threads=1 --nocapturegave 8 passed, 0 failed, 0 ignored, 0 skipped. The full merge suite (cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture) gave 2,743 passed, 6 failed, 49 ignored, and 12 skip notices (6 unsupported per-lane f16/f32 cases, 2 no heap windows, 3 missing debug layer, 1 driver-cache control unavailable). Fuzz seed 722 and the two-pass cache test matched failures on the exact base. Four texture tests failed in the merge suite (one subtraction overflow, three poisoned locks). The texture group rerun gave 65 passed, 0 failed, 1 ignored on both builds. The full base lib run aborted with0xc0000409, so the four failures could not be classified in a like-for-like full-suite comparison.review: The live head is unchanged from the previous merge-check, which covers the diff review. Both 720 s traces logged the shader record: base
[52.589] [SHADER] ps 7381166e806847c9, merge[53.057] [SHADER] ps 7381166e806847c9. Neither trace logged a graphics PSO compile start or finish for it or an AMD driver exception. Pipeline behavior and world entry remain unverified here.Each trace had unique numbered starts and finishes, with no finish lacking a start. One start in each trace had no matching finish. These were also the last driver compile lines:
After the last nonzero present window, base logged 76 starts and 76 finishes, and merge logged 7,554 of each. These are independent event counts in that interval, so a finish can belong to a start before the cutoff. Both traces continued logging completed compute, compute-pass, mesh and graphics PSOs. The unmatched starts do not establish a hang or its cause.
performance: Series S profile, title
817b32af,XCL_PREPARE=0 XCL_PSO_TRACE=1 XCL_NETWORK=0, A every 15 s starting at 30 s. Sequential base then merge, with caches retained and recorded before each run. Both exited0x0after the 720 s timer, with zero crashes and device removals. Base: 2,545 presents, last nonzero sample ending at 128.400 s, 29,229 MB peak commit. Merge: 2,575 presents, last nonzero sample ending at 130.474 s, 30,949 MB peak commit. Neither resumed presenting after that gap. These are two-second sample timestamps. Presents stopped at about the same point on both builds, so these runs do not show the stall as specific to this PR. The first baseline attempt missed the timer because of environment inheritance in the smoke harness. It was excluded and the pair was restarted with the timer set before launch.On my RX 7800 XT, neither build logged a compile start for record 7381166e806847c9 within 720 s. Does your run use any settings, cache preparation or input timing that differ from mine? The existing driver and XCL caches were retained. Before base and merge respectively, AMD DxCache had 263 files in both, AMD DxcCache had 207 files in both (13.56 and 13.76 GB), Windows D3DSCache had 770 files in both, and XCL DXIL had 130,666 and 130,671 files. XCL logged its driver-blob disk cache as off on AMD. The two unmatched compiles above were for other compute records.
verdict: not yet: the target graphics pipeline was not observed compiling on either build, and the four suite-only texture failures remain unresolved.
hardware / tool and model: Radeon RX 7800 XT (32.0.32029.2010), Ryzen 7 5700X3D, Windows 11 Home build 26300, Rust 1.100.0 MSVC. Codex (GPT-6, exact variant unavailable) verified refs and checks, ran the builds and tests, compared the traces, and drafted this report.
Imported from ivall/xcl. Originally posted by ArtuArtaza on 2026-11-29T22:39:57Z.
@moombathepilot thanks for the second run. My settings are the same as yours (Series S,
XCL_PREPARE=0,XCL_PSO_TRACE=1, network off, A every 15 s from 30 s, no cache preparation step). What differs is how warm the driver's cache was:0fe06eb0run that crashed at 260 s, this machine had done a 60 s, a 240 s and a 330 s run of that main and a 60 s and a 240 s run of the PR. Neither the 240 s nor the 330 s main run reached the pipeline (the 330 s one sat in big compute compiles until its end). Each run left more of those compute programs in AMD's cache, and the next one got further.fa204595, right after a driver update) the compile start for record7381166e806847c9came at 386 s, after about 200 s without frames.@JR-Wiederkehr thanks. Was that run on this PR or on main? If it was the PR: a run of unmodified main that reaches the same record would tell whether RDNA3 has this crash at all. A
driver compile finishfor it on main would rule it out for that driver; theamdxc64.dllexception would confirm it. The same goes for anyone on RDNA4.On the four texture failures: I cannot tie them to this change, which only touches pixel-shader translation. On this machine texture upload tests (
title_texturesgpu_*) fail now and then at--test-threads=4on unmodified main too (fa204595, about one run in six) and pass alone. I have not seen an overflow or poisoned locks here: both suite runs on this PR's heads had only the two-pass cache test failing.Written with Claude Code (Claude Fable 5.2), from my runs on the hardware in the description.
Imported from ivall/xcl. Originally posted by ArtuArtaza on 2026-11-30T03:22:00Z.
Status on head
8363f77a: not a draft, no conflict withmain, all three checks green, no review asking for changes. What it still lacks is in other people's hands, so three requests.@moombathepilot thanks for both merge checks. Could you look at the verdict again? On the two reasons in the second one:
title_texturesgpu_*tests fail about one run in six at--test-threads=4on unmodifiedmainand pass alone, and this PR only touches pixel-shader translation (gpu/dxil/lanes.rs). If a like-for-like base run is what you need, the lib binary alone (cargo test -p xcl --lib --no-fail-fast -- --test-threads=4) on the base is enough to classify them.If something in the diff itself worries you, say so and I will fix it.
@JR-Wiederkehr thanks for the RX 7700 XT run. To count as a test report it needs the commit you ran (this PR's
8363f77a, ormain), the driver version, and the suite counts if you ran any (cargo test -p xcl --lib ps_ballot_testsis 8 tests). Whether it was the PR ormainmatters most: adriver compile finishfor record7381166e806847c9on unmodifiedmainwould show RDNA3 does not have the crash.Anyone with an RX 6000 card (RDNA2): this is the hardware that can confirm the fix. On
main,XCL_PREPARE=0 XCL_PSO_TRACE=1 XCL_ACTIVITY=1into the world ends withunhandled exception 0xc0000005 in amdxc64.dllright afterdriver compile start …: graphics PSO, … record 7381166e806847c9; with this PR the same record logsdriver compile finish. It can take several runs with the driver cache kept before the title asks for that pipeline. A merge check from such a machine is welcome as the hardware the first check did not have.I cannot queue my own PR on #3041. If someone who has read it thinks it belongs there, the request would be
importance: crash.Written with Claude Code (Claude Fable 5.2), from my runs on the hardware in the description.
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T14:06:05Z.
merge-check claim
head:
8363f77a0bImported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T14:27:40Z.
merge-check
base:
github.com/xcl-dev/xcl@9dfbe3ea66head:
github.com/xcl-dev/xcl@8363f77a0bmerge: clean (trial merge f2b7ad1173bced603287998e9cdfa3f2d57cc847; git diff --check clean; +136/-15 in gpu/dxil/lanes.rs and kernel.rs)
build: cargo build --workspace -> ok (39 pre-existing warnings, none from the PR's files)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2885 passed, 2 failed, 51 ignored (lib 2737/2/31, integration 148/0/20); SKIPPED: 27 (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"); failing: (1) gpu::dxil::lanes::ps_ballot_tests::gpu_direct_ps_carry_ballot_draws_the_same_lane_by_lane_as_through_quadop — new in this PR, absent on base; fails here, deterministically (also run alone): wave64=false leg, 16 pixels differ between the two forms, all in output channel 1 (DPP ddx of the masked carry value minus the value): e.g. (16,17) [16.5,-16.5,16.5,17.5] vs [16.5,1.0,16.5,17.5] — the lane-by-lane form's adjacent-lane DPP read returns 0.0 (the no-carry value) where the quadOp form returns the neighbor's masked value; the test's earlier assert (the carry mask is held, channel 0) passes in the new form; the differing readers sit on/below the main diagonal (x = y and x = y-1, odd y 17..31). (2) gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 — pre-existing here: fails identically on base
github.com/xcl-dev/xcl@9dfbe3ea66(same "2D D16 resinfo clobbered v2/v3" assertion), untouched by this PR.review: (1) the PR's new GPU parity test fails on my hardware (NVIDIA Ada, wave32-only); per the thread it passes on RDNA2, RDNA3 and an RTX 5070 Ti (Blackwell — also wave32), so this is Ada-specific, not a wave32-vs-wave64 effect; (2) the new default path (ballot_ps) returns before the self.note_own_bit(lo, hi, cond) that the quadOp path still calls: a carry ballot's own bit is no longer recorded, so a later masked op extracting this lane's bit of that mask falls back to a shift+and of the mask word (ISA/ALU cost, no correctness change); (3) the kernel.rs change is cfg(test)-only plumbing forwarding QUAD_OP_IN_TEST to the translator thread (mirrors the existing NO_SELECT_FOLD pattern); (4) the opt-out env XCL_PS_BALLOT_QUADOP=1 is OnceLock-cached and off by default; on-disk translations keep the form they were made with (documented in the diff); (5) open https://github.com/xcl-dev/xcl/pull/3429 adds tests to the same ps_ballot_tests module in the context this PR rewrites — expect a small rebase conflict for whichever lands second; (6) duplicate scan: no open or merged PR makes this change, no https://github.com/xcl-dev/xcl/issues/1607 group covers it, https://github.com/xcl-dev/xcl/pull/3405/https://github.com/xcl-dev/xcl/pull/3429 are adjacent compare-path work.
performance: the default form replaces andc+shl+3 quadOp with 4 quadReadLaneAt+4 shlc (+3 ops per PS carry ballot, wave-uniform code) and drops the note_own_bit shortcut from review (2); no memory change; not measured — Tier 1, no retail run.
verdict: not yet: the PR's own new GPU parity test fails on NVIDIA Ada (RTX 4070 SUPER, driver 32.0.16.2140, wave32) — 16 px differ between the lane-by-lane and quadOp forms, in the DPP-derived channel at the mask boundary; deterministic; passes on RDNA2/RDNA3/Blackwell per the thread. Needs the author's call: investigate Ada helper-lane quad-read visibility, or relax the parity assert with a documented exception.
hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0, DXC 1.8.2502.11 (23992152) / OpenCode, Qwen 3.8 27B
Imported from ivall/xcl. Originally posted by ArtuArtaza on 2026-11-30T16:22:46Z.
@saintwolf thanks, the failure is real, and it is not Ada-specific: the old head merged into
9dfbe3eagives the same 16 pixels on my RX 6700 XT. The cause is your point (2). #3501 addednote_own_bitat the end ofballot_psafter that head was written, and its early return skipped it. So the new form tested each lane's own bit through the mask's word, and helper lanes drew another value than in thequadOpform. The earlier runs that passed were from before #3501.4dd1796fis rebased on9dfbe3ea, and both forms now end in the sameballot_ps_quad+note_own_bit. The two tests changed too: the DXIL test checks thatv_cndmasktakes the carry itself in both forms, and the GPU test also reads the mask's word (the bit of the lane to the right), because with the own bit noted the old program no longer did. Both fail without the line and pass with it. The suite and the 60 s pair are in the description; the 6 tests that fail fail with the same values on unmodified9dfbe3eahere.One thing next to it, in main and not in this PR: a pixel shader that reads a mask's word whole (a live
WaveActiveBitOr), ends indiscard(!exec)and reads a neighbour through DPP gets 0 from helper lanes on triangle edges here, in both forms, and also as hand-written HLSL. I think it is because a lane's EXEC bit there comes fromWaveActiveBallot, whose result in helper lanes is undefined. The GPU test therefore only asks the two forms to agree on those edges.What I could not run is NVIDIA:
cargo test -p xcl --lib ps_ballot_testson your card would tell whether the mask's word holds there too.(Change and reply written by Claude Code with Claude Opus 5.5, sent from my account.)
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-30T16:31:44Z.
New head
4dd1796f: the pixel-shader carry-ballot tests run and pass here. This is a new response in the same thread; my earlier report at8363f77a(https://github.com/xcl-dev/xcl/pull/3455#issuecomment-7261687690) covered the first head and is not edited.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, DXC 1.9.2609.5, debug build,
XCL_ADAPTER=NVIDIA, detached worktree at the exact PR head, no local patches.The three named tests pass on this Blackwell desktop part with 16 GB of VRAM and driver 621.40, on a head rebased onto
9dfbe3eawhere#3501addednote_own_bit. My earlier run was on the first head,8363f77a, so this is a second NVIDIA host and a second head for the same tests.Not tested: the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, the title and paired smoke runs, game data.
AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-01T04:08:32Z.
merge-check
base:
d0832e614fhead:
4dd1796fb2merge: clean (trial merge 1df769bb3c9607491ae2e018ed46881b1dcfbe3a;
git diff --checkclean; +172/−22 ingpu/dxil/lanes.rsandkernel.rs)build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2883 passed, 9 failed, 51 ignored. SKIPPED: 6 (2× no heap windows, 1× driver cache needs Windows Developer Mode, 3× no D3D12 debug layer), the same as base. Failing: the same 8 tests as on base
d0832e61on this card (2882 passed, 9 failed, 51 ignored there):fuzz_validate_and_gpu_1,fuzz_validate_and_gpu_3,gpu_smem_flat_descriptor_windows_and_limits,f32_programs_on_the_gpu,gpu_f32_compares_with_nan,gpu_float_compares_random,gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends, and the e2etwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(counted twice). All 9ps_ballot_testspass here, includinggpu_direct_ps_carry_ballot_draws_the_same_lane_by_lane_as_through_quadop(wave32 and wave64).review: none blocking; I read the whole diff.
ballot_psnow collects the quad with 4QuadReadLaneAtof the lane's 0/1 predicate, each shifted to its quad position. That's the same mask asown << (lane & 3)ORed with the 3QuadReadAcross*, and it still ends inballot_ps_quad+note_own_bit. The test override reaches the translator's thread throughkernel.rs. Minor:XCL_PS_BALLOT_QUADOP=1isn't part of the translation-cache identity, as its doc comment says (needsXCL_TRANSLATED_CACHE=0). Targeted check of the changed path: this is the pipeline behind #3544 on Windows/AMD, see below.performance: reasoned plus one run. Per ballot outside compares, 4 lane reads in place of 3
quadOp; the compare path already does it this way. With the defaultXCL_DIRECT_DXIL,maindoesn't get past 48 s here, so there's no frame comparison. The PR's 90 s run ended by itself with 2159 frames, and the target pipeline compiled in 561 ms.verdict: safe to merge
hardware / tool and model: AMD Radeon RX 9070 XT 16 GB (RDNA4, driver 32.0.32015.2008) and the Ryzen 7 9800X3D's iGPU (RDNA2 gfx1036, driver 32.0.21045.11001), 32 GB RAM, Windows 11 25H2 build 26200, rustc 1.100.1 / Claude Code (Claude Opus 5.5)
The changed path, on the retail title (release builds, default
XCL_DIRECT_DXIL,XCL_PSO_TRACE=1,XCL_PREPARE=0):maind0832e611df769bbdriver compile start #2182: graphics PSO, 70024 B DXIL, record 7381166e806847c9at 48.0 s, thenunhandled exception 0xc0000005 in amdxc64.dll+0x735dd8 (read at address 0x0)on the same thread at 48.1 s7381166e806847c9(70,444 B DXIL) compiles in 561 ms at 43.6 s; the run ends by itself, 2159 frames, no crashamdxc64.dll+0x671d88 (read at address 0x0)at 47.6 sCreatePlacedResourceX(0x887a0005), the same asmainwithXCL_DIRECT_DXIL=1on this iGPU (88.7 s), so not this PR. I take it to be the 2-CU iGPU's 485 MiB.This is #3544: on Windows/AMD, #3243's default crashes AMD's compiler on this pipeline, on RDNA4 and RDNA2.
Claude Code (Claude Opus 5.5) ran the merge, the build, the suite and the guarded title runs, read the diff and drafted this check. I checked it before posting.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:19:37Z.
merge-check
base:
7d86c5d2b7head:
4dd1796fb2merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2897 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+172/-22).
ballot_ps(lanes.rs ~923) now ORsquadReadLaneAt(own, p) << pfor the 4 quad lanes into the same bit layout as the oldown << (lane & 3)instead of usingquadOp, andnote_own_bitstays on both forms. On current main this holds: the PR base9dfbe3eaalready hasps_masks(f4ee8ac5), which only marks V_CMP compares, so carry ballots (v_add_coand the like) always takeballot_ps; the only dxil change since (44eeb0c7, the wave32 width fix) doesn't touch this path, so the #3429-style breakage doesn't apply. Findings: (1)XCL_PS_BALLOT_QUADOPadds an env switch outside the translation's cache identity, and the tests don't need it (they useQUAD_OP_IN_TEST); CONTRIBUTING puts env switches in their own PR. (2) The crash fix was only verified on the first head (8363f77a), and the frame cost of 4quadReadLaneAtvs 3quadOpper PS ballot isn't measured (both stated in the description). Fine: the DXIL test fails on main (no quadOp, 4 lane reads,v_cndmasktakes the carry itself), the GPU test compares both forms pixel by pixel including helper lanes on edges, and the AI use names exact models.performance: 60 s smoke of a retail title, main
7d86c5d2vs this merge (1fe65259): 1663 -> 1692 frames shown (101 %; last presents per 2 s: 60 60 61), peak commit 17153 -> 17123 MB, 0 device removals, 0 crashes. The smoke run is capped at 60 presents per second, so it doesn't measure the cost of 4quadReadLaneAtvs 3quadOpper pixel-shader ballot.verdict: not yet:
XCL_PS_BALLOT_QUADOPchanges the generated code but isn't in the translation's cache identity, so switching it serves stale cached shaders; drop it (the tests don't need it) or move it to its own PR with the identity. The fix itself passes here with a flat smoke runhardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:56:39Z.
Triage (#1607) – head
4dd6842No open or merged PR changes
Lw::ballot_psthis way. #3429 and #3405 also touch pixel-shader quad reads, but on the compare paths (lower_valu,lower_wide), not the non-compare ballot.No problems found in the diff: the lane-by-lane form ends in the same
ballot_ps_quad+note_own_bitas the old one, and only tests can ask for thequadOpform (QUAD_OP_IN_TEST, passed to the translator thread likeNO_SELECT_FOLD); there is noXCL_PS_BALLOT_QUADOPswitch any more.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by CharlyRien on 2026-12-01T13:37:14Z.
merge-check
base:
b2b1f109d2head:
4dd1796fb2merge: clean (local trial merge 399e44b0, not pushed;
git diff --checkclean; +172/-22 ingpu/dxil/lanes.rsandkernel.rs)build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (debug, on the merged tree) -> 2901 passed, 2 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 1 no heap windows (opt-in), 1 no heap windows, 1 no GPU_UPLOAD heaps); failing:
test_title_draws_with_a_root_signature_under_the_debug_layerandtest_title_runs_under_the_debug_layer_with_dred(e2e), both fail on baseb2b1f109alone too (2900 passed, the same 2 failed, 51 ignored).ps_ballot_testsin release on the GPU, GPU skips not allowed: 9 passed, 0 failed, both new tests included, no SKIPPED. This card has no wave64, sogpu_direct_ps_carry_ballot_draws_the_same_lane_by_lane_as_through_quadopran its wave32 legs only (its wave64 legs are left out without aSKIPPEDline).review: no blocking finding in the default path after reading the whole diff and the code around it. Most serious first:
XCL_PS_BALLOT_QUADOPis not part of any cache identity: neither the translated cache's (translated::identity_from_sourceinrecomp/pso.rs, which tagsXCL_DIRECT_COMPACT,XCL_DIRECT_COMPACT_NEST,XCL_X_LDS_ORDERandXCL_PER_LANEfor the same reason) norsemantic_pipeline_setting(warm library). The doc comment covers one direction (with the switch on, a cached translation keeps its old form unlessXCL_TRANSLATED_CACHE=0). The other direction is worse: a run withXCL_PS_BALLOT_QUADOP=1and the cache on writes its misses in thequadOpform under the default identity, and later default runs load that form, which is the one that crashes the RDNA2 compiler, until the direct translator's sources change. It is off by default, and the tests do not need it (they useQUAD_OP_IN_TEST). So I agree with the earlier check's point: drop the switch, or tag the identity the wayXCL_DIRECT_COMPACTis tagged (one line).493dbd3d+ #3528 + #3517 + local commits, before this PR), 411 of 2,886 direct-DXIL pixel-shader translations (351 distinct programs) have these ballots in thequadOpform: 25,329quadOpcalls, so about 8,400 ballots, up to 95 in one shader (ballot_psis the only place the direct translator emitsquadOp). With this PR each ballot reads its quad with 4QuadReadLaneAtinstead of 3quadOp.ballot_ps_quad(WaveActiveBit(Or)since #3501) is unchanged and used by both forms. (Counted offline withdxc -dumpbinover the cache. The shader we saw hang this card with #2571's forms off, https://github.com/xcl-dev/xcl/pull/3501#issuecomment-7311293228, has noquadOp, so this PR does not change it.)pisQuadReadLaneAt(cond, p) << p, asown << (lane & 3)ORed with the 3QuadReadAcross*. Helper lanes are read the same way, the constant-false shortcut is kept, and both forms end inballot_ps_quad+note_own_bit(the fix for the 16 pixels of the earlier head). Thekernel.rschange iscfg(test)only and hands the test's choice to the translator's thread, likeNO_SELECT_FOLD.v_readfirstlane. The GPU test compares both forms pixel by pixel, including helper lanes on the triangles' edge.Not covered here: the AMD crash itself (no AMD card), wave64 hardware, and this PR on plain main in the world (see performance).
performance: by default it adds 1 lane read per pixel-shader carry ballot (4
QuadReadLaneAtand their shifts instead of 3quadOpand one shift). The DXIL also grows in the 411 shaders above, which costs some driver compile time on a cold cache.Measured, 60 s
scripts/smoke.ps1, one run per side, the retail title,XCL_PREPARE=0, cold shader cache on both sides: baseb2b1f109543 frames, peak commit 15,844 MB; merged 505 frames (93 %), peak commit 16,191 MB (+347 MB, 102 %). 0 device removals and 0 crashes on both sides. These 60 s do not reach the world on this machine.World, one run with the PR's commit on our local tree (main
493dbd3d+ #3528ba8592a4+ #35170b4283d1+ 42 local commits, none inlanes.rsorkernel.rs), fresh shader preparation for each build, the same switches as our #3501 comment (XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_SPARSE_WINDOWS=4 XCL_GPU_WAIT_TIMEOUT_MS=45000 XCL_PREPARE=0and others): neither run left the loading screens in the 200 s after the first heavy draws (that tree is slow, see #2571); without the PR 0.23 presents/s, with it 0.22; 0 removals, no hang either way. One run per side, so this only shows no new hang or removal on NVIDIA, not a pace difference.verdict: not yet:
XCL_PS_BALLOT_QUADOPis outside the translated cache's identity (see review); a one-line fix, the default path passes herehardware / tool and model: NVIDIA GeForce RTX 3090 24 GB (driver 616.56, Resizable BAR off), AMD Ryzen 9 5950X, 32 GB, Windows 11 build 22631 / AI use: Claude Code (Claude Opus 5.5) ran the merge, the builds, the suite, both smoke runs, the world run and the offline DXIL count on this machine, read the diff and wrote this report; checked and posted by me.
Imported from ivall/xcl. Originally posted by Aniseto on 2026-12-01T15:25:38Z.
This is a new response on the same thread as my reports at
8363f77a(https://github.com/xcl-dev/xcl/pull/3455#issuecomment-7261687690) and4dd1796f(https://github.com/xcl-dev/xcl/pull/3455#issuecomment-7284815017); the head moved to4dd68427, so I am not editing those comments.Ran the
ps_ballot_testsmodule at4dd68427on an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build,
XCL_ADAPTER=NVIDIA, detached worktree at the exact PR head, no local patches.All nine tests pass here at the new head, the same count as at
4dd1796f: the GPU test that draws both ballot forms and compares every pixel, plus the lane-by-lane DXIL tests. The description's full workspace suite and the title smoke runs were not repeated; no title was run.Not tested: a retail title, the AMD crash scenario, the full workspace suite, Wine, Intel GPUs, release profile, game data.
AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by ArtuArtaza on 2026-12-01T15:30:22Z.
@Foniass @CharlyRien agreed on
XCL_PS_BALLOT_QUADOP: it was outside the translated cache's identity, so a run with it on could leavequadOptranslations for later default runs.4dd68427removes it. Only tests can select the old form now (cfg(test), likeNO_SELECT_FOLD), and the code XCL emits by default is the same as at4dd1796f.Run on an RX 6700 XT, on this same tree just before it was committed:
cargo test -p xcl --lib ps_ballot_tests -- --test-threads=1 --nocapture: 9 passed, 0 failed, 0 skipped.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 2881 passed, 7 failed, 51 ignored, 4SKIPPED. The 7 are the same 6 tests the description lists as failing on unmodified9dfbe3ea(I did not rerun them on main today).Smoke pair (
scripts/smoke.ps1, 60 s, release,XCL_DEVICE_TYPE=lockhart XCL_PREPARE=0, A at 30 s and 45 s), the PR's merge base first, then4dd68427, one run each. It shows no regression in the menus; it does not test the crash, which comes later than 60 s here.@Aniseto thanks for the run on the new head.
The description still names
4dd1796fand the switch; thePR descriptioncheck is red until it has the second block.(Change, runs and reply by Claude Code with Claude Opus 5.5, sent from my account.)
Imported from ivall/xcl. Originally posted by Gevroska on 2026-12-01T16:01:34Z.
@ArtuArtaza I confirmed the cache issue in both directions on
4dd1796f, merged locally intob2b1f109. I used the same synthetic wave32 carry shader in six fresh processes.XCL_PS_BALLOT_QUADOP=1returned the byte-identical default DXIL: 0quadOpand 9quadReadLaneAtcalls.XCL_PS_BALLOT_QUADOP=1, switching back to default returned the byte-identical alternate DXIL: 3quadOpand 5quadReadLaneAtcalls.Both warm hits skipped translation. With
XCL_TRANSLATED_CACHE=0, each direction rebuilt the requested form. Separately, the carry-ballot pixel-output test passed on my RTX 3080 with zero skips.This confirms the failure that removing the production switch in
4dd68427addresses. My local runs cover the earlier revision only.AI disclosure — Codex GPT-6.2 Sol ran the tests. A separate GPT-6.2 Sol agent verified the original artifacts. GPT-6.2 Astra drafted this comment.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by Gevroska on 2026-12-01T16:05:13Z.
merge-check
base:
6bfb5c5153head:
4dd6842738merge: clean (361bda0b)
build: cargo build --workspace passed
tests: 2,905 passed, 0 failed, 51 ignored. The suite also reported 28 runtime skips covering native wave64, heap windows, driver-cache control and the D3D12 debug layer. I disabled dev/test debug symbols on the retry after the first compile ran out of disk space. Test selection and assertions stayed the same.
review: All nine pixel-ballot tests passed on my RTX 3080. GPU readback matched the expected output for both lowering forms across eight literal-carry draws. The disassembly check also covered a carry derived from WaveReadLaneAt. Source review confirmed that the old XCL_PS_BALLOT_QUADOP switch is gone and the direct DXIL cache key changed.
performance: I ran one matched 60-second retail game startup on each revision, main first, with no inputs, on-demand shader compilation and a fresh XCL cache for each run. Main showed 1,301 frames (1,301 PresentX) and peaked at 15,844 MB commit. The merge showed 1,430 frames (1,431 PresentX) and peaked at 15,905 MB. Both exited cleanly with zero crashes or device removals. The NVIDIA driver cache was shared across runs, so I would use this pair as a startup regression check only.
verdict: not yet. The cache test stopped before GPU dispatch. I still can’t confirm cold or warm behavior on the revised head, or whether it rejects entries from the old alternate cache. The affected AMD RDNA2 driver also needs a check on that hardware.
hardware / tool and model: NVIDIA GeForce RTX 3080, driver 32.0.16.1692, Ryzen 7 5700X, Windows 11 Education 25H2 (26200.9457). OpenAI Codex GPT-6.2 Sol ran the tests. Independent Codex agents reviewed the source and evidence. Their exact models were not recorded. GPT-6.2 Astra drafted this comment.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by CharlyRien on 2026-12-01T16:20:01Z.
merge-check
base:
6bfb5c5153head:
4dd6842738merge: clean (local trial merge 875cebf8, not pushed;
git diff --checkclean; +164/-22 ingpu/dxil/lanes.rsandkernel.rs)build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (debug, on the merged tree) -> 2903 passed, 2 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 1 no heap windows (opt-in), 1 no heap windows, 1 no GPU_UPLOAD heaps); failing:
test_title_draws_with_a_root_signature_under_the_debug_layerandtest_title_runs_under_the_debug_layer_with_dred(e2e), the same 2 that fail on mainb2b1f109alone on this card (not rerun on6bfb5c51).ps_ballot_testsin release on the GPU, GPU skips not allowed: 9 passed, 0 failed, the PR's tests included, no SKIPPED.review: none blocking. 4dd1796f..4dd68427 changes only
lanes.rs: theXCL_PS_BALLOT_QUADOPswitch is gone, thequadOpform is reachable from tests only (QUAD_OP_IN_TEST,cfg(test)), so a cached translation can no longer get the old form under the default identity (the point of the earlier checks). Outside testsquad_opisfalse: the code XCL emits is the one I checked on4dd1796f(https://github.com/xcl-dev/xcl/pull/3455#issuecomment-7312909993, with its smoke and world runs). Tier 1 (translator only), so no new smoke or title run on this head.performance: as in my check of
4dd1796f(one more lane read per pixel-shader carry ballot; 60 s smoke there 93 % of main's frames, +347 MB peak commit, no removal); not remeasured on this head.verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3090 24 GB (driver 616.56, Resizable BAR off), AMD Ryzen 9 5950X, 32 GB, Windows 11 build 22631 / AI use: Claude Code (Claude Opus 5.5) ran the merge, the build, the PR's tests and the suite on this machine and read the diff; checked and posted by me.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T20:52:59Z.
Follow-up review (head
4dd68427, since4dd1796, diff read, not a merge-check):XCL_PS_BALLOT_QUADOPoutside the translation's cache identity: fixed. The switch andps_ballot_quad_opare gone; only tests can pick thequadOpform, through thecfg(test)cellQUAD_OP_IN_TEST(lanes.rs~19-24, ~916-919;kernel.rs~255-264), and other builds always emit thequadReadLaneAtform.4dd1796f, which a merge-check on the PR showed building on an RX 9070 XT and an RDNA2 iGPU wheremaincrashes. The cost of 4quadReadLaneAtagainst 3quadOpper pixel-shader ballot is still only covered by 60 s smoke runs capped at 60 presents per second, as Not tested says.New: none.
Fine: the lane-by-lane form sets bit
pfrom quad memberp, matching the oldown << (lane & 3)layout, and both forms end in the sameballot_ps_quad+note_own_bit; the DXIL test checks both forms in wave32 and wave64 with and without av_readfirstlaneoperand; the GPU test compares both forms pixel by pixel including helper lanes on the triangles' edge.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T06:43:41Z.
Code review location:
crates/xcl/src/gpu/dxil/lanes.rs; line 932Not certain about this one: the new form quad-reads every member's predicate without masking it by that member's EXEC bit, unlike the compare path it copies (lower_valu.rs:1344-1361 ANDs each member with
lanebit_at(el, eh, qbase|p)). In a quad where some lanes are hardware-inactive (after a discard/demote, or switched off by divergent control flow at the ballot),QuadReadLaneAtof those lanes is undefined, and that bit goes into the mask throughballot_ps_quad. A laters_cbranch_vccnz/s_and_saveexecon it can see lanes set that should be clear. The quadOp form had the same gap.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T06:43:41Z.
Review: COMMENTED
Review of
4dd68427: 2 finding(s). 1 are inline. These are on lines outside the diff:crates/xcl/src/gpu/recomp/emit.rs:6842: This only changes the direct translator. The HLSL path'sballot_px, whichballot_fnpicks for every non-compare PS mask, carry ballots included, still builds its quad bits fromQuadReadAcrossX/Y/Diagonal(own), the same quadOp-of-a-WaveReadLaneAt-derived-value pattern that crashes amdxc64. Any pixel shader that falls back to HLSL, or any run withXCL_DIRECT_DXIL=0, still gets carry ballots ofv_readfirstlane-derived values lowered todx.op.quadOp, and the RX 6700 XT driver still dies in CreateGraphicsPipelineState. Changingballot_pxin the HLSL prelude to fourQuadReadLaneAt(own_b, p) << pwould fix both paths. TheLw::ballot_psdoc comment (lanes.rs:900) still says it matches HLSLballot_px, which is no longer true.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T08:38:14Z.
merge-check
base:
1c8b551475head:
4dd6842738merge: clean trial merge into
1c8b551475e1e7bfe48f94448492a4c3544a2e0f(trial-merge commite7a6a5435c8efc2a116b7777528c47f3af577bdc;git diff --checkclean).build:
cargo build --workspace-> ok;cargo build --release -p xcl-> ok.tests:
cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture(43 targets) -> 2910 passed, 0 failed, 51 ignored (+1 new test vsmain1c8b5514; all 43 targets green includinggpu_two_pass_cache_e2e). All 9gpu::dxil::lanes::ps_ballot_testspassed with 0 skips, includingdirect_ps_non_vopc_carry_ballot_reads_its_quad_lane_by_laneandgpu_direct_ps_carry_ballot_draws_the_same_lane_by_lane_as_through_quadop(runs the wave32 matrix on RTX 4060; wave64 loop iteration requires native wave64 hardware). 28SKIPPEDlines — all hardware/environment-expected on RTX 4060 (22no wave64, 2no d3d12SDKLayers.dll, 1no D3D12 debug layer, 2no heap windows, 1cannot disable the driver cache (Windows Developer Mode required)).review: read the full merged diff (2 files:
crates/xcl/src/gpu/dxil/kernel.rs+4,crates/xcl/src/gpu/dxil/lanes.rs+160/-22, total +164/-22).Lw::ballot_psreplaces the 3QuadReadAcross*(quadOp) calls with 4QuadReadLaneAt(own_b, p) << preads ORed intoqbeforeballot_ps_quad(q)andnote_own_bit(lo, hi, cond), preserving exact bit layout (bit p = quad member p = lane 4k + p) and helper-lane visibility while avoiding theamdxc64crash onquadOpfed byWaveReadLaneAt. Verified on the prior cache-invalidation disagreement:XCL_PS_BALLOT_QUADOPis removed (quad_opis unconditionallyfalseoutside#[cfg(test)]), andcrates/xcl/build.rs:36-49, 143-155hashes all non-*tests.rsfiles undersrc/gpu/dxil(includinglanes.rsandkernel.rs) intoXCL_DIRECT_DXIL_SOURCE_ID, so prior direct-DXIL cache entries are invalidated automatically. Non-blocking notes: HLSLballot_px(recomp/emit.rs) still usesQuadReadAcross*forXCL_DIRECT_DXIL=0(clean separate follow-up), and AMD GPU re-confirmation on this head remains valuable forneeds:amd-test.performance: Tier 3 60 s retail smoke (
title: 29640639) shows no regression vsmain1c8b5514baseline (1462frames,presents per 2 s (last 3): 48 53 59,peak commit: 16043 MB):1606frames (+9.8%),presents per 2 s (last 3): 60 61 60,peak commit: 16402 MB(+2.2%), 0 device removals, 0 crashes.verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-02T08:47:53Z.
I tested
4dd68429in a release build on a Radeon RX 9060 XT. The driver version recorded for this setup was32.0.32029.2010. I ran title7952987Afor 720 seconds with the Series S (lockhart) profile with PSO tracing enabled.The run got past pixel shader record
7381166e806847c9. The trace shows that the driver blob was absent and that the matching graphics PSO compile completed in 989 ms:The title stayed up until the configured 720-second cutoff and exited with code
0x0. XCL reported 1,799 frames shown.AI use - Codex (GPT-6) checked the saved logs and drafted this comment.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:13:33Z.
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-02T14:27:34Z.
@ArtuArtaza
4dd68427no longer merges intomain, which is at5eaadb54now. It last merged cleanly at1c8b5514. The conflict is one spot incrates/xcl/src/gpu/dxil/kernel.rs,translate_entry_with:mainadded a test-only thread-local foridiomsat the same lines where this PR addsQUAD_OP_IN_TEST. Keeping both lines resolves it:I was about to run an AMD merge-check on
4dd68427(RX 9070 XT and an RDNA2 iGPU, including the cold, warm and old-cache case from Gevroska's check). I'll run it on the rebased head instead, so it counts for the head that gets merged.AI use: Claude Code (Claude Opus 5.5) found the conflict in a trial merge and drafted this note.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T15:08:40Z.
Follow-up review (head
1895d9e8, since4dd68427, diff read, not a merge-check; checks red):main, which threads its newIDIOMS_IN_TESTcell through the same translator-thread setup next to this PR'sQUAD_OP_IN_TEST.New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-02T16:23:33Z.
merge-check
base:
5eaadb54c1head:
1895d9e8eamerge: clean (merge commit 98a226d9, gpu/dxil/lanes.rs and kernel.rs, +164/-22)
build: cargo build --workspace -> ok (also
cargo test --workspace --no-runon the merge andcargo build --release -p xclon the clean head)tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2975 passed, 0 failed, 52 ignored; failing: none. 25 SKIPPED lines: 22 "no wave64", 2 "no heap windows", 1 "cannot disable the driver cache". All 9
ps_ballot_testspass, includingdirect_ps_non_vopc_carry_ballot_reads_its_quad_lane_by_laneandgpu_direct_ps_carry_ballot_draws_the_same_lane_by_lane_as_through_quadop(wave32 legs only: this card has no wave64, and the test leaves those legs out without a SKIPPED line).review: no blocking finding; whole diff read, with
ballot_ps_quad,note_own_bitand HLSLballot_px.git range-diff4dd68427->1895d9e8differs only inkernel.rscontext, where main'sIDIOMS_IN_TESTnow sits next to this PR'sQUAD_OP_IN_TEST(Chrysana's resolution); the added and removed lines are identical. The patch id changes with that context (10c5b0b4 -> b896a344), so by #3041's rule earlier checks are not carried.quad_opisfalseoutsidecfg(test), so XCL always emits 4QuadReadLaneAt(own_b, p) << p, the same nibble asown << (lane & 3)ORed with the 3QuadReadAcross*, then the sameballot_ps_quad+note_own_bit. No env switch is left, so the translated cache cannot hold thequadOpform under the default identity.ballot_px(recomp/emit.rs:6877) still builds its quad bits throughQuadReadAcross*, soXCL_DIRECT_DXIL=0and HLSL fallbacks keep the pattern, and theballot_psdoc comment ("parity with HLSLballot_px") is now only true of the bits, not of the ops.quadOpform on main too; no change in behaviour from this PR.CI: the
PR descriptioncheck is red on this head because the description's PR-sidexcl-smokeblock names the pre-rebase head4dd68427("needs anxcl-smokeblock made on this PR's head commit1895d9e8ea"). It blocks merging until the author rerunsscripts/smoke.ps1on1895d9e8and replaces the block.Build and testis green.performance: no regression measured; the shader cost is reasoned. Per pixel-shader carry ballot, main emits
and+shl+ 3quadOp+ 3or; this PR emits 4quadReadLaneAt+ their shifts +ors, so one more cross-lane quad read and about 2 more ALU ops (the DXIL test asserts exactly 4 more lane reads and noquadOp). On NVIDIA both ops lower to a quad shuffle, so the cost is about one shuffle per ballot, small next to the rest of a pixel shader even in the worst case CharlyRien counted (95 ballots in one shader); there is no memory cost. Measured on NVIDIA: retail title, 60 s, XCL_PREPARE=0, the same scripted presses, one warm-up run, gamesave moved aside before each run: frames 1601 vs main's 1609 (99.5 %), peak commit 19311 vs 18303 MB (105.5 %, under 125 %), no device removal or crash on either side. The run is capped at 60 presents per second, so it does not isolate the per-pixel cost. The AMD crash itself is not covered here (stijn-boer's RX 9060 XT run on the previous head is).main
5eaadb54:this PR
1895d9e8(clean checkout):verdict: safe to merge (the code; the red
PR descriptioncheck still needs the author's smoke block on1895d9e8)hardware / tool and model: NVIDIA GeForce RTX 4090 24 GB, driver 621.40; Intel Core i9-13900K, 32 GB; Windows 11 build 26300; rustc 1.100.0; tests debug, smoke release. Claude Code, Claude Opus 5.5 read the diff, ran the build, the suite and the smoke run of the head (main's block is from an earlier run of
5eaadb54on the same machine today), and wrote this check.Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-03T12:59:34Z.
merge-check
base:
a815de932chead:
1895d9e8eamerge: clean (local merge 44e06ae10d50853649b1963816563e43beeb2025; git diff --check clean)
build: cargo build --release -p xcl passed on both trees
tests: cargo test -p xcl --lib ps_ballot_tests -- --test-threads=1 --show-output --nocapture -> 10 passed, 0 failed, 0 ignored, 0 skips on the merge. The full workspace suite was outside this AMD run. An independent same-head NVIDIA merge-check reported 2,975 passed, 0 failed, and 52 ignored.
review: the AMD GPU pixel comparison passed and #3455 compiled the target PSO that crashes on main. The later AMD compiler crash has the same exception, DLL offset, fault address, and driver version as an independent report on a main revision without #3455. That report exercised a different PSO record.
performance: 60 s smoke for 2c508222, 1,495 to 1,603 frames and 16,165 to 11,684 MB peak commit. Both runs completed with zero device removals and crashes. One startup pair does not establish a repeatable performance delta.
verdict: safe to merge: this head fixes the reproduced AMD crash at the target PSO, the focused AMD checks passed, and the independent same-head workspace suite passed. The later crash matches a pre-existing AMD driver signature. The exact later mesh PSO still lacks a matched baseline run.
hardware / tool and model: Radeon RX 9060 XT (32.0.32029.2010), Ryzen 7 5700X, Windows 10 21H2 build 19044.6332 / OpenAI Codex (GPT-6, exact variant unavailable)
Independent same-head workspace results
AMD retest of #3455 on plain main
Tested #3455 head
1895d9e8ea3c64f7e91f4a0211f2a7aacff5c525onmaina815de932c4dc8da3b383ca44f4b094aa406fec9, which already includes #3707 through its upstream merge. #3455 was the only added PR. Local merge44e06ae10d50853649b1963816563e43beeb2025andgit diff --checkwere clean.Setup: Radeon RX 9060 XT (driver 32.0.32029.2010), Ryzen 7 5700X, Windows 10 21H2 build 19044.6332, Rust 1.100.0, Agility SDK 1.620.2 with matching debug layer, and DXC/DXIL 1.9.2609.5. Separate build directories and fresh XCL data roots.
cargo test -p xcl --lib ps_ballot_tests -- --test-threads=1 --show-output --nocapturereported 10 passed, 0 failed, 0 ignored, 0 skips. The two added checks also passed in isolation. The GPU check compared the lane-by-lane and quad-op paths pixel by pixel. The separate wave64 helper-lane test passed without skipping.cargo build --release -p xclpassed on both trees. Ranscripts/smoke.ps1 -Game <local folder> -Seconds 60 -Xcl <release binary>for2c508222, withXCL_UMA_DRIVER=mixedand PSO tracing enabled.main0x0main+ #34550x0In this pair the merge logged 7.2% more frames and 27.7% lower peak commit. Both runs ended near 60 presents per two seconds. A single startup smoke pair does not isolate shader cost or establish a repeatable performance delta.
Coverage limits: Neither trace contained the previously reported PSO record
7381166e806847c9. This retest verifies the synthetic GPU parity case and retail startup, with the original retail PSO case and full workspace suite still unverified in this run.AI use: OpenAI Codex (GPT-6, exact variant unavailable) prepared the builds, ran the tests, and drafted this report.
Extended AMD PSO retest
Both builds used the 720 s cutoff, the
lockhartprofile, PSO tracing, separate fresh XCL data roots, and explicitly separate emptyXCL_DXIL_CACHEdirectories for fixture7952987A. The AMD driver cache was left enabled. The earlier 60 s smoke pair used fresh XCL data roots but did not isolate the default DXIL cache. The long test used the same base and PR head, with local merge2ae408e456b4907aa9377c093f44b4e0914bbd67.7381166e806847c9mainamdxc64.dll+0x7380f8raised0xc0000005at 144.422 s.0xc0000005; peak commit 27,771 MB.main+ #34550xc0000005atamdxc64.dll+0x861b9fat 288.790 s. Process exited0xc0000005; peak commit 34,795 MB.The #3455 process had already exited when I checked to stop it early. The target compile fix was verified. The baseline crashed before it reached the later mesh PSO, so this pair cannot tell whether that later crash also occurs on main. The long runs ended at different points and do not provide a matched performance comparison.
Prior AMD crash evidence: An RX 9070 XT report on main without #3455, at revision
078358a0on the same driver 32.0.32029.2010, recorded 0xc0000005 in amdxc64.dll+0x861b9f reading address 0x8. The PSO records differ, so this establishes that the signature predates #3455 while the exact later mesh case remains unpaired.Imported from ivall/xcl. Originally posted by ArtuArtaza on 2026-12-03T14:33:20Z.
Test report on RDNA2 (author's run, not a merge-check): RX 6700 XT, driver 32.0.21045.29003, Windows 11 26200, rustc 1.100.0.
This PR merged into main
a815de93, retail title, 240 s,XCL_DEVICE_TYPE=lockhart XCL_PREPARE=0 XCL_PSO_AHEAD=0 XCL_PSO_TRACE=1, A every 15 s from 30 s, two runs each:a815de93:driver compile start #2258: graphics PSO, 70024 B DXIL, record 7381166e806847c9at 61.8 s, thenunhandled exception 0xc0000005 in amdxc64.dll+0x671f78at 62.0 s. The other run did not ask for that pipeline in its 240 s.7381166e806847c9builds (716 ms at 137.8 s; from the driver's cache at 58.8 s in the second run). Both runs reach 240 s (2804 and 2839 frames), 0 device removals, 0 crashes.cargo test --workspace --no-fail-fast -- --test-threads=4on the merge: 3014 passed, 6 failed, 56 ignored, 4 SKIPPED. Maina815de93: 3013 passed, the same 6 failed (5 tests, the one #3473 fixes among them), 56 ignored. All 10ps_ballot_testspass.(Runs and this note by Claude Code with Claude Opus 5.5, from my account.)
Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-03T15:00:40Z.
@throny could you take a look at this one for review and merge?
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.