[PR #1508] [CLOSED] crosslane_fuzz: add --pc-tail-ubo like lds_fuzz and valu_fuzz (CROSSLANE-FUZZ-PC-TAIL-UBO) #1535

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/1508
Author: @PierreEbele
Created: 11/25/2026
Status: ❌ Closed

Base: main ← Head: crosslane-fuzz-pc-tail-ubo


📝 Commits (1)

  • 10f1eb6 crosslane_fuzz: add --pc-tail-ubo like lds_fuzz and valu_fuzz (CROSSLANE-FUZZ-PC-TAIL-UBO)

📊 Changes

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

View changed files

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

📄 Description

Claimed in the coordination issue as: CROSSLANE-FUZZ-PC-TAIL-UBO (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7150544577)

Depends on: none. It merges cleanly with #318 and #716, which also touch run_gpu() in this file, and with #1397.

What changes

This is @whoalin1's finding in #14 (02:02Z). tools/crosslane_fuzz.py had no --pc-tail-ubo, so on a GPU with 128-byte push constants every translated program was a harness error. tools/lds_fuzz.py and tools/valu_fuzz.py already support the flag, and this PR copies their pattern:

  • pc_tail_env(), the same helper. LEONIDA_PC_TAIL_UBO set to 1, true, yes or on enables the mode.
  • A --pc-tail-ubo flag, also turned on by that environment variable.
  • translate() passes --pc-tail-ubo to rdna2spirv.py. gpu_env()/run_gpu() give vk_compute_test LEONIDA_PC_TAIL_UBO=1. Both happen only when asked.
  • The flag reaches both callers: the translator run loop (run_translator()) and the --minimize path (still_fails()). The hardware oracle path does not translate and is unchanged.

Not in scope: the second half of the finding, which is how mismatches are counted when a run is done with the wrong layout. With this flag the layouts match.

Tests

On Linux arm64, in a sandbox with no network and no GPU:

  • New PcTailUbo tests in tests/test_crosslane_fuzz.py, modelled on tests/test_lds_fuzz_cli.py. With subprocess.run mocked, they check that the translator command and the vk_compute_test environment get the flag only when asked. They also check that --pc-tail-ubo or LEONIDA_PC_TAIL_UBO=1/yes turns it on through main(), and that 0 or an unset variable leave it off.
  • Same test file, with main's tools/crosslane_fuzz.py: FAILED (failures=2, errors=2, skipped=2). The only failures are the new tests.
  • With this branch: 75 tests, OK (skipped=2). The 2 skips are the hardware-oracle tests. --self-test is OK.
  • scripts/check_no_game_data.py on both changed files: clean.

Not run: a real 128-byte-push-constant GPU. None is available here.

AI-assisted.

🤖 Generated with Claude Code


🔄 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/1508 **Author:** [@PierreEbele](https://github.com/PierreEbele) **Created:** 11/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `crosslane-fuzz-pc-tail-ubo` --- ### 📝 Commits (1) - [`10f1eb6`](https://github.com/ubiquitarianism/leonida/commit/10f1eb6a6f42e4589e9a0572500cc8fbba209736) crosslane_fuzz: add --pc-tail-ubo like lds_fuzz and valu_fuzz (CROSSLANE-FUZZ-PC-TAIL-UBO) ### 📊 Changes **2 files changed** (+106 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_crosslane_fuzz.py` (+79 -5) 📝 `tools/crosslane_fuzz.py` (+27 -11) </details> ### 📄 Description Claimed in the coordination issue as: CROSSLANE-FUZZ-PC-TAIL-UBO (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7150544577) Depends on: none. It merges cleanly with #318 and #716, which also touch `run_gpu()` in this file, and with #1397. ## What changes This is @whoalin1's finding in #14 (02:02Z). `tools/crosslane_fuzz.py` had no `--pc-tail-ubo`, so on a GPU with 128-byte push constants every translated program was a harness error. `tools/lds_fuzz.py` and `tools/valu_fuzz.py` already support the flag, and this PR copies their pattern: - `pc_tail_env()`, the same helper. `LEONIDA_PC_TAIL_UBO` set to `1`, `true`, `yes` or `on` enables the mode. - A `--pc-tail-ubo` flag, also turned on by that environment variable. - `translate()` passes `--pc-tail-ubo` to `rdna2spirv.py`. `gpu_env()`/`run_gpu()` give `vk_compute_test` `LEONIDA_PC_TAIL_UBO=1`. Both happen only when asked. - The flag reaches both callers: the translator run loop (`run_translator()`) and the `--minimize` path (`still_fails()`). The hardware oracle path does not translate and is unchanged. Not in scope: the second half of the finding, which is how mismatches are counted when a run is done with the wrong layout. With this flag the layouts match. ## Tests On Linux arm64, in a sandbox with no network and no GPU: - New `PcTailUbo` tests in `tests/test_crosslane_fuzz.py`, modelled on `tests/test_lds_fuzz_cli.py`. With `subprocess.run` mocked, they check that the translator command and the `vk_compute_test` environment get the flag only when asked. They also check that `--pc-tail-ubo` or `LEONIDA_PC_TAIL_UBO=1`/`yes` turns it on through `main()`, and that `0` or an unset variable leave it off. - Same test file, with main's `tools/crosslane_fuzz.py`: `FAILED (failures=2, errors=2, skipped=2)`. The only failures are the new tests. - With this branch: 75 tests, `OK (skipped=2)`. The 2 skips are the hardware-oracle tests. `--self-test` is OK. - `scripts/check_no_game_data.py` on both changed files: clean. Not run: a real 128-byte-push-constant GPU. None is available here. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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#1535
No description provided.