mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #565] [CLOSED] Translator: --shader-list to translate only a subset of shaders #609
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#609
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/565
Author: @x2Tweek
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:shader-subset📝 Commits (4)
b13a2f3Translator: --shader-list to translate only a subset of shadersf0ac759Translator: --shader-list writes subset to separate dir, never touches full index01d444cTranslator: --shader-list never touches the full index; add testsd50e1a4make_game: include shader list content in shard plan identity📊 Changes
5 files changed (+255 additions, -66 deletions)
View changed files
📝
make_game.py(+93 -66)📝
tests/test_make_game_empty_translation.py(+58 -0)📝
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 (issue #14)
What and why
Add
--shader-list FILEtotools/rdna2spirv.pyandmake_game.pyso only the shaders whose stems are listed in FILE are translated,
instead of all 26,503. This cuts retranslation time for testing
translator changes on a small subset of the corpus.
make_game.pyskipsverify_translation_completeness()when--shader-listis given (the subset index is intentionally incomplete)and never touches the existing
spirv/index.json— the full indexalways survives a subset run. The subset is written to a separate
<spirv>/subset/directory.The content of the list is part of the shard plan's identity: the same list reuses finished shards, while a changed list (or the same file rewritten with other stems) translates again.
rdna2spirv.pyreads the list of shader stems (one per line) andfilters the
.sfiles from the disassembly directory beforetranslation, after the existing
--limitand--shardfilters.This is the translation half of the "translate only the shaders the
game actually uses" item. The other half — runtime instrumentation to
record which shader IDs
--runrequests — is C++ work not includedhere. This PR builds on PR #497's
native_hashes.txtindex(conceptually) but does not depend on it:
--shader-listworks withany list of shader stems.
Tested
python -I tools/rdna2spirv.py <work>/shaders/dxbc/disasm --out <scratch> --shader-list <5-stem-list> --no-asm --no-validate --assembler python:index.jsonhas 5 entries matching the listpy_compile+compileallon both files: OKcheck_no_game_data.pyon both files: OKpython -I tests/test_make_game_empty_translation.py(15 tests, including new full-index-survives-subset test): OKpython -I tests/test_rdna2spirv_cli.py(37 tests, including new --shader-list filter test): OKpython -I tests/test_shader_stage_resume.py(including the new subset-list identity test): OKGPU: not needed (CPU-only translation). No game files used.
AI-assisted: yes
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.