shader_carve: exclude the length byte from shader names (SHADER-CARVE-NAME-LENGTH) #1361

Open
github-bot wants to merge 1 commit from github-bot/gh-1361 into main AGit
Owner

@⁠x2Tweek on GitHub · 2026-11-24 22:31 UTC · original
x2Tweek:fix-carve-name → main · +80 −14 · 4 files · 1 commits · open

Claimed in the coordination issue as: SHADER-CARVE-NAME-LENGTH (#14)

What and why

A printable name-length byte can be captured as the first letter of a shader name. Interpret the length after matching the candidate header so both the Python and optional native scanners use the same name handling. Check for a length field immediately before the match to preserve a real first character that happens to have the same value as the matched name length.

The correction changes some output filenames and translation-index keys. Existing work folders need the shaders stage again. Run python -I make_game.py --stages shaders with your usual game and work-folder options. A missing or stale carve-source digest tells that stage to recarve, unpack, disassemble and translate.

Tested

  • python -I tests/test_shader_carve.py, python -I tests/test_shader_stage_resume.py, python -I tests/test_shader_stage_manifest.py, python -I tests/test_shader_library.py, and python -I tests/test_text_write_line_endings.py.
  • Built the optional scanner with cargo build --release --offline --manifest-path tools/shader_carve_native/Cargo.toml and ran python -I tests/test_shader_carve_native.py with LEONIDA_TEST_REQUIRE_SHADER_CARVE_NATIVE=1. Also ran the new carve regression with LEONIDA_SHADER_CARVE_NATIVE=0.
  • Measured on one 1.0.2.1 translation index (counts only): 6,275 of 26,503 shader names (24%) have a first character whose code equals the name's own length, which is the stray length byte this change removes; chance alone would give about 1-2%. Those names, and the index keys built from them, change; the shaders stage must therefore run again (carve, then translation) on existing work folders.
  • 126 targeted tests passed. One shader-library symlink subtest was skipped because Windows denied symlink creation. Python compilation, make_game.py --help, the game-data check and git diff --check passed.

GPUs tested: n/a. CPU-only synthetic fixtures and mocked pipeline tools on Windows. No retail corpus run.

AI-assisted: yes.

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
**@⁠x2Tweek** on GitHub · 2026-11-24 22:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1361) `x2Tweek:fix-carve-name` → `main` · +80 −14 · 4 files · 1 commits · open Claimed in the coordination issue as: SHADER-CARVE-NAME-LENGTH (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why A printable name-length byte can be captured as the first letter of a shader name. Interpret the length after matching the candidate header so both the Python and optional native scanners use the same name handling. Check for a length field immediately before the match to preserve a real first character that happens to have the same value as the matched name length. The correction changes some output filenames and translation-index keys. Existing work folders need the shaders stage again. Run `python -I make_game.py --stages shaders` with your usual game and work-folder options. A missing or stale carve-source digest tells that stage to recarve, unpack, disassemble and translate. ### Tested - `python -I tests/test_shader_carve.py`, `python -I tests/test_shader_stage_resume.py`, `python -I tests/test_shader_stage_manifest.py`, `python -I tests/test_shader_library.py`, and `python -I tests/test_text_write_line_endings.py`. - Built the optional scanner with `cargo build --release --offline --manifest-path tools/shader_carve_native/Cargo.toml` and ran `python -I tests/test_shader_carve_native.py` with `LEONIDA_TEST_REQUIRE_SHADER_CARVE_NATIVE=1`. Also ran the new carve regression with `LEONIDA_SHADER_CARVE_NATIVE=0`. - Measured on one 1.0.2.1 translation index (counts only): 6,275 of 26,503 shader names (24%) have a first character whose code equals the name's own length, which is the stray length byte this change removes; chance alone would give about 1-2%. Those names, and the index keys built from them, change; the shaders stage must therefore run again (carve, then translation) on existing work folders. - 126 targeted tests passed. One shader-library symlink subtest was skipped because Windows denied symlink creation. Python compilation, `make_game.py --help`, the game-data check and `git diff --check` passed. GPUs tested: n/a. CPU-only synthetic fixtures and mocked pipeline tools on Windows. No retail corpus run. AI-assisted: yes. ### Checklist - [x] Based on current main. - [x] One topic. - [x] No game data, keys or decryption.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:48:44 +00:00
Author
Owner

@⁠x2Tweek on GitHub · 2026-11-25 03:47 UTC · original

Local verification of PR #1361 changes (shader_carve length-byte fix), run on Windows with Python 3.15.2:

  • tests/test_shader_carve.py: 32 passed, 0 failed
  • tests/test_shader_stage_resume.py: 48 passed, 0 failed
  • python -m compileall -q make_game.py tools/shader_carve.py tests/test_shader_carve.py tests/test_shader_stage_resume.py: clean
  • python -I scripts/check_no_game_data.py tools/shader_carve.py make_game.py tests/test_shader_carve.py tests/test_shader_stage_resume.py: clean
  • python -I make_game.py --help: clean

The Windows CI check (windows in Runtime workflow) shows FAILURE; all other completed checks pass (change-scope, no-game-data, linux-gpu-tools). Several CI checks are still QUEUED. Local tests pass on this machine; the Windows failure may be environmental or pre-existing.

AI-assisted: yes (Claude Code)

No game data, no local paths, no secrets.

**@⁠x2Tweek** on GitHub · 2026-11-25 03:47 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1361#issuecomment-7152248485) Local verification of PR #1361 changes (shader_carve length-byte fix), run on Windows with Python 3.15.2: - `tests/test_shader_carve.py`: 32 passed, 0 failed - `tests/test_shader_stage_resume.py`: 48 passed, 0 failed - `python -m compileall -q make_game.py tools/shader_carve.py tests/test_shader_carve.py tests/test_shader_stage_resume.py`: clean - `python -I scripts/check_no_game_data.py tools/shader_carve.py make_game.py tests/test_shader_carve.py tests/test_shader_stage_resume.py`: clean - `python -I make_game.py --help`: clean The Windows CI check (`windows` in Runtime workflow) shows FAILURE; all other completed checks pass (change-scope, no-game-data, linux-gpu-tools). Several CI checks are still QUEUED. Local tests pass on this machine; the Windows failure may be environmental or pre-existing. AI-assisted: yes (Claude Code) No game data, no local paths, no secrets.
Author
Owner

@⁠x2Tweek on GitHub · 2026-11-25 07:49 UTC · original

The three failures at merge commit 3e48a50eb reproduce on upstream baselines:

  • windows: CTest counted the Vulkan readback test's exit 77 as a failure when the runner lacked bufferDeviceAddress. #1418 reproduces this on main at e8fee01cd and adds the missing skip registration.
  • translator-tests: LLVM 21.1.8 rejected the text-only cs_dpp_cmp.asm fixture in two pytest cases before translation. #1375 documents the same failures on main at 4a50cafc7 and 89d7dfcf5 and updates the pytest helper.
  • stdlib-tests-linux: I reproduced the same registration assertion locally on the exact CI base, main at 2a5ff9714. The scanner missed inherited tests in test_sub_co_same_operand.py. The fixture itself ran six tests successfully. The scanner fix has since merged in #1365.

AI-assisted: yes.

**@⁠x2Tweek** on GitHub · 2026-11-25 07:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1361#issuecomment-7156284129) The three failures at merge commit `3e48a50eb` reproduce on upstream baselines: - `windows`: CTest counted the Vulkan readback test's exit 77 as a failure when the runner lacked `bufferDeviceAddress`. #1418 reproduces this on `main` at `e8fee01cd` and adds the missing skip registration. - `translator-tests`: LLVM 21.1.8 rejected the text-only `cs_dpp_cmp.asm` fixture in two pytest cases before translation. #1375 documents the same failures on `main` at `4a50cafc7` and `89d7dfcf5` and updates the pytest helper. - `stdlib-tests-linux`: I reproduced the same registration assertion locally on the exact CI base, `main` at `2a5ff9714`. The scanner missed inherited tests in `test_sub_co_same_operand.py`. The fixture itself ran six tests successfully. The scanner fix has since merged in #1365. AI-assisted: yes.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1361/head:github-bot/gh-1361'
git switch 'github-bot/gh-1361'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1361'
git switch 'github-bot/gh-1361'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1361'
git switch 'github-bot/gh-1361'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1361'
git switch 'main'
git merge --squash 'github-bot/gh-1361'
git switch 'main'
git merge --ff-only 'github-bot/gh-1361'
git switch 'main'
git merge 'github-bot/gh-1361'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.