[PR #1507] [MERGED] crosslane_fuzz: --pc-tail-ubo for 128-byte push-constant GPUs #1536

Closed
opened 2026-11-26 20:21:35 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1507
Author: @whoalin1
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: crosslane-pctail-ubo


📝 Commits (1)

  • 706ecea crosslane_fuzz: --pc-tail-ubo for 128-byte push constant GPUs

📊 Changes

2 files changed (+100 additions, -16 deletions)

View changed files

📝 tests/test_crosslane_fuzz.py (+73 -5)
📝 tools/crosslane_fuzz.py (+27 -11)

📄 Description

Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7150962619 (posted earlier as a finding:).

What

tools/crosslane_fuzz.py had no --pc-tail-ubo flag and never forwarded it to rdna2spirv.py. On GPUs with maxPushConstantsSize = 128 (e.g. AMD Radeon iGPUs) every translated program failed with "need 144 push constant bytes", and setting LEONIDA_PC_TAIL_UBO=1 only for the harness ran the shader against the wrong layout — every word came back as the 0xEEEEEEEE anti-fold fill counted as mismatches. lds_fuzz/valu_fuzz/image_fuzz already 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_gpu set LEONIDA_PC_TAIL_UBO=1 for the vk_compute_test side (both sides must agree — the SPIR-V layout is baked at translate time), still_fails ctx carries pc_tail so --minimize re-translates with the same layout, and --pc-tail-ubo works standalone or via the env var. Default off → NVIDIA/other devices unaffected.

Tested

  • tests/test_crosslane_fuzz.py: 76 tests OK — new PcTailUbo class pins flag→translator, flag/env→gpu_env, env→enabled through main(); 5 existing fakes updated for the new kwarg.
  • compileall clean; --help shows the flag.
  • GPU spot-check, AMD Radeon iGPU (gfx1036, driver 24.10.24, validation on, 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).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1507 **Author:** [@whoalin1](https://github.com/whoalin1) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `crosslane-pctail-ubo` --- ### 📝 Commits (1) - [`706ecea`](https://github.com/ubiquitarianism/leonida/commit/706eceaf02ffad0b2445333503c6ebc8c1b92b78) crosslane_fuzz: --pc-tail-ubo for 128-byte push constant GPUs ### 📊 Changes **2 files changed** (+100 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_crosslane_fuzz.py` (+73 -5) 📝 `tools/crosslane_fuzz.py` (+27 -11) </details> ### 📄 Description Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7150962619 (posted earlier as a `finding:`). ## What `tools/crosslane_fuzz.py` had no `--pc-tail-ubo` flag and never forwarded it to `rdna2spirv.py`. On GPUs with `maxPushConstantsSize = 128` (e.g. AMD Radeon iGPUs) every translated program failed with "need 144 push constant bytes", and setting `LEONIDA_PC_TAIL_UBO=1` only for the harness ran the shader against the wrong layout — every word came back as the `0xEEEEEEEE` anti-fold fill counted as mismatches. `lds_fuzz`/`valu_fuzz`/`image_fuzz` already 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_gpu` set `LEONIDA_PC_TAIL_UBO=1` for the `vk_compute_test` side (both sides must agree — the SPIR-V layout is baked at translate time), `still_fails` ctx carries `pc_tail` so `--minimize` re-translates with the same layout, and `--pc-tail-ubo` works standalone or via the env var. Default off → NVIDIA/other devices unaffected. ## Tested - `tests/test_crosslane_fuzz.py`: **76 tests OK** — new `PcTailUbo` class pins flag→translator, flag/env→`gpu_env`, env→enabled through `main()`; 5 existing fakes updated for the new kwarg. - `compileall` clean; `--help` shows the flag. - GPU spot-check, AMD Radeon iGPU (gfx1036, driver 24.10.24, validation on, `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). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:21:35 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1536
No description provided.