crosslane_fuzz: support --pc-tail-ubo and LEONIDA_PC_TAIL_UBO (FUZZ-CROSSLANE-PC-TAIL-UBO) #1501

Closed
github-bot wants to merge 1 commit from gh-pr/1501/head into gh-pr/1501/base
Owner

@⁠IlyassRS3 on GitHub · 2026-11-25 02:21 UTC · original
IlyassRS3:feat/crosslane-fuzz-pc-tail-ubo → main · +196 −11 · 2 files · 1 commits · closed without merging

Claimed in the coordination issue as: FUZZ-CROSSLANE-PC-TAIL-UBO (#14)

What and why

Addresses @⁠whoalin1's finding in #14: tools/crosslane_fuzz.py had no --pc-tail-ubo flag and did not honor LEONIDA_PC_TAIL_UBO, unlike tools/lds_fuzz.py, tools/valu_fuzz.py, and tools/image_fuzz.py. On 128-byte-push-constant GPUs (such as AMD RDNA2 iGPUs / gfx1036), vk_compute_test either exited 77 (counted as a harness error) when LEONIDA_PC_TAIL_UBO was unset, or ran against the wrong layout (0xEEEEEEEE pre-fill counted as mismatches) when LEONIDA_PC_TAIL_UBO=1 was set in the environment without forwarding --pc-tail-ubo to rdna2spirv.py.

  • Adds pc_tail_env() and --pc-tail-ubo to tools/crosslane_fuzz.py (args.pc_tail_ubo = args.pc_tail_ubo or pc_tail_env(), matching lds_fuzz.py, valu_fuzz.py, and image_fuzz.py).
  • Forwards --pc-tail-ubo to rdna2spirv.py in translate() and sets LEONIDA_PC_TAIL_UBO=1 in gpu_env() / run_gpu() across both run_translator() and --minimize (still_fails()).
  • Keeps 2-argument translate / 5-argument run_gpu / 2-tuple still_fails ctx compatibility when pc_tail is off, and isolates HarnessErrors._main in tests/test_crosslane_fuzz.py from an ambient LEONIDA_PC_TAIL_UBO=1.
  • Adds PcTailUbo unit tests covering CLI flag, env var variants (1/true/YES/on/0), flag overriding LEONIDA_PC_TAIL_UBO=0, translate(), gpu_env(), run_gpu(), and --minimize / still_fails().

Tested

  • python3 -I tests/test_crosslane_fuzz.py: 77/77 OK (2 hw-oracle tests skipped).
  • LEONIDA_PC_TAIL_UBO=1 python3 -I tests/test_crosslane_fuzz.py: 77/77 OK (2 skipped).
  • Mutation check against unpatched main (3ff2a2adc): tests/test_crosslane_fuzz.py PcTailUbo fails 4/4 (failures=4, errors=6).
  • python3 -I tools/crosslane_fuzz.py --self-test: self-test OK.
  • python3 -I tests/test_mc_command.py: 29/29 OK (2 skipped).
  • python3 -I tests/test_text_write_line_endings.py: 3/3 OK.
  • python3 -I scripts/check_no_game_data.py tools/crosslane_fuzz.py tests/test_crosslane_fuzz.py: clean.
  • python3 -m compileall -q tools/crosslane_fuzz.py tests/test_crosslane_fuzz.py: clean.

GPUs tested: n/a (macOS arm64 host; unit/CLI tests only, no Vulkan GPU harness)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a — no translator rule changed)
**@⁠IlyassRS3** on GitHub · 2026-11-25 02:21 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1501) `IlyassRS3:feat/crosslane-fuzz-pc-tail-ubo` → `main` · +196 −11 · 2 files · 1 commits · closed without merging Claimed in the coordination issue as: FUZZ-CROSSLANE-PC-TAIL-UBO (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why Addresses @⁠whoalin1's finding in [#14](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14): `tools/crosslane_fuzz.py` had no `--pc-tail-ubo` flag and did not honor `LEONIDA_PC_TAIL_UBO`, unlike `tools/lds_fuzz.py`, `tools/valu_fuzz.py`, and `tools/image_fuzz.py`. On 128-byte-push-constant GPUs (such as AMD RDNA2 iGPUs / gfx1036), `vk_compute_test` either exited 77 (counted as a harness error) when `LEONIDA_PC_TAIL_UBO` was unset, or ran against the wrong layout (`0xEEEEEEEE` pre-fill counted as mismatches) when `LEONIDA_PC_TAIL_UBO=1` was set in the environment without forwarding `--pc-tail-ubo` to `rdna2spirv.py`. - Adds `pc_tail_env()` and `--pc-tail-ubo` to `tools/crosslane_fuzz.py` (`args.pc_tail_ubo = args.pc_tail_ubo or pc_tail_env()`, matching `lds_fuzz.py`, `valu_fuzz.py`, and `image_fuzz.py`). - Forwards `--pc-tail-ubo` to `rdna2spirv.py` in `translate()` and sets `LEONIDA_PC_TAIL_UBO=1` in `gpu_env()` / `run_gpu()` across both `run_translator()` and `--minimize` (`still_fails()`). - Keeps 2-argument `translate` / 5-argument `run_gpu` / 2-tuple `still_fails` `ctx` compatibility when `pc_tail` is off, and isolates `HarnessErrors._main` in `tests/test_crosslane_fuzz.py` from an ambient `LEONIDA_PC_TAIL_UBO=1`. - Adds `PcTailUbo` unit tests covering CLI flag, env var variants (`1`/`true`/`YES`/`on`/`0`), flag overriding `LEONIDA_PC_TAIL_UBO=0`, `translate()`, `gpu_env()`, `run_gpu()`, and `--minimize` / `still_fails()`. ### Tested - `python3 -I tests/test_crosslane_fuzz.py`: 77/77 OK (2 hw-oracle tests skipped). - `LEONIDA_PC_TAIL_UBO=1 python3 -I tests/test_crosslane_fuzz.py`: 77/77 OK (2 skipped). - Mutation check against unpatched `main` (`3ff2a2adc`): `tests/test_crosslane_fuzz.py PcTailUbo` fails 4/4 (`failures=4, errors=6`). - `python3 -I tools/crosslane_fuzz.py --self-test`: `self-test OK`. - `python3 -I tests/test_mc_command.py`: 29/29 OK (2 skipped). - `python3 -I tests/test_text_write_line_endings.py`: 3/3 OK. - `python3 -I scripts/check_no_game_data.py tools/crosslane_fuzz.py tests/test_crosslane_fuzz.py`: clean. - `python3 -m compileall -q tools/crosslane_fuzz.py tests/test_crosslane_fuzz.py`: clean. GPUs tested: n/a (macOS arm64 host; unit/CLI tests only, no Vulkan GPU harness) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a — no translator rule changed)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:54:23 +00:00
github-bot closed this pull request 2026-11-26 09:54:23 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 02:21 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-25 02:21 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1501#pullrequestreview-6050749124) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Author
Owner

@⁠ytsodacan on GitHub · 2026-11-25 03:36 UTC · original · edited 2026-11-25 03:44 UTC

[KEEP]

  • Overlaps open PRs #1507 and #1508, which add the same --pc-tail-ubo option to tools/crosslane_fuzz.py (and tests/test_crosslane_fuzz.py). This one was opened first, but a maintainer should choose one and close the rest.
  • No CI checks have run on feat/crosslane-fuzz-pc-tail-ubo (none reported), so the stated 77/77 test results are unverified.
  • The change is coherent: pc_tail_env(), forwarding to translate(), gpu_env()/run_gpu() and --minimize, with backward-compatible ctx tuples and PcTailUbo tests. It is a larger diff than the others, so compare it against #1507/#1508 when deciding.
**@⁠ytsodacan** on GitHub · 2026-11-25 03:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1501#issuecomment-7152072343) · edited 2026-11-25 03:44 UTC **[KEEP]** - Overlaps open PRs #1507 and #1508, which add the same `--pc-tail-ubo` option to `tools/crosslane_fuzz.py` (and `tests/test_crosslane_fuzz.py`). This one was opened first, but a maintainer should choose one and close the rest. - No CI checks have run on `feat/crosslane-fuzz-pc-tail-ubo` (none reported), so the stated 77/77 test results are unverified. - The change is coherent: `pc_tail_env()`, forwarding to `translate()`, `gpu_env()`/`run_gpu()` and `--minimize`, with backward-compatible `ctx` tuples and `PcTailUbo` tests. It is a larger diff than the others, so compare it against #1507/#1508 when deciding.
Author
Owner

@⁠ytsodacan on GitHub · 2026-11-25 03:41 UTC · original · edited 2026-11-25 03:44 UTC

[CLOSE] as duplicate of #1507.

  • Same change to tools/crosslane_fuzz.py as #1507 and #1508 (pc_tail_env(), --pc-tail-ubo, forwarding to translate, gpu_env/run_gpu, --minimize). I ran python3 -I tests/test_crosslane_fuzz.py on this head: 77 tests OK (2 skipped), with and without LEONIDA_PC_TAIL_UBO=1. Correctness is fine; the problem is the shape of the code.
  • Every call site now duplicates the call to avoid passing pc_tail when it is off, for example translate(...) if pc_tail else translate(...) in translate/run_gpu callers inside still_fails and run_translator, and still_fails accepts a 2- or 3-tuple ctx (if len(ctx) == 3). That only keeps old two-argument test fakes working, adds branches that the tests have to cover, and would be easy to get wrong later. #1507 updates the five fakes and passes pc_tail= straight through.
  • No real 128-byte hardware run is reported here (the PR says macOS arm64, unit tests only); #1507 reports a gfx1036 run with 0 harness errors.
  • Good ideas to port to #1507: the still_fails() / --minimize test (test_minimize_and_still_fails_forward_pc_tail_ubo), the ambient-env isolation in HarnessErrors._main (tests/test_crosslane_fuzz.py:612), and the "flag overrides LEONIDA_PC_TAIL_UBO=0" check in gpu_env.
  • No CI had been reported for this branch when I checked.
**@⁠ytsodacan** on GitHub · 2026-11-25 03:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1501#issuecomment-7152148922) · edited 2026-11-25 03:44 UTC **[CLOSE]** as duplicate of #1507. - Same change to `tools/crosslane_fuzz.py` as #1507 and #1508 (`pc_tail_env()`, `--pc-tail-ubo`, forwarding to `translate`, `gpu_env`/`run_gpu`, `--minimize`). I ran `python3 -I tests/test_crosslane_fuzz.py` on this head: 77 tests OK (2 skipped), with and without `LEONIDA_PC_TAIL_UBO=1`. Correctness is fine; the problem is the shape of the code. - Every call site now duplicates the call to avoid passing `pc_tail` when it is off, for example `translate(...) if pc_tail else translate(...)` in `translate`/`run_gpu` callers inside `still_fails` and `run_translator`, and `still_fails` accepts a 2- or 3-tuple `ctx` (`if len(ctx) == 3`). That only keeps old two-argument test fakes working, adds branches that the tests have to cover, and would be easy to get wrong later. #1507 updates the five fakes and passes `pc_tail=` straight through. - No real 128-byte hardware run is reported here (the PR says macOS arm64, unit tests only); #1507 reports a gfx1036 run with 0 harness errors. - Good ideas to port to #1507: the `still_fails()` / `--minimize` test (`test_minimize_and_still_fails_forward_pc_tail_ubo`), the ambient-env isolation in `HarnessErrors._main` (`tests/test_crosslane_fuzz.py:612`), and the "flag overrides `LEONIDA_PC_TAIL_UBO=0`" check in `gpu_env`. - No CI had been reported for this branch when I checked.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 21:34 UTC · original

Thanks for this! Closing as a duplicate: #1507 landed the same --pc-tail-ubo change to tools/crosslane_fuzz.py (merged as ab2fb71cb).

  • Nothing is wrong with this one, and it was opened first. The coordinator compared all three PRs (#1501, #1507, #1508) and picked #1507, which also had the most outside hardware testing.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 21:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1501#issuecomment-7175258798) Thanks for this! Closing as a duplicate: #1507 landed the same `--pc-tail-ubo` change to `tools/crosslane_fuzz.py` (merged as `ab2fb71cb`). - Nothing is wrong with this one, and it was opened first. The coordinator compared all three PRs (#1501, #1507, #1508) and picked #1507, which also had the most outside hardware testing. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.