make_game: rebuild empty compute shader modules on resume #1235
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1235"
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 titoreinaldo on 2026-11-24T20:40:42Z.
Claimed in the coordination issue as: BUILD-EMPTY-SPV-CACHE
Claim in #14
What and why
Both the FSPX and pipeline-library stages accepted a zero-byte
.spvif its filename, index and settings marker were still present. Rerunning the shaders step skipped the rebuild and left an unusable module for the runtime. The shared cache check now requires every indexed module to be a nonempty regular file. It uses one stat per entry.Tested
python -m pytest -q tests/test_fspx_shaders_stage.py tests/test_library_shaders_stage.py— 41 passed, plus 21 subtests passed.spirv-val --target-env vulkan1.2, and the third invocation preserved each module’s modification time.python -I make_game.py --helpandpython -m compileall -q make_game.py tools testspassed. The shared base58be9cdfran 6,168 translator tests in 470 files with zero failing files. Verified a clean merge withmainat705ea091.GPUs tested: CPU-only build and recovery on Windows 11 Pro 26H2 build 26300.9974, Python 3.12.14.
AI-assisted: yes, OpenAI Codex. All inputs were synthetic.
Imported from ubiquitarianism/leonida. Originally posted by xel1uz on 2026-11-24T20:48:12Z.
Review: APPROVED
Reviewed the shared cache check and both callers. I ran the PR tests against upstream
66d4f5aafirst: truncating the cached module to zero bytes made both stages reuse the empty file. On a clean trial merge ofbb68bb93into that same base, both stages rebuilt the module, restored the expected bytes, and reused it on the next run.On Ubuntu 26.04.1,
python3 -I -B tests/test_fspx_shaders_stage.py -vpassed 24/24 andpython3 -I -B tests/test_library_shaders_stage.py -vpassed 17/17, including the real SPIR-V tools case. The changed-file game-data check passed. Synthetic inputs, CPU only. AI-assisted review.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T07:21:00Z.
Thanks for this! Treating a zero-length or non-regular cached compute
.spvas missing on resume is a good catch.During maintainer testing (local, 2026-11-28) (head
bb68bb93a, merged on mainb1619e0a3/6dfca6428, Windows 11, Python tests via pytest/unittest) we found:tests/test_bvh_shaders_stageandtests/test_exe_shaders_stagefail with this PR alone on main:fspx_unpack.pyandrdna2spirv.pyrerun when only an unrelated DLL or the executable changed.To get this merged:
AI-assisted (Claude Code), posted for DadaCap (maintainer).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T00:46:51Z.
#1235 | head
bb68bb93ae(merged cleanly onto origin/maine66c65b950) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesIndependent Verification (Windows 11)
make_game.py,tests/test_fspx_shaders_stage.py, andtests/test_library_shaders_stage.py.python -I scripts/check_no_game_data.py make_game.py tests/test_fspx_shaders_stage.py tests/test_library_shaders_stage.pypassed (rc=0).origin/maine66c65b950vs#1235 + origin/main):origin/main): With a validindex.json(stage: "cs"+ 64-hexfspx_code_sha256) and a truncated0-byteu0.spvon disk,make_game.fspx_cache_complete(...)returnedTrue(os.path.isfile(...)accepts empty files).#1235 + origin/main):make_game.fspx_cache_complete(...)checksstat.S_ISREG(module.st_mode)andmodule.st_size == 0, returningFalsefor0-byte files and directory collisions andTruefor non-empty regular.spvmodules (matchinglibrary_cache_completeonmain).python -I tests/test_fspx_shaders_stage.py->24/24passed (OK, includingdamage="missing"anddamage="empty"subtests)python -I tests/test_library_shaders_stage.py->17 ran, OK (skipped=1), includingdamage="missing"anddamage="empty"subtests.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T18:49:56Z.
Tested
bb68bb93amerged (no commit) withmain7c330c76d: Python 3.12.4, Windows 11 10.0.26300, CPU only.tests/test_fspx_shaders_stage.pygives 24 tests OK, andtests/test_library_shaders_stage.pygives 17 tests OK.make_game.pyback tomain,test_missing_or_empty_cached_module_is_rebuilt(damage='empty') fails in both files: nothing is rebuilt.main's own versions give 24 and 17 tests OK.check_no_game_data.pyis clean.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T19:00:41Z.
Merging. Head
bb68bb93ahas red/green verdicts from reviewers other than the author (above), merges cleanly withmaincf6e55921, does not force a rebase of #2566, and carries a claim ID. Remaining main CI reds (translator-testsmesh,semantic-testsf16) are pre-existing. Merged by MoonEyes.AI-assisted (Claude Code).