rdna2spirv: a VALU data read of a lane-mask operand yields the wave's mask word #1397
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1397"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-24T23:23:33Z.
Claimed in the coordination issue: https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7147335368
Depends on: #953
What
A lane mask (EXEC/VCC or a mask-tracked SGPR) that an instruction reads as a 32-bit value — for example
v_mov_b32of it into a plain VGPR, or a scalar number reader such ass_add_u32 s20, s10, K— must produce the wave's mask word. Hardware SGPRs hold that wave-wide word; the translator previously produced each lane's own0/~0bit in the VALU path.This pull request now:
src_u/lane_mask_word), while mask consumers keep extracting the lane bit throughmask_src;if (active)runs, since the gather is a cross-lane operation;docs/design.mdrecords the contract. Semantic coverage includes narrowed SGPR/VCC reads, independent all-ones SGPR EXEC restore, EXEC round trips, scalar readers, vector-bitwise mask composition, native/emulated wave64 structure, and the eager-gather shape.Tested
python -I scripts/run_semantic_tests.py tests/semantic— 488 files, 6298 tests, 0 files failed;compileallclean;tests/test_lane_masks.pypassed.VK_LOADER_DRIVERS_SELECT=*nv-vk*):tools/crosslane_fuzz.py --programs 200 --seed 7 --wave 32 --modes native— 199 match / 1 mismatch / 0 hypothesis-only versus 186 / 9 / 5 atba315fbf1. The remainingcs_xl32_700032minimizes to an inactive-EXEC write-predication case (v_cmpx+ maskdatav_mov+v_xor), distinct from the narrowed-EXEC mask-word family and already present before this change.--programs 106) � 105 match / 1 mismatch / 0 hypothesis-only versus 100 / 3 / 3 atba315fbf1. The remainingcs_xl32_10200411is an EXEC-zero/readfirstlane control-flow case. AMD evidence is reported in the pull-request comments; no game files were used.AI-assisted (SWE-2.1 Max).
Imported from ubiquitarianism/leonida. Originally posted by GeorgiyDemo on 2026-11-24T23:55:58Z.
Tested
3ec97f53eon Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain364ab4eab(translator-only PR; binaries from the build at66d4f5aa3, GPU test C++ unchanged in between):mainthey fail:test_lane_masks_vector_bitwise4,test_salu64_bitwise_data9,test_salu_movrels_lane_mask32,test_scselect_b64_data2 failures — the coverage claim holds.--filter mask6/12 passed, 5 skipped, 1 failed;--filter exec4/8, 3 skipped, 1 failed. The failure iscs_mask_vgpr_exec:15 15 15 15 3735928559 …where the fixture expects4294967295 4294967295 …(SHADER-21 part 2 fixture from72d7e52df). Withmain'stools/rdna2spirv.pyin the same worktree and the same binary it PASSes; reproduced 3/3 runs.cs_mask_vgpr_execPASSes with both this head andmain's translator — the same SPIR-V yields0xFFFFFFFFthere and0xFon MoltenVK.src_udata-read path callslane_mask_word→wave_mask, which rebuilds the mask with anOpGroupNonUniformBallotof this lane's bit. The fixture doesv_cmp_lt_u32 vcc_lo …(VCC =0xFFFFFFFF),s_mov_b32 exec_lo, 0xF, thenv_mov_b32 v2, vcc_lo; on MoltenVK the ballot only covers the four invocations active under that EXEC and returns0xF, while the hardware VCC word is0xFFFFFFFF. KosmicKrisp returns the full subgroup mask and hides it.So at least on MoltenVK this is a regression against an existing GPU test: a mask word read as data cannot be reconstructed by a ballot that the current EXEC restricts.
AI-assisted; synthetic fixtures only, no game data.
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-25T00:46:21Z.
I tested the mask word and the EXEC write mask independently on an RTX 4090, Windows 11, NVIDIA 616.64, with a 32-lane compute subgroup. At head
b9cea5af, 25/25 dispatches matched every lane; the same inputs matched in 9/25 at parent1154976d.The existing
cs_mask_vgpr_execfixture passed on both revisions here. I added four local synthetic probes, each run with six pairs of masks supplied at dispatch. They read eithervcc_loor a compare-written SGPR, through eitherv_mov_b32orv_xor_b32. A distinguishing case was a comparison setting the odd lanes (0xaaaaaaaa) followed by EXEC selecting the even lanes (0x55555555). On the head every even lane received the full mask word on the move, and the odd lanes kept their sentinel. On the parent every even lane received zero.For comparison with the MoltenVK report, the original fixture produced byte-identical SPIR-V from
3ec97f53andb9cea5afwith my default build (SHA-256b675f09a98b92c423c6706e5a864dbcd555afe0ae43ad7606aab33a609d899be). My module materializes the mask with twoOpGroupNonUniformBitwiseOr … Reduceinstructions and has noOpGroupNonUniformBallot. The fixture also passed withLEONIDA_PC_TAIL_UBO=1. Comparing the subgroup operations in the failing MoltenVK module would help narrow down the driver difference; this NVIDIA run leaves that failure open.Both revisions' five modules passed Vulkan 1.2 SPIR-V validation. I built the compute harness from the PR head. Separately, all 33 tests in the four changed CPU semantic test files passed on the head. AI-assisted verification.
Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T03:40:27Z.
Merged b9cea5a into current main (
bfef489cb): no conflicts. The four test files this PR touches pass, and the changed expectations look right to me: a mask SGPR read by a VALU op is the 32-bit word on hardware, not the lane's 0 / ~0.The full translator suite (Linux, Python 3.13) has one new failure, and it's a good one:
tests/semantic/test_slot67_operand_forms.py::test_wave32_compare_high_word_preserves_low_and_clears_inactive_bitsis an unexpected success. That test is marked@unittest.expectedFailurewith a comment saying hardware copies the packed word (s_mov_b32 s8, vcc_hi->0x80000004) while main gives each lane its own mask value, which is what this PR fixes. With the marker left in, the suite reportsFAILED (unexpected successes=1). Dropping@unittest.expectedFailureand that comment's "fails there" sentence should make it green. Otherwise onlytest_int32_to_f64fails, as on main here (aspirv-optcrash in my environment).AI-assisted (Claude).
Imported from ubiquitarianism/leonida. Originally posted by thesubtleties on 2026-11-25T04:03:08Z.
I'm the author of #1043 (SHADER-MASK-AS-DATA), which overlaps. I ran both on main
bfef489c, RTX 3080 and gfx1036.Your branch (
b9cea5afb) handles the copy-then-v_readfirstlaneidiom that mine leaves out, and flags fewer fuzz programs: 12 here, 22 with #1043, 97 on main (fivecrosslane_fuzzruns).Two gaps:
--wave64-emulate, e.g.cs_xl64_2026173083558(seed 20261123, plain): "OpControlBarrier inside a folded lane-local region". The planner inwave64_emulate_opt.pyneeds to count these reads as exchanges; #1043 does it at three sites, feel free to reuse it.s_add_u32,s_mul_i32, shifts...) still see one lane's bit;test_mask_as_data.pyin #1043 covers them.test_slot67_operand_formsalso needs itsexpectedFailureremoved, for both of us. They look complementary; whichever merges first, I'm happy to rebase. AI-assisted (Claude Code)Imported from ubiquitarianism/leonida. Originally posted by levi2m on 2026-11-25T04:27:13Z.
Another card, native Windows: NVIDIA RTX 4050 Laptop (Ada, 10de:28a1), driver 621.01, Windows 11 build 26200, subgroup 32..32. No game files, nothing online.
tools/crosslane_fuzz.py, 200 programs per run, seeds 101, 102 and 103, on main3ff2a2adwithvk_compute_testbuilt from it. The "this PR" runs use only thetools/part of this diff (headb9cea5af) through--translator.--wave64-emulate, 600 programsEvery mismatching program on main includes the
maskdataop. The fix is confirmed on this card, and no harness errors on either side.Two things this PR leaves, for the record:
cs_xl64_10100316, opsbcnt, branch, cmp, exec, mask_salu, maskdata, mbcnt, mbcnt_data, permlane, readfirstlane, readlane, valu, writelane):AssertionError: wave64 emulation: x_split inside a folded lane-local region, fromemit_folded_region. This is the same class as theOpControlBarrier inside a folded lane-local regioncase in @thesubtleties' comment above, with a different assertion text.cs_xl32_10200411, also a mismatch on main): s13 is expected to be the same mask word in every lane (0xb945de14) and comes out per lane (0/0xffffffff). It reads a mask held in a scalar register, which may be the scalar follow-up mentioned in the PR notes; I did not trace it.The other fuzzers on main, same card, three seeds each, show nothing:
lds_fuzz(400 native and 300 emulated programs per seed) andvalu_fuzzf16 and mem (300 each) have 0 mismatches, andimage_fuzzmatches 300 of 300 per seed.AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T08:15:59Z.
Pushed
8ece74e2aaddressing the review findings (EXEC-coverage gating for mask-word gathers incl. the MoltenVKcs_mask_vgpr_execballot-under-EXEC case, scalar mask-number reads, and the wave64-emulate folded-region gaps).Independent GPU verification on this head (RTX 4070 SUPER + AMD Radeon gfx1036 iGPU,
LEONIDA_VK_VALIDATION=1):cs_mask_vgpr_execpasses on both GPUs;--filter mask/execcurated shaders: AMD 12/12 + 8/8, NVIDIA same modulo wave64 skips; withLEONIDA_W64_EMULATE=1on NVIDIA all 20 pass.crosslane_fuzzseeds 101-103, 100 programs/seed, wave 64, modes plain /--ext/--ext --dpp: 0 mismatches, 0 rejected on both GPUs (baseline main had ~6-11 mismatches per 100-program run).AI-assisted work.
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-25T08:48:23Z.
8ece74e2afixes the reported wave64 translation failure on my RTX 4090. I also found a wave32 regression relative to its immediate parent142293b30: when EXEC comes from a register, a vector read of a previously computed mask can return just the current lane’s bit.With all 32 lanes active,
v_cmp_ne_u32_e64 s8, v5, 0setss8to0x05010204(v5contains the corresponding bit in each lane). Then set EXEC and runv_mov_b32_e32 v2, s8. Both variants below have identical runtime EXEC and use the same input and harness.8ece74e2a0x05010204s_mov_b32 exec_lo, -10x05010204s_mov_b32 exec_lo, s4, withs4 = 0xffffffff0or0xffffffffAcross the previous 25-dispatch test, the parent matched 800/800 lane results. The new head had 224 wrong lane results across 16 dispatches. This includes VCC and compare-written
s8, with both move and XOR consumers. The unchangedcs_mask_vgpr_execfixture passed. The literal/register pair above would make a regression test for the fallback inmask_word_read_ok.I also replayed the two exact programs from the RTX 4050 report against the fuzzer’s CPU reference:
cs_xl64_10100316, emulated wave64: parent refused translation. Head translated, passedspirv-val, and matched all 896 checked words.cs_xl32_10200411, native wave32: 64/896 words still differ on both revisions. The first expected0xb945de14and read zero. This is program 106 for seed 102 with a single wave size and the default 24 operations, beyond the reported 100-program sweep.Windows, NVIDIA 616.64, LLVM 23.1.6. I rebuilt
vk_compute_testat8ece74e2aand reran both revisions with it. The 16 tests in the two changed semantic test files passed on CPU. AI-assisted verification using synthetic inputs.Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T08:59:28Z.
Thanks ecox982745 — confirmed reading. The
s_mov_b32 exec_lo, s4(register-sourced EXEC) vs literal-1divergence points at themask_word_read_okfallback treating a register-written EXEC mask as lane-local; a literal-vs-register EXEC pair is exactly the regression test we'll add. We're reproducing on the RTX 4070 SUPER + AMD gfx1036 iGPU, will fix on this branch, and re-verify both revisions' 16-dispatch sweep. Noted oncs_xl32_10200411(seed 102 prog 106, native wave32, 64/896 words on both revisions) — tracking separately as it predates this fix. AI-assisted.Imported from ubiquitarianism/leonida. Originally posted by Gefik23 on 2026-11-25T09:19:10Z.
Tested 8ece74e2a with
tools/crosslane_fuzz.pyon NVIDIA GeForce RTX 4060 (Ada), driver 617.42, Windows 11 Pro build 26200, native Windows. llvm-mc 21.1.8 (scripts\build_llvm_mc.ps1),vk_compute_testfrom main3f81d46ac,--translatorpointed at this PR'stools/rdna2spirv.py.3f81d46ac--programs 50 --seed 1--programs 200 --seed 7, wave32 native--programs 200 --seed 7, wave64 emulate--programs 50 --seed 1 --no-maskdata(main only)So every wave64 mismatch on these seeds is gone. The 7 wave32 mismatches left (
cs_xl32_7000{87,135,151,153,185,197,205}) also fail on main, so they are not regressions. With--minimizethey all come down to a mask computed under one EXEC and read as data under a narrower one, which looks like the same family as the register-EXEC case above. The two shortest:In both cases the bits of lanes 20..31, which are not in the group, read back as set. Full-wave groups fail the same way, for example
cs_xl32_700032(group 64):v_cmp_gt_u32_e64 s16, v2, v4/v_cmpx_gt_u32_e32 31, v3/v_mov_b32_e32 v7, s16. To reproduce:python -I tools/crosslane_fuzz.py --programs 200 --seed 7 --wave 32 --translator <this PR>/tools/rdna2spirv.py --minimize.AI-assisted (Claude Code ran the fuzzer and the reductions). No game files.
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T11:13:10Z.
Pushed
ba315fbf1fixing the wave32 register-EXEC regression @ecox982745 reported.Root cause:
Gen._mov_sgpr_valshandledexec/exec_lo/exec_hisources only under clean/constant EXEC half-state — under an unknown narrowing (("n", tag)) it recorded nothing, sos_mov_b32 exec_lo, s4minted a fresh tag andmask_word_read_okdenied the mask-word gather (per-lane 0/0xffffffff). The fix aliases the SGPR to the narrowing tag using the same("al", ...)schemes_*_saveexecalready uses, which_exec_src_exresolves — literal and register EXEC restores now behave identically.New coverage: 2 semantic tests (wave32 + wave64 EXEC round-trip asserting the
OpGroupNonUniformBitwiseOrgather) +cs_exec_copyGPU fixture storing mask word / exec_lo word / literal-restore word side by side.Verification (RTX 4070 SUPER + AMD gfx1036 iGPU,
LEONIDA_VK_VALIDATION=1): semantic suite 487 files / 6,291 tests / 0 failed; exec+mask filters andcs_exec_copyPASS on both GPUs with identical words; literal-vs-register now agree (out[0]==out[2]). Independent review APPROVEd (tests confirmed to fail on the parent translator). Re-running the narrowed-EXEC fuzz repros (cs_xl32_700087/700152/700032 family) to confirm coverage — will follow up. AI-assisted.Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-25T11:15:50Z.
I verified
ba315fbf1against its parent8ece74e2aon the RTX 4090. The saved-EXEC round trip is fixed: the newcs_exec_copyfixture went from 32 wrong output words on the parent to 128/128 correct on the head. The original case from my earlier report still fails when EXEC is set from an independent SGPR after the comparison.Here's a small way to reproduce that distinction using the PR's own
cs_exec_copy.asm. Keep the expected outputs and the rest of the fixture as written:EXEC is full when the comparison defines
s8and is full again when the move reads it. With the edit, all 32 lanes get the first output word wrong: even lanes return zero, odd lanes return0xffffffff, and all should return0xaaaaaaaa. The other three fields match in every lane, including the EXEC word and the mask read after the literal restore.The original five synthetic modules are byte-identical across these two commits. Re-running their 25 dispatches gave the same 224/800 wrong lane results across 16 dispatches. A diagnostic that reads the complete mask into a VGPR immediately after the compare, before changing EXEC, matched all 96 lane results across three full and partial EXEC patterns. This gives a passing control for investigating where the complete mask word can be preserved.
Native wave32, Windows 11, NVIDIA 616.64, LLVM 23.1.6. The edited fixture passed Vulkan 1.2 SPIR-V validation. All 16 CPU tests in
test_lane_masks_vector_bitwise.pypassed on the head. AI-assisted verification.Imported from ubiquitarianism/leonida. Originally posted by hugo0024 on 2026-11-25T11:57:12Z.
Tested
ba315fbf1merged onto mainbcaa13dadon an Apple M5 (MoltenVK 1.4.2, macOS 27.2.1), with the test programs built from that main. AI-assisted.The fixtures on MoltenVK
run_gpu_tests.py --filter mask: 7/12 passed, 5 skipped.--filter exec: 6/9 passed, 3 skipped.cs_mask_vgpr_execand the newcs_exec_copypass; every skip is "no 64-wide compute subgroup on this device".crosslane_fuzz.py --programs 200 --seed 31008 --wave 32 --dpp --ext(match / mismatch / hypothesis only)b9cea5afb8ece74e2aba315fbf1#953 is the whole-wave mask gather that MoltenVK needs stored, so the right-hand column is the one to read on this driver. The
b9cea5afbrow was measured earlier today on main3f81d46ac; the translator on main changed once since then (#1493).The 12 programs left at
ba315fbf1are the same 12 as at8ece74e2a, and all are the family @Gefik23 and @ecox982745 describe, a mask read by a VALU op after EXEC changed:What this run adds: all 12 matched at the first head,
b9cea5afb. For the three I looked at (cs_xl32_3100893037,..125,..134),b9cea5afbemits twoOpGroupNonUniformBitwiseOrand the two later heads emit no subgroup operation at all, as main does. So this family is not a MoltenVK effect, and the first head had it right.wave64 emulate,
--programs 150 --seed 31009 --wave 64 --modes emulate --dpp --ext: main 144 / 5 / 1,ba315fbf1149 / 1 / 0, nothing rejected. The one left fails on main too,cs_xl64_3100993145(group 40), minimised:Not tested: any other GPU, and the game corpus.
Imported from ubiquitarianism/leonida. Originally posted by EvgHaze on 2026-11-25T13:11:39Z.
Apple check of the new
cs_exec_copyfixture, on both drivers.scripts/run_gpu_tests.py --filter cs_exec— identical words on both drivers, 3/3 passed:cs_exec640 0 0 0 0 0 0 0cs_exec_const16 8 2 16 0 16cs_exec_copy(new)2863311530 4294967295 2863311530 0 2863311530 4294967295 2863311530 1python3 -I scripts/run_semantic_tests.py tests/semantic→ 489 files, 6300 tests, 0 failed (main is 6288, so this diff adds twelve), 143 s.Both Apple drivers run these at subgroup size 32 natively, so the lane-mask-as-data read is not being emulated in either run. MoltenVK's SPIRV-Cross path and KosmicKrisp's
nir_to_mslpath agree word for word.AI-assisted. No game data: hand-written fixtures, and the numbers above are test output.
Imported from ubiquitarianism/leonida. Originally posted by GeorgiyDemo on 2026-11-25T14:14:18Z.
Follow-up: the regression I reported at
3ec97f53e(cs_mask_vgpr_exec:15 15 15 15 …on MoltenVK) is gone atba315fbf1on the same machine where it reproduced — Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), MoltenVK 1.4.2, binaries from the build at66d4f5aa3:cs_mask_vgpr_execPASS:4294967295 4294967295 4294967295 4294967295 3735928559 3735928559 3735928559 3735928559on MoltenVK and the same on KosmicKrisp (Mesa 26.3.1).--filter mask: 7/12 passed, 5 skipped, 0 failed (all skips are "no 64-wide compute subgroup on this device").--filter cs_exec: 3/3 PASS, including the newcs_exec_copy(2863311530 4294967295 2863311530 0 …), same words as the M3 run.test_lane_masks_vector_bitwise,test_salu64_bitwise_data,test_salu_movrels_lane_mask,test_scselect_b64_data): OK.So this is fixed on macOS 26.7.3 as well, not just on the 27.x runs above.
AI-assisted; synthetic fixtures only, no game data.
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T16:37:40Z.
Thanks, @whoalin1. The saved-EXEC round trip is fixed. Open points:
main.b9cea5afband mismatch now.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-25T16:47:11Z.
I compared #1043 (
4d58a05d6) and #1397 (ba315fbf1) for the independent-EXEC case in the review above. I merged each PR separately ontomainat9e7720c9elocally and ran the same synthetic wave32 shaders on an RTX 4090, Windows 11, NVIDIA 616.64. Both merges were clean. This is GPU readback using the same executable for all three builds.cs_exec_copy(correct output words / 128)v_mov_b32(dispatches passing / 12)v_xor_b32(dispatches passing / 12)The move and XOR rows each cover six runtime mask pairs for each of two sources, VCC and compare-written
s8. Adding the stockcs_mask_vgpr_execcontrol gives 9/25, 17/25 and 9/25 passing dispatches respectively. Across those 25 dispatches, #1043 reduced incorrect lane values from 224 to 112, all in XOR. Every module passed Vulkan 1.2 SPIR-V validation, and every readback guard was intact.For the overlapping fixes, #1043's handling of
v_mov_b32already covers both EXEC fixtures here. The XOR row gives a separate regression target for the remaining arithmetic use of a mask. This comparison covers native wave32 on this GPU. AI-assisted verification with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T17:07:24Z.
Pushed
52fb23042. This reworks the narrowed-EXEC side rather than extending the coverage proof:Verified here (no game files):
run_semantic_tests.py tests/semantic: 488 files, 6298 tests, 0 files failed;compileall,tests/test_lane_masks.py, andcheck_no_game_datapassed.crosslane_fuzz.py --programs 200 --seed 7 --wave 32 --modes native199 match / 1 mismatch / 0 hyp-only (was 186 / 9 / 5 atba315fbf1); seed 102, 106 programs 105 / 1 / 0 (was 100 / 3 / 3).The residual is
cs_xl32_700032, minimized tov_cmp+v_cmpx+ maskdatav_mov+v_xor; it is an inactive-EXEC write-predication case that already mismatched before this work, not the narrowed-but-nonzero EXEC mask-word family.cs_xl32_10200411also remains in the seed-102 stream and starts withexec_lo = 0, a separate no-active-lane/readfirstlane control-flow case.On overlap: #1043 currently fixes the independent-EXEC
v_movcases but not arithmeticv_xorin ecox982745's comparison. This head is intended to cover mask data reads uniformly; I have not merged or duplicated #1043's follow-forward VGPR-copy analysis.AI-assisted (SWE-2.1 Max).
Imported from ubiquitarianism/leonida. Originally posted by EvgHaze on 2026-11-25T17:11:03Z.
Apple run of the new head
52fb23042, on both drivers.--filter cs_execcs_exec_copywords2863311530 4294967295 2863311530 0 2863311530 4294967295 2863311530 1--filter mask(non-64-wide)cs_mask_vgpr_exec4294967295 4294967295 4294967295 4294967295 3735928559 3735928559 3735928559 3735928559490 files, 6307 tests, 0 failedTwo things worth stating plainly:
cs_exec_copy, so my run does not cover them and I am not claiming it does. If you paste that fixture or point at a branch with it, I will run it on this machine in the same two drivers and add the row.AI-assisted. No game data.
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-25T17:15:31Z.
@EvgHaze, here are the synthetic fixtures for the Apple run. On the RTX 4090,
52fb23042passes 25/25 dispatches (800/800 lane results), up from 9/25 onba315fbf1. The independent-EXEC move and XOR rows both pass 12/12. The separate saved-EXEC and independent-SGPR fixtures each pass 128/128 output words. All readback guards were intact. This closes the two failing rows from my earlier comparison on this GPU.I ran the PR head directly with native wave32 on Windows 11, NVIDIA 616.64. I also translated all seven programs after merging this head onto the same
main(9e7720c9e) used in the comparison. All seven SPIR-V modules matched the ones dispatched byte for byte and passed Vulkan 1.2 validation.Independent SGPR fixture and all-lane check
Save as
runtime/test/shaders/cs_exec_copy_independent.asm.From the repo root, with your usual driver and push-constant settings and
vk_compute_teston PATH, run the following for each driver. The last command checks the full result, including 16 guard words.Independent-EXEC move and XOR rows
This is the exact
s8XOR shader. For the move variant, replace onlyv_xor_b32_e32 v2, s8, v7withv_mov_b32_e32 v2, s8. For the VCC pair, replaces8withvcc_loin the compare and the consumer. Build each name with the samebuild.pycommand as above.Run each variant once per pair below, setting
VKC_SGPRS=s4,s5to the two literal hex values,VKC_SUBGROUP_SIZE=32andVKC_OUT_WORDS=64. For lanei, when bitiofs4is set, expects5for the move ors5 ^ 0x12345678for XOR. Otherwise expect0xdeadbeef. Words 32–63 keep the harness fill0xeeeeeeee.AI-assisted verification with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by mrgenty on 2026-11-25T18:03:11Z.
Tested
52fb23042withcrosslane_fuzz.pyon an NVIDIA GeForce RTX 3060 (NVIDIA 621.24, Windows 11 build 26300, subgroup 32..32). One program is left, reduced to four instructions below.Setup:
vk_compute_testand the fuzzer (with its model) from mainb0f3d399,--translatorpointed at each tree'stools/rdna2spirv.py, llvm-mc 21.1.8 (scripts\build_llvm_mc.ps1), Vulkan SDK 1.4.363.0. No game files.b0f3d3994d58a05d652fb23042With
--no-maskdata, main matches 400/400 in both modes on this card (seed 73190611), so the masks-as-data programs are the only ones that differ here.The one left here:
cs_xl32_2511325437669, wave32, group 20.--minimizegives:v3was seeded aslane + 0xd4718f66. The model expectss14 = 0xd4718f66in every lane, lane 0's untouchedv3. This head returns0x00018f66in all 20 lanes, which is that value ANDed with0xfffff, the 20 lanes of the group. So it looks as if thev_readfirstlanereadsv3as a mask word because av_movfrom a mask reaches it, although thatv_movwrote no lane. I did not trace it in the translator, so take the cause as a guess; the numbers are measured.It is not a regression: main fails the same program differently (each lane gets its own
v3, so only lane 0 is right), and #1043 returns0x000fffff.For comparison, the four programs #1043 leaves on this seed reduce to a
v_mov_b32of a mask followed byv_readfirstlane_b32(three wave32 cases, one with EXEC set to 0 first) and tov_mov_b32 v3, s21of the high half of as[20:21]mask under--wave64-emulate. This PR matches all four.Not tested: native wave64 (this card has no 64-wide subgroup), other seeds on this head, and the semantic suite.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-25T18:16:32Z.
I narrowed down the RTX 3060 result on an RTX 4090. It also happens when both the move and the read have active lanes. This gives a regression test independent of the semantics of a read with empty EXEC.
On
52fb23042, seedv3with0xd4718f66 + lane, let only lane 7 overwrite its ownv3, then restore full EXEC before reading lane 0. The shader stores bothv3directly and the word returned throughs14. Lane 0's direct word is correct in all three group sizes.s140xd4718f660x000000660xd4718f660x00018f660xd4718f660xd4718f66Removing only the predicated
v_movgave the full expected broadcast in all 12 control dispatches. Selecting lane 7 as the reader after only lane 3 wrote gave the same truncation at group sizes 8 and 20. Reading lane 7 after lane 7 itself wrote gave the expected0x80in all three sizes.In the 20-thread module,
OpGroupNonUniformShufflebroadcasts the word, then a shift and AND extract one bit per lane. Thes14consumer rebuilds the word withOpGroupNonUniformBitwiseOr … Reduce. A 20-thread group can supply only bits 0–19 to that reduction. This points to preserving the full scalar value through this read when the selected lane retains ordinary data. Read-first-lane lowering on the tested headNative wave32, Windows 11, NVIDIA 616.64. Six synthetic modules per revision passed Vulkan 1.2 validation, with all readback guards intact. Baseline
9e7720c9ealso fails the 20-thread live-move case, returning different words across lanes. AI-assisted verification with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T19:33:38Z.
Thanks for narrowing this down. I agree with the interpretation that this is a mixed-provenance case rather than a regression introduced by
52fb23042: your baseline control also fails the live-move case.The current model has one static provenance for the whole VGPR.
lane_masks.pyalready special-cases the copy shape: av_mov_b32of a mask into a VGPR is an ordinary EXEC-gated VALU write, not an all-lanes mask computation, so inactive lanes keep their old data. But after that write the register can contain the mask word in some lanes and ordinary data in others. Whenv_readfirstlanelater selects a lane, the correct result depends on which kind of value that selected lane retained. The present translator cannot represent that lane-dependent provenance, so it chooses the mask interpretation for the whole register and rebuilds only the mask bits — exactly the 8/20-thread truncation you measured.I do not see a small sound fix inside this PR without tracking which lanes of the VGPR received the mask word (or otherwise carrying per-lane provenance) through the copy and the first-lane selection. Since the case exists on main as well, my preference is to treat it as a follow-up rather than block the lane-mask data-read improvement here. If others prefer, I can write the finding up separately with your reduced shader as the reproducer.
AI-assisted analysis with Devin.
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T22:38:14Z.
Rebased onto current
main(581ddba5d) and pushed ase3e119a46; GitHub now reports the PR mergeable again. The only conflicts were the fixture-list intersections with the newly mergedcs_w32_wrxchg2*/cs_w64x_partial_swizzleentries; resolution keeps both those andcs_exec_copy.Post-rebase verification on this machine:
python -m compileall -q make_game.py tools tests scripts/run_gpu_tests.py runtime/test/shaders/check.py— pass.python -I scripts/run_semantic_tests.py tests/semantic— 493 files, 6,334 tests, 0 files failed in 345 s (Python 3.14).python -I scripts/run_gpu_tests.py --filter cs_exec_copy --require-pass— pass on both GPUs, withLEONIDA_VK_VALIDATION=1and spirv-val clean:cs_exec_copyPASS, exact words.cs_exec_copyPASS, identical exact words.No game files used. AI-assisted with Devin.
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-26T05:01:04Z.
Additional AMD evidence on the current head
e3e119a46f. Same synthetic crosslane slice before/after, no game files:a73a57e13, seed 14 wave64-emulate slice (26 programs, --dpp --ext): 23 match, 1 non-hypothesis mismatch (cs_xl64_1400067), 1 hypothesis-only mismatch (cs_xl64_1400059). The companion wave32-native half was 25/25 clean.So this PR fixes both seed-14 wave64-emulate divergences on AMD, including the non-hypothesis cs_xl64_1400067 case.
Imported from ubiquitarianism/leonida. Originally posted by EvgHaze on 2026-11-26T05:58:21Z.
@ecox982745 ran your five fixtures on the Apple side, at this head (
e3e119a46), on both drivers.s8(6 SGPR pairs)s8(6 SGPR pairs)vcc_lo(6 SGPR pairs)vcc_lo(6 SGPR pairs)Every lane value and
0xeeeeeeeefill word matches, and both drivers agree word for word — a 32-wide host runs these natively, so nothing here goes through wave64 emulation.Two notes on reproducing it:
v_cmp_ne_u32_e64 vcc_lo, v5, 0(your VCC variant) assembles, but the move variant has to drop thev7operand —v_mov_b32_e32 v2, s8, notv_mov_b32_e32 v2, s8, v7; with three operands llvm-mc rejects it.AI-assisted. No game data: hand-written shaders, and every number above is a readback comparison.
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-26T06:19:31Z.
@sdelectron, I checked the six seed-1 cases you reported on the RTX 5080 against this PR on a physical RTX 4090. All six also differ from the CPU reference on current main. All six match after merging this PR locally. That includes the three read-first-lane cases (
100023,100075,100014), parked lane access (100026), the prefix count (100034), and the 18-lane tail mask (100077). For the last case main returned0xffffffffwhere the reference has0x0003ffff. Seed-1 coordination reportsa73a57e13e3e119a46I used main's
crosslane_fuzz.pygenerator and reference (--seed 1 --programs 100 --wave both, default 24 ops), assembled the inputs once and ran both sets with the samevk_compute_testbuilt from main. Six of the ten main-side mismatches were ordinary model comparisons. The other four programs contain an operation the fuzzer marks as a hypothesis. All 200 dispatched modules passed Vulkan 1.2 SPIR-V validation and ran with Khronos validation enabled. Windows 11, NVIDIA 616.64. The clean merge tree wasdd50d3bb2bb09f7d406a90cc0c534a5af48f6300.I also retested the separate lane-7 fixture on that merge tree to check what remains for the mixed-provenance claim. After only lane 7 writes a mask to its vector register and full EXEC is restored, the direct lane values are all correct. The broadcast of lane 0 should give
0xd4718f66; it still gives0x00000066for 8 threads and0x00018f66for 20. The 32-thread case and all three controls without the predicated move pass; all guard words stayed intact. This smaller fixture still exercises the outstanding bug even though the full seed-1 corpus now passes.AI-assisted verification (OpenAI Codex). All shaders and inputs were synthetic.
Imported from ubiquitarianism/leonida. Originally posted by Christopher-Sundeby on 2026-11-26T13:14:42Z.
Verified on NVIDIA: this pull request clears 19 of the 20
crosslane_fuzzmismatches thatmaingives on four seeds, with no new ones. The one left is the knowncs_xl64_200065.Setup: RTX 3060 Ti (subgroup 32), NVIDIA 621.24, Windows 11, MSVC
vk_compute_test. The heade3e119a46merges cleanly ontomaina73a57e13. llvm-mc 21.1.8 (AMDGPU),--programs 100 --wave both(50 wave32 native + 50 wave64 emulate per seed), translator oracle.mainmismatches (w32 / w64 emu)mainhypothesis-onlycs_xl64_200065(seed 2, wave64 emulate,s10expected0x0000008c, got0x00000000). That is sdelectron's repro of the outstanding SHADER-READFIRSTLANE-MIXED-PROVENANCE part, so it is not new.cs_xl64_700024, wave64 emulate) that this pull request fixes:python -I scripts/run_semantic_tests.py tests/semanticon the merged tree: 499 files, 6,370 tests, 0 files failed (262 s, 32 jobs).mainwith the same setup (seed 41, 100 programs, native and emulated) are clean:valu_fuzzf16 and mem,lds_fuzz,image_fuzz(seed 42),f32_fuzz(seed 42, 200 programs).No game files. AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-26T14:14:36Z.
I checked
e3e119a46merged onto maina73a57e13(no conflicts), CPU only, on Linux with Python 3.14. The GPU side is well covered above, but every run there iscrosslane_fuzzcompute. This adds the mesh stage under--wave64-emulate: 128-thread NGG mesh shaders (two waves) are the "VS as MS" path the world-load draws take. I ran them inspirv_mini_interp.run_workgroupon 32-wide subgroups and compared each thread's exported position with a hand model.The bug is there on the mesh path too, and this fixes it. Take
v_cmp_gt_u32 vcc, 40, v0, thenv_mov_b32 v6, vcc_lo:0instead of the word0xffffffff;v_cmp_gt_u32_e64 s[10:11], 40, v0followed bys_add_u32 s20, s10, 1is wrong on the same 24 lanes.With this PR both are right, in the structured form and in the forced round-loop form.
No regressions on the mesh path:
v_readfirstlane/s_and_saveexecloops;execnz,v_cmpxand VCC-vote latches;s_barrier+ LDS inside a loop;s_endpgm.s_cmp_eq/lg/lt_u32ands_bitcmp1_b32on a mask word, intos_cselect_b32or a branch, are right on both trees. I had wondered whetherMASK_NUMBER_READERSneeds the compares, and it does not.tools/cf_diff.py's programs as 2-wave mesh shaders: 300 programs (seeds 21-22, depth 3), each in the default form, the forced round-loop form and without the extras_barrier. That is 900 runs, 350 of them in the round-loop form: 900 matchcf_ref, with no non-uniform barrier and no runaway loop.73516a290(Windows 10, Python, 24 jobs): 499 files, 6,370 tests, 0 files failed.Cost, for the record. Each mask-as-data read site adds one exchange segment under
--wave64-emulate. The scheduler switch goes 2 → 3 cases for a singlev_mov_b32 v, vcc_lo, and 5 → 6 for one inside a loop, plus 2 workgroup atomics. The staticOpControlBarriercount is unchanged, but in the round-loop form an extra segment is an extra round at run time. That includesv_mov_b32 v6, exec_lowith EXEC still full, which main already got right. If a census ever shows these reads are common in the mesh corpus, the gather could be skipped wherelane_masksproves the mask is all ones or zero. That is not a reason to hold this.On #1043: plamea's seed-1 sweep (#1608) and the runs above have this PR covering everything #1043 does, plus the
v_readfirstlanecases, and #1043 is 553 commits behind. I would merge this one.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-27T10:02:13Z.
Independent check of
e3e119aunder--wave64-emulate, by Claude Code (AI-assisted) on my behalf. Linux, Mesalavapipe (llvmpipe, LLVM 19.1.7, 8-lane subgroups; emulated wave64 uses no subgroup operations, so it is judged
there, docs/shader_validation.md "Subgroup size").
tools/crosslane_fuzz.py --wave 64 --modes emulate --dpp --ext(main's fuzzer,--translatorpointed at thishead):
d1dff794Every one of main's 21 failing programs has a mask read as data (
maskdata); none is left here, and nothing isrejected. Minimized on main, the shortest are:
s_bfm_b64 s[18:19], 47, 49/v_mov_b32_e32 v3, s19(group 192): expected 0xfffe0000 in every lane, maingives 0 or 0xffffffff per lane.
s_bfm_b64is not mentioned in this thread, so this may be a useful fixture.v_cmp_gt_u32_e32 vcc, 51, v1/v_mov_b32_e32 v3, vcc_hi(group 64): expected 0x0007ffff.v_cmp_ne_u32_e64 s[18:19], v7, v4/s_and_b64 s[20:21], .../v_mov_b32_e32 v5, s21in a group of 100(a partial second wave): expected 0x0000000f in wave 1.
No regressions seen on this head (each its own seed):
tests/semantic493 files / 6,334 tests, 0 failed;lds_fuzz.py --wave 64 --emulate150/150;valu_fuzz.py --family mem --wave 64 --emulate120/120;cf_diff.py --wave 64300/300. Native wave32 was not run (lavapipe can't pin 32-lane subgroups), and no hardwareGPU. The branch now conflicts with main.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T03:00:57Z.
Hi @whoalin1, thanks for this pull request. It currently conflicts with
main(conflicting file(s):scripts/run_gpu_tests.py,tools/rdna2spirv.py), so it carries theneeds rebaselabel. CONTRIBUTING.md asks authors to rebase their branch onmain; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-28T23:03:44Z.
On the rebased #1397 head (
5c37f5fd98), I verified the sparse EXEC arithmetic case reported on gfx906 in #2357 on a desktop RTX 4090. This PR fixes reading EXEC as the numeric operand of an add or subtract with carry. A separate wave32 carry-input problem still needs #1943 when a scalar move writes VCC.I used synthetic
v_add_co_ci_u32,v_sub_co_ci_u32andv_subrev_co_ci_u32shaders with two sparse execution masks and one full mask. Each has a control that supplies the same numeric word through an ordinary scalar register. This table counts wrong active-lane arithmetic results on the EXEC-source cases when a vector comparison sets the carry bits.adfb3821a5c37f5fd98exec_loexec_loorexec_hiThe scalar-register controls matched on both trees. For example, with
exec_lo=0x42048005, lane 0 adding0xbadc0feewith carry-in 1 returned0xbadc0feeon main and the expected0xfce08ff4on the PR.I then loaded packed carry bits into VCC with a scalar move. On wave32, #1397 alone still had 75/138 wrong results even with the ordinary scalar source control. Applying #1943 alone fixed that control, but the EXEC-source version still had 42/138 wrong. On the clean combined tree
143e52b57e(#1397 plus #1943 headc82d668d0a), all 54 packed-carry cases matched, including the emulated high-half and ordinary-register controls. Inactive lanes remained untouched, all guard words held, and the generated modules passed Vulkan 1.2 SPIR-V validation.Windows, NVIDIA 616.64, physical subgroup width 32. Coordination claim. AI-assisted verification with OpenAI Codex (GPT-6).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T02:37:19Z.
#1397 | head
5c37f5fd98(merged cleanly onto origin/mainc8bf0e7b65) | Windows 11 (10.0.26200.9974), Python 3.12.10, NVIDIA GeForce RTX 3090 (Vulkan 1.4.363.1) | AI-assisted: yesSummary — PASS
Verified
5c37f5fd988fb70ab647523167a57dedcd20db9fmerged cleanly ontoorigin/main(c8bf0e7b6568f471b42540010e335ca6413d4c58,git merge-tree --write-treeexit0) on Windows 11 (x64) with physical NVIDIA GeForce RTX 3090 Vulkan compute execution.Red -> Green Verification
origin/mainc8bf0e7b65with#1397's updated semantic test suites &cs_exec_copyfixture):tests/semantic/test_lane_masks_vector_bitwise.py->FAILED (failures=23)(18tests)tests/semantic/test_salu64_bitwise_data.py->FAILED (failures=9)(11tests)tests/semantic/test_salu_movrels_lane_mask.py->FAILED (failures=32)(3tests)tests/semantic/test_scselect_b64_data.py->FAILED (failures=2)(12tests)tests/semantic/test_slot67_operand_forms.py->FAILED (failures=1)(2tests)origin/main+#1397):tests/semantic/test_lane_masks_vector_bitwise.py->18/18passed (2.062s,OK) (covering VALU bitwise mask words under narrowedEXEC,v_readfirstlane_b32into VGPR destination on Wave32/Wave64 and Wave64-emulated%x_buf, scalarMASK_NUMBER_READERS, andvcc_lodata reads under narrowedexec_lo)tests/semantic/test_salu64_bitwise_data.py->11/11passed (2.560s,OK)tests/semantic/test_salu_movrels_lane_mask.py->3/3passed (0.318s,OK)tests/semantic/test_scselect_b64_data.py->12/12passed (0.892s,OK)tests/semantic/test_slot67_operand_forms.py->2/2passed (0.161s,OK)tests/test_shader_checks.py->88/88passed (3.551s,OK)tests/test_run_gpu_tests.py->75/75passed (3.702s,OK)tests/test_docs_design_rows.py->5/5passed (0.093s,OK) (0link errors indocs/design.md)Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T05:47:20Z.
Verified by OreoFR — FAILS
c8bf0e7b6+ this PR (head5c37f5fd9) merged with --no-fftest_lane_masks_vector_bitwise23 failures,test_salu64_bitwise_data9,test_salu_movrels_lane_mask32,test_scselect_b64_data2,test_slot67_operand_forms1.python -I -m unittest discover -s tests/semantic -p <file>). But the full translator suite (python -I scripts/run_semantic_tests.py tests/semantic -j 4) has 2 new failures vs main.test_gather4_c_lz: 7 failures, 52 errors.test_lane_masks_edge_cases:test_wave32_writelane_lane_32_aliases_lane_0_for_parked_masksgives[20, 20, 20, 20] != [20, 20, 10, 10]. Both pass on main, where the suite runs 527 files and onlytest_valu_cvt_f16_int16_modsfails. ctest in package p5 (main + #2477 + #1397): 495 tests, no new failurestools/rdna2spirv.py: the PR head no longer has main'selif op in ("image_gather4_c_lz", "image_gather4_c_lz_o"): self.image_op(op, a, mods), next to thev_readfirstlanebranch the PR rewrites (the merge of main into the PR dropped it). So those two ops are no longer translated, which is thetest_gather4_c_lzfailure. The fixturetests/semantic/fixtures/disasm/cs_exec_copy.sis hand-written, and the docs/design.md row is updated.AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-29T06:16:07Z.
I reproduced both cases in the review above on the clean merge of
5c37f5fd9and mainef3299584. The patch restores both depth-compare gather dispatches. It also passes the current wave mode to the parked-slot check in the new mask-word selector, so that in Wave32 lane 32 aliases lane 0 there as it already does in the slot tracker and read/write paths.test_interp_computed_ij_fallbackandtest_valu_cvt_f16_int16_mods.[20, 20, 20, 20]before the patch and[20, 20, 10, 10]with it. The overwrite case returned0x55aain all four lanes before and after. All four shaders passedspirv-valand the dispatches reported zero Vulkan validation errors.The patch applies after merging main
ef329958483832297acb53e68be94b439e88a90einto this head. It reconstructs tested tree26733e70326581ad2bf57fc97d1c45ba7524bba8. CoordinationAI-assisted with OpenAI Codex (GPT-6.2 Sol).
Patch for git am
Save the block as a patch file and apply it with
git am.Retest after the rebase. The patch is now present in PR head
b907306223822ed3f846ae4623d99b03431a7b60with the same patch ID. I tested it merged into main7b907de52311e08374a006e00402995f7a671ca8(tree395233906dd4dd755d4e65c07e8eb294c400012b).[20, 20, 10, 10]for the restore and0x55aain all four lanes for the overwrite. Both shaders passedspirv-valand Vulkan validation reported zero errors.Adopted commit
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-29T17:27:41Z.
Rebased onto current
mainand applied the reviewer-supplied correction asb90730622: both depth-compare gather dispatches are restored, and the parked-slot lookup now receives the current wave mode.Validation after that head: 16/16 gather tests, 8/8 lane-mask edge tests, 2/2 slot67 tests, and all five touched semantic test files pass; compileall and diff-check are clean. AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T18:36:10Z.
Re-verified by OreoFR at head
b90730622on maineedd72e30(still merges cleanly on878b024f4): READY — red 67 fail → green 70 OK; ctest/link n/a (translator and test-runner Python only, nothing gta6rt links); head changed since the earlier verification https://github.com/ProjectLeonida/mandy/pull/1397#issuecomment-7251460346 (FAILS at5c37f5fd9: the two regressions are fixed at this head). Windows 11, RTX 4070 Laptop 8 GB, NVIDIA 621.40. AI-assisted (Claude Code, Claude Opus 5.5).test_lane_masks_vector_bitwise23 failures,test_salu64_bitwise_data9,test_salu_movrels_lane_mask32,test_scselect_b64_data2,test_slot67_operand_forms1.git merge --no-ff): those five files 46/46 OK, plustest_gather4_c_lz16/16 andtest_lane_masks_edge_cases8/8, the two files that failed at the earlier head.scripts/run_semantic_tests.py tests/semantic, on main91bab934d, the main of the start of this run): merge 529 files, 6540 tests, onlytest_interp_computed_ij_fallbackfails; main alone 529 files, 6526 tests, the same single failure. No new failure. Main has since gained a smalltools/rdna2spirv.pychange; the PR still merges cleanly and the files above were rerun oneedd72e30.Ready to merge per the maintainers' plan.
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-30T22:24:32Z.
Rebased onto current
mainasda87c72c6. The conflicts were resolved by keeping upstream’s scalar-spill parking refactor while preserving this branch’s mask-word/EXEC-copy behavior, and by movingcs_exec_copyinto upstream’sCS_DUMP_WANTS/CS_DUMP_NON_WAVE64tables. Validation: the five changed semantic test files pass 46 tests + 480 subtests under Python 3.12, andpy_compile/git diff --checkare clean. Real-GPU validation of the rebased head is still untested here.Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-30T22:43:56Z.
Current head
da87c72cis now mergeable with all visible checks green after the rebase. The prior independent hardware validations were against the same translator behavior; the rebase only refreshed the upstream baseline and preserved the mask-word changes.Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-30T23:11:52Z.
Native RTX 4090 hardware retest after the rebase. I tested head
da87c72c6against9dffbe721, merged tree471cd3dcb, with Windows 11, NVIDIA 616.64, and Khronos Vulkan validation 1.4.369. I reused the earlier assembled seed-1 inputs, CPU reference andvk_compute_testexecutable. Both translators used--no-ftz32for this adapter, with--wave64-emulateon the Wave64 arm.Of the ten baseline discrepancies, four came from programs with fuzzer hypothesis operations. The other six include the earlier reported cases. All 200 SPIR-V modules passed Vulkan 1.2 validation and completed dispatch on the physical RTX 4090. This covers the seed-1 corpus on the rebased translator. AI-assisted with OpenAI Codex (GPT-6.2 Sol).
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-30T23:57:38Z.
Current-head status after the rebase: all visible checks are green, and the fresh independent RTX 4090 hardware retest above passed against the merged tree. From the author side this is ready for maintainer review/merge.
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:33:19Z.
Review: COMMENTED
Reviewed head diff against
main: this PR is cleanly rebased, clean-room verified, and has all CI checks green (plus independent RTX 4090 verification). Holding from merge because this is a competing variant against#1043for the same lane-mask-as-data defect (SHADER-MASK-AS-DATA); a maintainer needs to choose between#1397and#1043.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:52:47Z.
Review: APPROVED
Chosen over competing variant #1043 (now closed) and approving for merge.
src_u) always materialize the wave's 32-bit mask word, while mask consumers (mask_src,v_readfirstlane_b32into mask-tracked destinations) extract this lane's bit via_vgpr_mask_lane_bit(half-aware in wave64) and broadcast from the first active lane — avoiding the lookahead mismatches seen on#1043. Also incorporates scalarMASK_NUMBER_READERSand updateswave64_emulate_opt.py.main(MERGEABLE/CLEAN), all 7 CI checks green, clean-room verified, with GPU fixturecs_exec_copy.asm, 280+ lines of semantic tests, and independent RTX 4090 (50/50 native wave32 + 50/50 emulated wave64, 0/103,180 word mismatches) and RTX 4070 verification.(AI-assisted review.)