crosslane_fuzz: --pc-tail-ubo for 128-byte push-constant GPUs #1507
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1507
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1507/head"
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?
@whoalin1 on GitHub · 2026-11-25 02:37 UTC · original
whoalin1:crosslane-pctail-ubo→main· +100 −16 · 2 files · 1 commits · merged 2026-11-25 21:32 UTCClaimed in the coordination issue: #14 (posted earlier as a
finding:).What
tools/crosslane_fuzz.pyhad no--pc-tail-uboflag and never forwarded it tordna2spirv.py. On GPUs withmaxPushConstantsSize = 128(e.g. AMD Radeon iGPUs) every translated program failed with "need 144 push constant bytes", and settingLEONIDA_PC_TAIL_UBO=1only for the harness ran the shader against the wrong layout — every word came back as the0xEEEEEEEEanti-fold fill counted as mismatches.lds_fuzz/valu_fuzz/image_fuzzalready handle this.Mirrors the sibling-fuzzer pattern exactly:
pc_tail_env()(LEONIDA_PC_TAIL_UBO= 1/true/yes/on),translate(..., pc_tail=)appends--pc-tail-ubo,gpu_env/run_gpusetLEONIDA_PC_TAIL_UBO=1for thevk_compute_testside (both sides must agree — the SPIR-V layout is baked at translate time),still_failsctx carriespc_tailso--minimizere-translates with the same layout, and--pc-tail-uboworks standalone or via the env var. Default off → NVIDIA/other devices unaffected.Tested
tests/test_crosslane_fuzz.py: 76 tests OK — newPcTailUboclass pins flag→translator, flag/env→gpu_env, env→enabled throughmain(); 5 existing fakes updated for the new kwarg.compileallclean;--helpshows the flag.LEONIDA_PC_TAIL_UBO=1):--programs 8 --seed 1 --wave both --modes native,emulate --no-maskdata --pc-tail-ubo→ wave32 native 4/4 + wave64 emulate 4/4 match, 0 harness errors (previously every program errored).AI-assisted (Devin).
@GeorgiyDemo on GitHub · 2026-11-25 02:51 UTC · original
Tested
1aeceed3aon Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmainf78385646(Python fuzzer; GPU execution throughvk_compute_testfrom the build at66d4f5aa3):pytest tests/test_crosslane_fuzz.py(pytest 9.2.0 fromtests/requirements.txt): 74 passed, 2 skipped, 18 subtests passed. The same file onmain: 5 failed, 72 passed, 2 skipped, 15 subtests — all fivePcTailUbo::*tests fail there.crosslane_fuzz.py --pc-tail-ubo --programs 5 --seed 1 --exe …/vk_compute_test: 5/5 match (3 wave32 native + 2 wave64 emulate, 0 mismatch, 0 harness errors). Onmainthe flag is rejected:error: unrecognized arguments: --pc-tail-ubo.maxPushConstantsSize = 256, so the 128-byte limit that motivated the flag is not present here; the pc-tail-ubo translation/harness path itself runs and matches, but the real 128-byte constraint is not exercised.AI-assisted; synthetic fixtures only, no game data.
@ytsodacan on GitHub · 2026-11-25 03:36 UTC · original · edited 2026-11-25 03:44 UTC
[KEEP]
tools/crosslane_fuzz.py,tests/test_crosslane_fuzz.py): flag plus env fallback threaded throughtranslate,gpu_env,run_gpu, and the--minimizectx tuple; matches the lds/valu fuzzers.change-scopeandno-game-dataare still pending. No conflicts.@ytsodacan on GitHub · 2026-11-25 03:41 UTC · original · edited 2026-11-25 03:44 UTC
[MERGE]
python3 -I tests/test_crosslane_fuzz.pyon each head, with and withoutLEONIDA_PC_TAIL_UBO=1in the environment: 76 tests OK (2 skipped) both ways here; #1501 is 77 and #1508 is 75, all OK, and--self-testpasses on all three.tools/crosslane_fuzz.pychange is the cleanest of the three.pc_tail_env()(line 1308),translate(..., pc_tail=False)(1313) andgpu_env/run_gpu(1324/1354) take one keyword with a default, and--pc-tail-ubois applied once inmain()(args.pc_tail_ubo = args.pc_tail_ubo or pc_tail_env(), 1499). The--minimizectx is always a 3-tuple (1409, 1586). #1501 instead branches every call site onpc_tailand keeps a 2-or-3-tuplectx, only to keep old test fakes working.LEONIDA_PC_TAIL_UBO=1forced ingpu_env, so--pc-tail-uboalso wins over an ambientLEONIDA_PC_TAIL_UBO=0. Env values1/true/yes/on(stripped, case-insensitive) enable it, matching the sibling fuzzers. All three PRs behave the same here.change-scopeandno-game-datawere still QUEUED when I checked (state MERGEABLE/UNSTABLE), so merge once they are green. I ran no GPU and did not runno-game-datamyself.--minimize/still_fails(), sincetests/test_crosslane_fuzz.pyhas no test that reaches the 3-tuple ctx (still_failsat line 1409 is only exercised on a GPU); (2) pinLEONIDA_PC_TAIL_UBOempty inHarnessErrors._main(#1501 does this attests/test_crosslane_fuzz.py:612) so an ambient=1cannot change those tests; (3) a test that the flag overridesLEONIDA_PC_TAIL_UBO=0. Alsorun_translatorreadsargs.pc_tail_ubodirectly;getattr(args, "pc_tail_ubo", False)as in #1508 would be safer for callers that build their ownargs.#1501 and #1508 are being marked duplicates of this PR; a maintainer still has to merge this one and close them.
@Gefik23 on GitHub · 2026-11-25 08:46 UTC · original
Tested 1aeceed3a on NVIDIA GeForce RTX 4060 (Ada), driver 617.42, Windows 11 Pro build 26200, native Windows: pass.
llvm-mc 21.1.8 from
scripts\build_llvm_mc.ps1, Vulkan SDK 1.4.363.0,vk_compute_testfromscripts\build_runtime.ps1(RelWithDebInfo).python -I tools/crosslane_fuzz.py --programs 50 --seed 1(wave32 native + wave64 emulate):main's fuzzer withLEONIDA_PC_TAIL_UBO=1(the bug)0xeeeeeeeedumps--pc-tail-uboLEONIDA_PC_TAIL_UBO=1The three logs from this PR are byte-identical, so on a GPU with 256 push-constant bytes the 128-byte layout gives the same words as the 144-byte one. The 4 remaining mismatches (
cs_xl32_100023native;cs_xl64_100014,cs_xl64_100026,cs_xl64_100034emulate) are the same without the flag and outside this PR.pytest tests/test_crosslane_fuzz.py: 74 passed, 2 skipped.AI-assisted (Claude Code ran the build and tests). No game files.
@whoalin1 on GitHub · 2026-11-25 18:44 UTC · original
Real-hardware check on the rebased head
c7b4b3f9c: AMD Radeon integrated GPU of a Ryzen 5 7600 (RDNA2/gfx1036, Windows driver 24.10.24, Vulkan 1.3.280,maxPushConstantsSize128), pc-tail enabled.tools/crosslane_fuzz.py --programs 50 --seed 1completed on both modes with 0 rejected programs, 0 harness errors and 0 skips:The important pc-tail result is that the run no longer produces the
0xeeeeeeeepush-constant garbage/harness failure shape on this 128-byte GPU: the translated programs are dispatched and read back normally. The four mismatches arecs_xl32_100023,cs_xl64_100014,cs_xl64_100026andcs_xl64_100034, the same four cases Gefik23 reported on a 256-byte NVIDIA GPU without depending on the pc-tail flag, so they are pre-existing crosslane/mask-model failures outside this plumbing PR.cs_xl32_100021is hypothesis-only.No game files. AI-assisted (SWE-2.1 Max ran/recorded the AMD check).
@whoalin1 on GitHub · 2026-11-25 20:59 UTC · original
Rebased cleanly onto current main (
db1a22d29) as706eceaf0; no conflicts. The branch is unchanged:crosslane_fuzz --pc-tail-ubofor 128-byte push-constant GPUs. The AMD RDNA2 evidence posted earlier stands on the same diff. AI-assisted with Devin.@whoalin1 on GitHub · 2026-11-25 21:13 UTC · original
Additional real-hardware pass on the rebased head
706eceaf0, AMD Radeon(TM) Graphics 128-byte iGPU (gfx1036), validation layers on (LEONIDA_VK_VALIDATION=1):exit 0, zero validation errors — the pc-tail-ubo layout agrees end to end (translator flag → SPIR-V set-1 block → harness bind) on the 128-byte device. AI-assisted (Devin).
@whoalin1 on GitHub · 2026-11-25 21:28 UTC · original
One more coverage data point on
706eceaf0, same AMD 128-byte iGPU, validation on — wave64 native (--w64-native, the least-tested configuration; gfx1036 subgroup 32..64, default 64):exit 0 — the pc-tail-ubo layout holds in native wave64 as well. AI-assisted (Devin).
@aslan2142 on GitHub · 2026-11-25 21:33 UTC · original
Merged, thanks! This is the one PR kept for
crosslane_fuzz --pc-tail-ubo. #1501 and #1508 make the same change, and I'm closing them as duplicates.db1a22d29(706eceaf0) changes onlytools/crosslane_fuzz.pyand its test, at the same size as the reviewed diff.main4eab4f6d3+706eceaf0: the semantic suite passes (491 files, 6,312 tests, 0 files failed);test_crosslane_fuzzpass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 2 changed files.AI-assisted (Claude Code, Claude Opus 5.5).