Repository navigation
make_game: refuse a translation index that lost carved shaders - #4582
abilliontokens wants to merge 1 commit into
Conversation
rdna2spirv.py drops a shader that is refused or whose module fails spirv-val and still exits 0, so a full run can carve 26,503 shaders and finish done with an index of 26,473 (measured end to end at aa2988c, --wave64-emulate, 6 jobs): a port built from it silently lacks the rest. The shaders stage now compares the merged index with the carve and fails naming the gap, the way the disassembly step already refuses an incomplete listing set. An empty index stays ItsNotRexed#3328's, a missing one stays with the merge and translate failures that own it.
|
Tested 118e393 on Windows, CPython 3.14.7, CPU only (no GPU, no game files). All files below are synthetic. The new suite passes 5 of 5 tests, and the existing shader-stage resume suite passes 44 of 44. One case stays. A stale entry can hide a missing shader: the stage accepts a translation index that has the correct number of entries but the wrong shader name. The fixture carves The new guard corrects the case where the counts differ, but not this case where the counts are equal. The merge base also accepts this index. AI-assisted. |
|
PASS, with two issues worth deciding on. Verified at the head: the new suite 5/5, all 19 neighbouring
Style nit: one blank line before the section header at AI-assisted review, no game files, no GPU. |
|
Tested 118e393 merged with main d0835dd (merge 063158de8, no conflicts) on Linux (WSL2) Python 3.12.16 and native Windows 11 Python 3.13.1: concern (works as described; behaviour change to decide).
|
whattheflop
left a comment
There was a problem hiding this comment.
AI-assisted Windows CPU check at 118e3933 and parent 03b09a08, uv CPython 3.12.13. The synthetic fixture used real carve/unpack/translate tools and hand-written disassembly. It produced three DXBC translation entries from two native hashes. Case-colliding aliases kept distinct keys, and FSPX used its separate index. I found no path in the normal build for either to inflate the DXBC count.
A separate resume case has an intact, nonempty index naming exactly all three carved shaders, but one previously validated .spv is missing. With every resume marker unchanged, both revisions treated the DXBC cache as reusable, launched zero shader tools, and printed shaders: done. The file stayed missing. The real FSPX cache check rebuilt its module after equivalent file loss. This is a pre-existing DXBC resume gap outside the new count check and distinct from the equal-cardinality wrong-name case and #3328's empty-index recovery. The five stock completeness tests passed at head.
whattheflop
left a comment
There was a problem hiding this comment.
Follow-up to the missing-module report: #3665 (BUILD-1056) already handles that gap. AI-assisted Windows CPU check with uv CPython 3.12.13 at #3665 797ea022 plus #4582 118e3933. Both merge cleanly onto d0835dd9 (combined tree 59247095).
The real make_game.translate path translated nine synthetic listings in three shards with SPIRV-Tools. After deleting one output in shard 0, the cache inventory refused the hit. The retry rebuilt shard 0, reused shards 1 and 2 without rewriting their markers or part indexes, and restored the nine-entry merged index. This PR's count check then accepted nine carved entries, and separately reported 9 of 10 when the carve count exceeded the translated count. The test exercised the translation and check functions directly, bypassing the earlier carve/disassembly stages. Five focused suites passed 94 tests in the combined tree.
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 118e3933 on Windows 11: pytest tests/test_make_game_translation_completeness.py tests/test_make_game_preflight.py -q -> 83 passed, 1 skipped, 27 subtests passed; git diff --check clean.
verify_translation_completeness runs after the translate block in the shaders stage, so it also covers an incremental run that skips translation. It compares the carve index list length with the merged translation index object length and fails naming the gap; missing/unreadable files and an empty index return early (owned by the translate and #3328 paths). The new tests cover the short index, the equal index and the unreadable cases. No blocking issue.
New BUILD item, claimed in #4257.
What and why
rdna2spirv.pydrops a shader that is refused or whose module failsspirv-val(the module never reaches thefinal path) and still exits 0, and nothing later in the build compares counts. Measured on a full end-to-end
make_game.pyrun ataa2988cc(own 1.0.2.1 copy,--wave64-emulate, 6 jobs): 26,503 carved, 26,503translated, but the merged
spirv/index.jsonheld 26,473 — 30 modules had failedspirv-val(theaa2988cctyped-buffer regression; per-shard deltas 5/5/7/5/1/7) — and the stage printed
shaders: done,finished in 124 min, exit 0. A port assembled from that index silently lacks the dropped shaders.The shaders stage now verifies the merged index against the carve and fails naming the gap, the same way the
disassembly step already refuses an incomplete listing set. Scope kept deliberately narrow:
race that fix;
rdna2spirv.pyexits nonzero, the stage stops before this check);
fspx_cache_complete,fspx_key_clash).This PR has no
Depends on:but will fail builds loudly until a translator fix like #3902 lands for the currentregression class — intended: the alternative is a port missing shaders with no signal.
Tested
Windows 11, Python 3.12 (
python -I), commit118e3933on main03b09a08:tests/test_make_game_translation_completeness.py— 5/5 OK. On unmodified main the same file errors 4/4(the function does not exist); the defect itself is the run above:
--stages shadersexited 0 ataa2988ccwith 26,473 of 26,503.
--stages shaderson the completed run's work folder exits 1with
the translation index holds 26473 of the 26503 carved shaders (30 were refused or failed spirv-val…).test_make_game_dry_run,test_make_game_resume,test_make_game_translate_cleanup,test_make_game_wave64,test_make_game_translator_flags,test_make_game_pipeline_preflight,test_make_game_platform,test_make_game_paths,test_make_game_argparse,test_make_game_interrupt,test_make_game_destinations,test_make_game_container,test_make_game_pick,test_make_game_submodule,test_make_game_assets_decoder,test_make_game_assets_pools,test_make_game_python_version— all OK.python -m compileall -q make_game.py tests/test_make_game_translation_completeness.py.Checklist
AI-assisted (omp orchestrator).