You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
make_game: rebuild bvh_shaders cache when cached index has 0 translated programs - #8142
bvh_shaders() (make_game.py:1498) reused a cached <work>/shaders/spirv/bvh/index.json whenever bvh_programs() returned a truthy tuple — including when 0 programs had usable entries (empty {}, all-error entries with no fssm_sha256, or an empty extraction index []). That returned early and reported 0 of N even though the fresh-build check at make_game.py:1522 treats len(programs[1]) == len(programs[0]) as a failure (and fspx_shaders() already refuses to cache {}).
Credit to @shdann for catching the same pattern during review of #7746.
make_game.py: require len(programs[1]) < len(programs[0]) before reusing cached BVH outputs, matching the fresh-build check.
tests/test_bvh_shaders_stage.py: add BvhStage.test_empty_cached_index_is_rebuilt covering empty {}, all-error index.json, and empty extraction index.json ([]) rebuilding on the first retry and reusing on the second.
Windows verification of 374a8a3b9 with CPython 3.15.2 and synthetic fixtures: python -I tests/test_bvh_shaders_stage.py passed 14/14, including rebuilding an unusable cache on the first retry and reusing the repaired cache on the second. The neighboring python -I tests/test_fspx_shaders_stage.py suite passed 22/22. CPU only, GPU/driver N/A. AI-assisted.
Tested 374a8a3 on Windows 11 (CPU only, no GPU needed): pass
Windows 11 Pro, Python 3.14.7, no GPU or game files involved; pytest/numpy/Pillow pinned from tests/requirements.txt in a fresh venv. Method: PR head merged onto maind9aa42a, the PR's test files run with python -m pytest before and after the merge, plus python -m compileall -q on the changed files (clean).
tests/test_bvh_shaders_stage.py: main 13 passed; with the PR 14 passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claim: #8047 (comment)
Depends on: none
Summary
bvh_shaders()(make_game.py:1498) reused a cached<work>/shaders/spirv/bvh/index.jsonwheneverbvh_programs()returned a truthy tuple — including when 0 programs had usable entries (empty{}, all-error entries with nofssm_sha256, or an empty extraction index[]). That returned early and reported0 of Neven though the fresh-build check atmake_game.py:1522treatslen(programs[1]) == len(programs[0])as a failure (andfspx_shaders()already refuses to cache{}).Credit to @shdann for catching the same pattern during review of #7746.
make_game.py: requirelen(programs[1]) < len(programs[0])before reusing cached BVH outputs, matching the fresh-build check.tests/test_bvh_shaders_stage.py: addBvhStage.test_empty_cached_index_is_rebuiltcovering empty{}, all-errorindex.json, and empty extractionindex.json([]) rebuilding on the first retry and reusing on the second.Testing
python3 -m compileall -q make_game.py tools tests— passpython3 -I make_game.py --help— passpython3 -I tests/test_bvh_shaders_stage.py -v— 14/14 OK (verified new test fails on parentdde82f27ewhere retry 0 runs[]and logs0 of 3)python3 -I tests/test_fspx_shaders_stage.py— 22/22 OKpython3 -I scripts/check_no_game_data.py make_game.py tests/test_bvh_shaders_stage.py— passAI-assisted.