crosslane_fuzz: plumb --pc-tail-ubo through translate and vk_compute_test like lds_fuzz (CROSSLANE-FUZZ-PCTAIL) #1709

Closed
thiefyzheng wants to merge 1 commit from upstream-pr/1709 into main
thiefyzheng commented 2026-11-25 08:59:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-11-25T08:59:30Z.


CROSSLANE-FUZZ-PCTAIL

Claimed on #1608 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7157649481). Fixes @whoalin1's finding (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156819685): tools/crosslane_fuzz.py had no --pc-tail-ubo plumbing, so on 128-byte-push-constant GPUs (AMD gfx1036 iGPU) every vk_compute_test either exits 77 without LEONIDA_PC_TAIL_UBO or dumps 0xeeeeeeee mismatches when the env is set but the SPIR-V was built without the flag.

What

Exactly the plumbing tools/lds_fuzz.py already has (also valu_fuzz.py, image_fuzz.py, scripts/run_gpu_tests.py):

  • pc_tail_env() — LEONIDA_PC_TAIL_UBO true for 1/true/yes/on, same body as lds_fuzz's.
  • translate(..., pc_tail=False) appends --pc-tail-ubo to the rdna2spirv command (both failure modes covered: the SPIR-V is built for 128-byte push constants).
  • run_gpu(..., pc_tail=False) sets LEONIDA_PC_TAIL_UBO=1 in the vk_compute_test environment.
  • --pc-tail-ubo argparse flag with lds_fuzz's exact help text, args.pc_tail_ubo = args.pc_tail_ubo or pc_tail_env(), wired through run_translator into both translate and every run_gpu call.

What was run

  • python3 -m compileall -q tools/crosslane_fuzz.py — OK.
  • python3 -I tests/test_crosslane_fuzz.py — Ran 75 tests, OK (skipped=2) (baseline before the change: 65 tests OK). New PcTailUbo cases mirror tests/test_lds_fuzz_cli.py:81-140: flag forwarded to the rdna2spirv argv, env set on vk_compute_test only when asked, flag/env fallback for 1/yes/0.
  • Guard check: reverting only tools/crosslane_fuzz.py to the parent commit and keeping the tests fails 4 of them (2 failures + 2 errors); restoring goes green again.
  • Three pre-existing HarnessError fakes in the test file were updated to accept the new kwarg.

NOT verified

End-to-end on the gfx1036 iGPU: actual exit-77 behavior at 128-byte push constants and matching dumps for pc-tail-translated programs need that hardware (llvm-mc/Vulkan/GPU paths are faked in the tests). Our XTX rig is not 128B-limited.

Attribution

AI-assisted (GLM 5.3 Flash worker implementation, contributor verification and orchestration). No game files used or needed.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5488221819 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1709). Originally posted by [thiefyzheng](https://github.com/thiefyzheng) on 2026-11-25T08:59:30Z. --- ## CROSSLANE-FUZZ-PCTAIL Claimed on #1608 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7157649481). Fixes @whoalin1's finding (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156819685): `tools/crosslane_fuzz.py` had no `--pc-tail-ubo` plumbing, so on 128-byte-push-constant GPUs (AMD gfx1036 iGPU) every `vk_compute_test` either exits 77 without `LEONIDA_PC_TAIL_UBO` or dumps 0xeeeeeeee mismatches when the env is set but the SPIR-V was built without the flag. ### What Exactly the plumbing `tools/lds_fuzz.py` already has (also `valu_fuzz.py`, `image_fuzz.py`, `scripts/run_gpu_tests.py`): - `pc_tail_env()` — `LEONIDA_PC_TAIL_UBO` true for `1/true/yes/on`, same body as `lds_fuzz`'s. - `translate(..., pc_tail=False)` appends `--pc-tail-ubo` to the rdna2spirv command (both failure modes covered: the SPIR-V is built for 128-byte push constants). - `run_gpu(..., pc_tail=False)` sets `LEONIDA_PC_TAIL_UBO=1` in the `vk_compute_test` environment. - `--pc-tail-ubo` argparse flag with lds_fuzz's exact help text, `args.pc_tail_ubo = args.pc_tail_ubo or pc_tail_env()`, wired through `run_translator` into both `translate` and every `run_gpu` call. ### What was run - `python3 -m compileall -q tools/crosslane_fuzz.py` — OK. - `python3 -I tests/test_crosslane_fuzz.py` — **Ran 75 tests, OK (skipped=2)** (baseline before the change: 65 tests OK). New `PcTailUbo` cases mirror `tests/test_lds_fuzz_cli.py:81-140`: flag forwarded to the rdna2spirv argv, env set on `vk_compute_test` only when asked, flag/env fallback for `1/yes/0`. - Guard check: reverting only `tools/crosslane_fuzz.py` to the parent commit and keeping the tests fails 4 of them (2 failures + 2 errors); restoring goes green again. - Three pre-existing `HarnessError` fakes in the test file were updated to accept the new kwarg. ### NOT verified End-to-end on the gfx1036 iGPU: actual exit-77 behavior at 128-byte push constants and matching dumps for pc-tail-translated programs need that hardware (llvm-mc/Vulkan/GPU paths are faked in the tests). Our XTX rig is not 128B-limited. ### Attribution AI-assisted (GLM 5.3 Flash worker implementation, contributor verification and orchestration). No game files used or needed.
thiefyzheng commented 2026-11-25 09:43:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-11-25T09:43:08Z.


Withdrawing as a duplicate of #1507 — sorry for the noise.

When I claimed CROSSLANE-FUZZ-PCTAIL on the board I replayed the recent claiming: comments and this finding, but did not search the OPEN PULL REQUESTS, which the coordination issue's own rules say to do. #1501/#1507/#1508 predate my claim by ~6 hours; @ytsodacan had already processed the triplicate and picked #1507, which additionally has GPU runs (Apple M5 Pro and RTX 4060). My claim was invalid for that reason, and this PR adds nothing to what #1507 covers.

For the record only: #1709 was verified the same way (compileall, 75/75 tests incl. 10 new, revert-the-source guard check) and is byte-equivalent in behavior to #1507's approach; reviewers need not look here. No game files used. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7158707649 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1709#issuecomment-7158707649). Originally posted by [thiefyzheng](https://github.com/thiefyzheng) on 2026-11-25T09:43:08Z. --- Withdrawing as a duplicate of #1507 — sorry for the noise. When I claimed CROSSLANE-FUZZ-PCTAIL on the board I replayed the recent `claiming:` comments and this finding, but did not search the OPEN PULL REQUESTS, which the coordination issue's own rules say to do. #1501/#1507/#1508 predate my claim by ~6 hours; @ytsodacan had already processed the triplicate and picked #1507, which additionally has GPU runs (Apple M5 Pro and RTX 4060). My claim was invalid for that reason, and this PR adds nothing to what #1507 covers. For the record only: #1709 was verified the same way (compileall, 75/75 tests incl. 10 new, revert-the-source guard check) and is byte-equivalent in behavior to #1507's approach; reviewers need not look here. No game files used. AI-assisted.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1709
No description provided.