make_game: a saved translated index that names a shader not carved here is translated again (BUILD-SHADER-RESUME-IDENTITY) #1372
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1372"
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?
Imported from ubiquitarianism/leonida. Originally posted by Mykolas009 on 2026-11-24T22:47:28Z.
Claimed in the coordination issue as: BUILD-SHADER-RESUME-IDENTITY (claim, from sxnistxr's finding).
What and why
On a resumed shader stage,
make_game.shaderskept a savedshaders/spirv/index.jsonthat names other shaders than this work folder's, as long as it had the right number of entries:verify_translation_completenesscompares only the counts. The build then reports the stage done while the shaders the runtime will ask for were never translated.Reproduced on
mainwithShaderStageResumeTest's fixture: after one run, replace the index's only key with an unrelated name; the second run executes no step.A shader keeps its carved file's stem through unpacking, disassembly and translation (
fssm_unpack.pyandshader_disasm.pykeep the stem,rdna2spirv.pynames each entry after its listing), so the stage now compares names:translated_index_strangers(index, carved)returns the names in the translated index that are no carved shader of this folder (nothing when a file is missing, unreadable or malformed: other checks own those cases).tests/test_make_game_empty_translation.py: its fixture carvedshaderbut translatedshader_0; it now uses one name, as the real tools do.Tested
Windows 11, Python 3.14.3, standard library only, no game files, no GPU:
python -I tests/test_shader_stage_resume.py: 50 tests, OK. The three new tests fail withmake_game.pyfrommain(2 failures, 1 error) and pass with this change.python -Ion everytests/test_make_game*.py,tests/test_*shaders_stage*.pyandtests/test_text_write_line_endings.py: all OK.python -I scripts/check_no_game_data.pyon the three changed files: clean.Not covered
<name>.spvis gone is not detected here: the stage fixtures in six test files publish an index without modules, so that check needs them changed first and is left for a separate pull request.GPUs tested: n/a
AI-assisted: yes (Claude Code, Claude Fable 5.2, wrote the change and the tests and ran them; I reviewed it)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T15:11:07Z.
Reviewed
318e76b: traced the naming chain the check relies on (carvefile_name, fssm_unpack stem, disasmoutput_path, rdna2spirv index keys all equalsplitextof the carved file name), and disassembly completion already forces listings to be carved stems, so the after-translate failure cannot fire on a clean pipeline. Ran: both touched test files pass (50 + 14 tests); the three new tests each fail on main as they must; 12 further make_game/shader-stage suites pass; a standalone probe reproduces both cases (main resumes a same-size stranger index with no step, and completes silently when translate publishes one; this branch retranslates with the stale shards.json dropped, and exits 1 with "not carved here"). check_no_game_data clean. No blocking findings, only a cosmetic wrap on line 156 of the new test.AI-assisted review.
Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by Mykolas009 on 2026-11-27T23:31:50Z.
Re-tested against current main (
d44285197, after the 27 Nov merge of local work), as asked in #contributor-announcements:make_game.pyauto-merges; the two test files are untouched on main);tests/test_make_game_empty_translation.py14/14 andtests/test_shader_stage_resume.py50/50 pass, and all 26test_make_game*/test_shader_stage*files pass;make_game.pywithout the fix (2 failures, 1 error), so they still cover the case.Run on Windows 11, Python 3.14, each file with
python -I <file>. No game files involved. AI-assisted (Claude Code).Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-28T04:01:57Z.
#1372 | head
318e76bcf0| python -I tests/test_shader_stage_resume.py & python -I tests/test_make_game_empty_translation.py | red: test_shader_stage_resume Ran 50 tests in 15.629s - FAILED (failures=2, errors=1); test_make_game_empty_translation Ran 14 tests - OK | green: test_shader_stage_resume Ran 50 tests in 16.398s - OK; test_make_game_empty_translation Ran 14 tests in 0.400s - OK | full suite: same as main (514/521 standalone stdlib tests passed, 0 new failures vs main02f71ccfe7; compileall=0; node viewer_streaming=0) | Windows 11, Python 3.14.7, no game files | AI-assisted: yes, Antigravity (Gemini)main02f71ccfe7;scripts/check_no_game_data.pypassed (0).main, both end-to-end tests intest_shader_stage_resume.pyfail withAssertionError(SystemExit not raised/[] != ['translate']) and the unit helper test fails withAttributeError(translated_index_strangersadded by this PR); all 50 pass once merged.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T07:21:13Z.
Thanks for this! Retranslating when a saved index names shaders not carved in this work folder guards well against reused or copied work folders.
During maintainer testing (local, 2026-11-28) (head
318e76bcf, merged on mainb1619e0a3/6dfca6428, Windows 11, Python tests via pytest/unittest) we found:make_game.pyand its test (about 145 lines), so it could not go into our candidate.To get this merged:
read_translation_indexfor the index read.AI-assisted (Claude Code), posted for DadaCap (maintainer).
Imported from ubiquitarianism/leonida. Originally posted by Mykolas009 on 2026-11-29T18:26:52Z.
Rebased on main
4364a4fa6(after #494 merged) and pushed to my branch; new head98b219eb28. One commit, the same three files.read_translation_index, as asked. Main's block from #494 inshaders()is unchanged and the check follows it.git merge-treeof this head with #452's head805d47615: one conflict, intranslate()(the plan dict); main with #452 conflicts in the same hunk, and this change adds no other. I will rebase again when #452 lands.318e76bcf:shader_stems, as the other steps read it (a UTF-8 BOM included; covered by a new test case);--stages pipelinesrun does not take the index as finished and the next run does not merge the same parts again;shader_outputs_reusablereturns False for a folder whose index names a stranger (the disk-space check);tests/test_make_game_empty_translation.pyrenames the translated side toshaderand leaves the carved side as on main;git merge-treewith #2553's headaee75f002is clean.Tested on Windows 11, Python 3.14.3, no game files, each file with
python -I:tests/test_shader_stage_resume.py51/51,tests/test_make_game_empty_translation.py20/20.4364a4fa6with this branch's two test files:test_shader_stage_resume.pyhas 4 failures and 1 error (the four new or extended tests);test_make_game_empty_translation.py20/20.tests/test_make_game*.pyandtests/test_shader_stage*.pyfiles: OK (584 tests).scripts/check_no_game_data.pyon the three files,tests/test_text_write_line_endings.py,python -m compileall -q make_game.py tools tests: clean.The test counts in the description above are from the earlier head; the ones here are for
98b219eb28.GPUs tested: n/a
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by Mykolas009 on 2026-11-30T22:32:32Z.
@DadaCap, an update, since this has been parked for three days:
98b219eb28) and re-checked on 30 Nov:git merge mainat407f71a23gives no conflict, and the change is still these three files.main:tests/test_shader_stage_resume.py51 of 51 with this change, and the same test file on plainmainfails (4 failures, 1 error);tests/test_make_game_empty_translation.py20 of 20. Windows 11, Python 3.14.3, no GPU or game files.mainitself (needs rebasesince 28 Nov, no answer from its author). The two overlapped in one hunk oftranslate(); if it comes back, whichever of us is second takes that rebase.AI-assisted (Claude Code, Fable 5.2).
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:41:02Z.
Review: APPROVED
Reviewed the diff against
main:make_game.py:1302-1350,1452-1488cleanly detects saved or freshly mergedspirv/index.jsonentries not present in the carveddxbc/index.json, drops stale shard plans on mismatch, and updates/adds tests intests/test_make_game_empty_translation.pyandtests/test_shader_stage_resume.py. Clean-room verified. Approving; awaiting a green CI run before merge.(AI-assisted review.)