Repository navigation
make_game: refuse a translation index that lost carved shaders - #4582
abilliontokens wants to merge 6 commits into
Conversation
|
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.
shdann's case: an index of the right size with the wrong names hid the missing shader behind a matching count. The expected set is now the disassembly's own listings — fssm_unpack.py deliberately tolerates carved containers that never yield one, so those do not block a healthy build (tupacfan04) — and the failure names both directions, capped at eight names, pointing at the shard logs and the fixes for today's regression class. A present-but-unparseable index now fails: on a resumed stage nothing else ever reads it. Resume-test fixtures write the JSON their markers always implied.
|
Review responses — head now @shdann — fixed by comparing sets, not counts. The expected set is the merged index's counterpart exactly as you suggested: the disassembly listing stems; the check now reports both directions by name, capped at eight with a total. Your repro ( @tupacfan04 — both points taken. The equality is now measured against the disassembly listings, not the carve index, so a carved container that @kapitche — kept as a hard failure with no opt-out: the silent loss is exactly the bug this PR exists to catch, and AGENTS.md's "fix, don't skip" points the same way. The message is now actionable: it names the missing stems (sampled, with counts), points at the stage output and shard logs where each spirv-val failure is printed, and names today's class ( @whattheflop — thanks for the resume and cache-inventory checks. Agreed on both: the missing- @Kam471 — thanks; the check you verified is now a set comparison with the same placement. Tested at
|
|
Tested f7585f8 merged with main 98fa503 on Linux (Python 3.12.16): pass - tests/test_make_game_translation_completeness.py 9 OK, test_make_game_translator_flags.py 26 OK, test_shader_stage_resume.py 44 OK; negative control: upstream/main make_game.py with the new completeness test: 9/9 error (no verify_translation_completeness). The two edited tests (flags, stage_resume) still pass on main's make_game.py, so they only prove the fixtures were adapted to the new check, not the check itself. No issue found in the diff. |
|
Status for the merge decision (re @kapitche's hard-fail concern): the regression class this check caught is fixed on |
|
FAIL, reproduced against main 3faac55: the completeness check is valuable and its own suite passes 9/9, and seven make_game suites stay green — but tests/test_fspx_shaders_stage.py goes red on this branch (errors=1, green on main, re-verified both ways): its fake_translate leaves an empty index.json and verify_translation_completeness now exits with the not-valid-JSON message. You fixed the same fake in translator_flags and shader_stage_resume; fspx_shaders_stage needs the same touch — an empty file where a minimal index is expected. Also note the fail() text defers empty-index refusal to #3328, which is still open. Checks pending; the fix is mechanical, worth a CI trigger once updated. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… their listing - verify_translation_completeness (ItsNotRexed#4582) fails on an index it cannot parse and compares the index keys with the listing stems, so a fake translate() that leaves an empty index.json (test_fspx_shaders_stage.py) or names a shader no listing backs (test_make_game_empty_translation.py, from ItsNotRexed#3328) failed the stage it is there to see pass. - Each fake now writes what the real merge publishes: one entry per listing present, as test_shader_stage_resume.py and test_make_game_translator_flags.py already do. - Reported by memorypressure on ItsNotRexed#4582 (fspx); the empty-index one appeared when ItsNotRexed#3328 merged.
|
@memorypressure — fixed; head now The fix you asked for. One more of the same class, not in your review. #3328 merged at 11:36Z ( The #3328 reference. It is merged, and this head merges it, so the comment now describes what Merges. Four merges of Results at
The 23
Negative checks
Wider sweep (at AI-assisted (omp orchestrator). |
|
Independent Windows / CPython 3.12 verification of |
|
Rechecked ba3ce77 applied to current main dde82f2. A synthetic index with one entry and one listing but the wrong name is accepted by main's count check. With this PR the build check exits 1 and reports both the missing listing and the unexpected index entry. The matching-name control passes on both revisions. On Windows (CPython 3.15.2), FSPX (22), completeness (9), translator flags (31), and stage resume (46) passed. Empty translation ran 13 tests with the same one Exited test-double error on main and with the patch, already tracked by #7214. On WSL2 (CPython 3.14.7), FSPX, completeness and stage resume passed (77 tests). One diagnostic nit: the wrong-name case also tells the user that today's failure is the old aa2988c typed-buffer regression, even though a stale index alone can trigger it. A generic message pointing to the shard logs when translation failed would fit both cases. Synthetic fixtures, CPU-only. AI-assisted (Codex). |
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).