Repository navigation
Conversation
|
Independent Windows check of
Synthetic fixtures only. AI-assisted: yes (OpenAI Codex). |
b22d5af to
c86f50e
Compare
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Reviewed and verified. Introduces optional --compact-spirv flag running spirv-opt (local load/dead-code/redundancy elimination) on assembled SPIR-V modules before validation, while preserving interface decorations and descriptor bindings. Clean fallback handling when spirv-opt is absent. Verified with tests/test_native_tool_paths.py and test_make_game_translator_flags.py. 100% clean-room.
|
AMD run (the gap the description lists): RX 9070 XT (RDNA4, GFX1201), AMD proprietary Windows driver 26.11.2 (LLPC, Vulkan 1.4.359), Windows 11, MSVC 2022 RelWithDebInfo. Head
|
|
GPU/tooling verification (AI-assisted, overnight worker w4; independent run, not the author's). Head tested: c86f50e. Note: Translator correctness (CPU)
Compact translation of the GPU corpus
GPU A/B, AMD Radeon iGPU (gfx1035, driver 24.10.24, Vulkan 1.3.280) — env:
GPU A/B, NVIDIA RTX 4070 SUPER — env:
Verdict: the compact pass preserves semantics on both GPUs and keeps every module valid; size win is real (~15%). LGTM from this hardware. |
Add --compact-spirv to make_game and the translator. Run the selected SPIRV-Tools passes on the staging file before validation. Keep the default output and the runtime interface contract. Both new tests error on main without the option and pass here. The semantic suite ran 6168 tests in 470 files with no failing files. The Windows runtime cross-build and tracked-file content check passed. AI-assisted (Codex and Claude Code agents). Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
c86f50e to
363fed0
Compare
Rebased onto
bfef489cat363fed0f. Main already exposes SPIR-V compaction. This diff adds the contract row and tests that the build command forwards the flag. The two focused suites ran 49 cases with five Windows-only skips.Claimed in the coordination issue as: SHADER-COMPACT-SPIRV (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #984 is the parent integration. #544 changes the existing Python optimizer. The two options can run independently. A merge-tree check against #1068 also completed without conflicts.
What and why
The translator and shader build rejected
--compact-spirvon Linux. To try smaller modules, a developer had to run the optimizer separately and validate the result again. This adds the option to both entry points. It runs local load elimination, redundancy elimination and dead-code elimination on the assembled staging file before the normal validation and publication step. It preserves stage interfaces, descriptor bindings and specialization constants. Compaction is off by default. Only an opted-in build needsspirv-opt.A hand-written pixel program produced a 4,076-byte module by default and a 908-byte module with compaction. Both the Python assembler and
spirv-asproduced those sizes. All four outputs passed Vulkan 1.2 validation and had matching shader index metadata. This is a synthetic size comparison.Tested
Ran the compiler tests on Linux and cross-built the Windows runtime.
Applied only the two test additions to pristine main
32950551e, then ran the same commands on this child:python3 -I tests/test_native_tool_paths.py AssembleSpirv.test_compact_binary_before_publishcompactkeyword.python3 -I tests/test_make_game_translator_flags.py MainWiringTest.test_compact_spirv_reaches_the_shaders_stage--compact-spirv.python3 -I tests/test_native_tool_paths.pypython3 -I tests/test_make_game_translator_flags.pypython3 -I tests/test_run_gpu_tests_python_assembler.pypython3 -I scripts/run_semantic_tests.py tests/semantic -j 2python3 -I -m compileall -q make_game.py tools testspython3 -I <file>orpython3 -I -m pytest -q <file>tests/test_imhex_patterns.py. The same 6 of its 9 tests failed. Zero new failing files.python3 -I scripts/check_no_game_data.pycmake -S runtime -B runtime/build/bootandcmake --build runtime/build/boot --target gta6rt -j6On a second synthetic module,
spirv-disretained the location, descriptor set, binding and specialization ID after compaction, and the dead add disappeared. An optimizer failure took the existing rejection path and left zero stale modules or staging files. Withspirv-optabsent, the default CLI succeeded and the compact CLI reported the missing tool with exit code 2.GPUs tested: none. The tests ran on the CPU. Native Windows, Wine, AMD GPU and Intel GPU runs were not performed.
AI-assisted: yes
Checklist
32950551e. Merged cleanly in a temporary checkout of the newer3aa975421. The native tool paths, build flag and build destination suites ran 56 cases there, with 51 passes and five Windows-only skips.docs/design.md.🤖 Generated with Claude Code