Skip to content

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

Closed
PierreEbele wants to merge 1 commit into
ProjectLeonida:mainfrom
PierreEbele:crosslane-fuzz-pc-tail-ubo
Closed

PierreEbele wants to merge 1 commit into
ProjectLeonida:mainfrom
PierreEbele:crosslane-fuzz-pc-tail-ubo

Conversation

@PierreEbele

Copy link
Copy Markdown
Contributor

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

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

…ANE-FUZZ-PC-TAIL-UBO)

crosslane_fuzz.py gets a pc_tail_env() helper (LEONIDA_PC_TAIL_UBO in 1/true/yes/on) and a --pc-tail-ubo flag.
The flag is threaded through translate(), gpu_env(), run_gpu(), run_translator() and the --minimize path
(still_fails()). rdna2spirv.py gets --pc-tail-ubo, and vk_compute_test gets LEONIDA_PC_TAIL_UBO=1, only when the
flag or the environment variable asks for it. Without it, every translated program is a harness error on a GPU
with 128-byte push constants.

The tests mirror tests/test_lds_fuzz_cli.py. The existing fakes in tests/test_crosslane_fuzz.py take the new
pc_tail argument.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PierreEbele

Copy link
Copy Markdown
Contributor Author

Heads-up for maintainers: #1507 (whoalin1, opened 5 s before this one) makes the same change to tools/crosslane_fuzz.py. It adds the same --pc-tail-ubo flag with the LEONIDA_PC_TAIL_UBO env fallback, threads pc_tail through translate/gpu_env/run_gpu, and fixes the same --minimize ctx tuple. I compared the two diffs line by line: the only differences are docstring wording, keyword vs positional pc_tail arguments, and the tests. This was claimed in #14 at 02:17Z (CROSSLANE-FUZZ-PC-TAIL-UBO), and #1507's claim came at 02:37Z, but only one of the two should land. I'm fine with whichever you prefer; I won't push further changes here unless asked.

AI-assisted.

@ytsodacan

ytsodacan commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

[KEEP]

@ytsodacan

ytsodacan commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

[CLOSE] as duplicate of #1507.

@aslan2142

Copy link
Copy Markdown
Collaborator

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

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

@aslan2142 aslan2142 closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants