[PR #1529] Translator: --shader-list to translate only a subset of shaders (SHADER-SUBSET) #1558

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1529
Author: @x2Tweek
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: shader-subset-v2


📝 Commits (5)

  • 7811ea8 Translator: --shader-list to translate only a subset of shaders
  • 3fd9e04 Translator: --shader-list writes subset to separate dir, never touches full index
  • 6f18bc0 Translator: --shader-list never touches the full index; add tests
  • c3d1515 make_game: include shader list content in shard plan identity
  • e89c291 Restore the full translation spirv-opt preflight

📊 Changes

5 files changed (+269 additions, -71 deletions)

View changed files

📝 make_game.py (+95 -68)
📝 tests/test_make_game_empty_translation.py (+70 -3)
📝 tests/test_rdna2spirv_cli.py (+30 -0)
📝 tests/test_shader_stage_resume.py (+63 -0)
📝 tools/rdna2spirv.py (+11 -0)

📄 Description

Claimed in the coordination issue as: SHADER-SUBSET (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7125745299)

What and why

Translator: --shader-list to translate only a subset of shaders. Replaces closed PR #565 whose head conflicted with upstream/main. Rebased on upstream main at 0bc810504.

  • tools/rdna2spirv.py --shader-list FILE and make_game.py --shader-list FILE: subset writes to <spirv>/subset/, never touches the full spirv/index.json, skips fingerprint checks and verify_translation_completeness.
  • The shard plan beside the subset output now includes a SHA-256 of the shader list file's contents, so overwriting the same list file with a different selection drops old parts and re-translates only missing shards (fixes the stale-subset-cache bug reported by sodove on #565).
  • 3 new SubsetListIdentityTest cases in tests/test_shader_stage_resume.py cover same-list reuse, changed-list re-translate, and same-path overwrite re-translate.

Tested

  • tests/test_shader_stage_resume.py: 50 passed (3 new SubsetListIdentityTest cases)
  • tests/test_rdna2spirv_index_write.py: 8 passed, 1 skipped (9 total)
  • tests/test_make_game_empty_translation.py: 16 passed
  • tests/test_rdna2spirv_cli.py: 37 passed
  • python -m compileall -q make_game.py tools tests: clean
  • python -I make_game.py --help: clean
  • All synthetic inputs, no game data, no GPU needed. Tested locally on Windows, Python stdlib only.

GPUs tested: n/a

AI-assisted: yes (Claude Code)

Checklist:

  • No game data, keys or decryption
  • Translator rule in the contract table in docs/design.md (N/A — no new translator rule)
  • Tested on local Windows machine (Python 3.15.2, stdlib only)

🔄 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/1529 **Author:** [@x2Tweek](https://github.com/x2Tweek) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `shader-subset-v2` --- ### 📝 Commits (5) - [`7811ea8`](https://github.com/ubiquitarianism/leonida/commit/7811ea868f7d9b2ccb8e140a54b8e6632c55c8e6) Translator: --shader-list to translate only a subset of shaders - [`3fd9e04`](https://github.com/ubiquitarianism/leonida/commit/3fd9e04dedbba352e4359faf085ddc0c2a05b222) Translator: --shader-list writes subset to separate dir, never touches full index - [`6f18bc0`](https://github.com/ubiquitarianism/leonida/commit/6f18bc09d2dfcb1cef3fb6e05bcf12862fe9ec83) Translator: --shader-list never touches the full index; add tests - [`c3d1515`](https://github.com/ubiquitarianism/leonida/commit/c3d151561145efeae4a33a91a58fc854031f05be) make_game: include shader list content in shard plan identity - [`e89c291`](https://github.com/ubiquitarianism/leonida/commit/e89c29128b37cfd5a0a6cd7190dccd4a017309cb) Restore the full translation spirv-opt preflight ### 📊 Changes **5 files changed** (+269 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+95 -68) 📝 `tests/test_make_game_empty_translation.py` (+70 -3) 📝 `tests/test_rdna2spirv_cli.py` (+30 -0) 📝 `tests/test_shader_stage_resume.py` (+63 -0) 📝 `tools/rdna2spirv.py` (+11 -0) </details> ### 📄 Description Claimed in the coordination issue as: SHADER-SUBSET (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7125745299) ### What and why Translator: `--shader-list` to translate only a subset of shaders. Replaces closed PR #565 whose head conflicted with upstream/main. Rebased on upstream main at 0bc810504. - `tools/rdna2spirv.py --shader-list FILE` and `make_game.py --shader-list FILE`: subset writes to `<spirv>/subset/`, never touches the full `spirv/index.json`, skips fingerprint checks and `verify_translation_completeness`. - The shard plan beside the subset output now includes a SHA-256 of the shader list file's contents, so overwriting the same list file with a different selection drops old parts and re-translates only missing shards (fixes the stale-subset-cache bug reported by sodove on #565). - 3 new `SubsetListIdentityTest` cases in `tests/test_shader_stage_resume.py` cover same-list reuse, changed-list re-translate, and same-path overwrite re-translate. ### Tested - `tests/test_shader_stage_resume.py`: 50 passed (3 new SubsetListIdentityTest cases) - `tests/test_rdna2spirv_index_write.py`: 8 passed, 1 skipped (9 total) - `tests/test_make_game_empty_translation.py`: 16 passed - `tests/test_rdna2spirv_cli.py`: 37 passed - `python -m compileall -q make_game.py tools tests`: clean - `python -I make_game.py --help`: clean - All synthetic inputs, no game data, no GPU needed. Tested locally on Windows, Python stdlib only. GPUs tested: n/a AI-assisted: yes (Claude Code) Checklist: - [x] No game data, keys or decryption - [x] Translator rule in the contract table in docs/design.md (N/A — no new translator rule) - [x] Tested on local Windows machine (Python 3.15.2, stdlib only) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1558
No description provided.