Repository navigation
Conversation
|
Tested What I ran:
Code review:
|
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 690b97113 on Windows 11: pytest tests/test_make_game_translator_flags.py tests/test_make_game_argparse.py tests/test_make_game_wave64.py -q -> 101 passed, 37 subtests passed; git diff --check clean.
The shaders stage now passes --opt by default (the translator has it at rdna2spirv.py:15880) with --no-spirv-opt to opt out, and the flag joins the recorded translator settings so a change retranslates. The added tests cover the default, the opt-out and a flag change forcing a retranslation; the docs note the size/result expectation. No blocking issue.
|
Tested I translated the fixture instructions with With CPython 3.14.7, the make_game tests, GPU runner tests, and optimizer tests report 406 passed and one skipped. The new default-flag test fails with NVIDIA driver 32.0.16.2101. AMD driver 32.0.21043.5001. AI-assisted. |
|
The same shard with
So the optimizer's output is valid on the emulated modules too, with the same saving. The time is less clean than in the description. These two runs had the machine to themselves, while the native pair ran next to other work. Here |
Flyander
left a comment
There was a problem hiding this comment.
Reviewed the current head. On Python 3.12.10, the targeted -I suites passed: make_game translator flags (27), argparse (36), wave64 (38), GPU-runner behavior (41), GPU-runner paths (20), SPIR-V optimizer (9), docs CLI flags (3), and docs environment variables (4). The mocked translator failure text in the flags suite is expected; all tests passed. No GPU or game files were used in this local check.
|
Tested
All four runs translated and passed For a first-use pipeline timing, I changed one stored alpha value in Separately, the generic pipeline checker built the same 95 of 105 emulated compute pipelines in both configurations. The same nine descriptor-using pipelines failed creation, and one skipped for missing FP64. Seven of those nine passed in their dedicated GPU harnesses. AI-assisted, using synthetic fixtures only. |
|
FSPX as well, since |
|
The full 1.0.2.1 DXBC translation comparison finished on Every module was smaller with optimization. Total SPIR-V bytes went from 19,007,248,456 to 12,172,654,240 (35.96% reduction). The median per-module reduction was 35.08%, ranging from 8.39% to 86.12%. This extends the size and validation result from the original 663-shader slice to the whole DXBC corpus. The RTX 3080 Ti driver compile-time and peak-RSS comparison has now started on those same module pairs. AI-assisted, aggregate results only. |
|
Driver compile time for the |
|
@kapitche Thanks, that's the measurement I couldn't finish. It changes what this PR can claim. The gain is size: about 36% less SPIR-V on disk and to load, which @Kev-Ball now confirms for all 26,503 modules (19.0 → 12.2 GB, all valid). It is not driver compile time for the slowest modules: the driver's own optimizer apparently does the same work, and your 461k-instruction module was even 11% slower in one run. @PingasMech's 70 → 50 ms is for small modules. I've edited the description so it no longer implies a compile-time win on the large ones. If the +11% holds up with repeats, that would argue for keeping |
|
Tested 690b971 on AMD Radeon 610M (RADV RAPHAEL_MENDOCINO, subgroup 32..64), Mesa 26.2.6, CachyOS Linux, LEONIDA_VK_DEVICE=RADV: pass.
The -36.5% SPIR-V size and the compile-time claims were not measured here. AI-assisted. |
|
Independent CPU stack check at |
|
Merged cleanly with main. The three changed make_game suites pass under python -I (re-run), including the new test pinning --opt forwarded after the fallbacks and the recorded-flag retranslate behaviour. The docs flag reference is genuinely implemented — --opt at tools/rdna2spirv.py:15906 and tools/spirv_opt.py on main — so the cli-flags trap is clear, and --no-spirv-opt is added here. Note docs/testing.md also carries an edit from long-open #4212; this PRs section is disjoint, but someone should land them in some order. Checks pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested
|
The GPU suite only ever ran on unoptimized modules, so tools/spirv_opt.py's output was never checked on a GPU. LEONIDA_SPIRV_OPT=1 adds --opt to the translator command, the same way LEONIDA_FMA adds --fma. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/spirv_opt.py (ItsNotRexed#2298) was opt-in, so make_game's modules were the unoptimized ones. Over shard 0/40 of the 1.0.2.1 corpus --opt gives 503.6 -> 319.7 MiB (-36.5%), every one of the 663 modules smaller (median -36.3%, up to -68.8%), all valid, for +3.5% translation time (ItsNotRexed#884). --opt joins the forwarded translator flags, after the fallbacks, so it reaches every shard and the FSPX translation, and it is recorded in translator_flags.txt and the shard plan: turning it on or off translates again. The make_game tests about the fallbacks pass --no-spirv-opt so they keep checking the fallbacks alone, and test_spirv_opt_is_on_by_default checks the default, the opt-out and the order with a fallback. docs/testing.md says what --opt does and how to run the GPU suite on optimized modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
690b971 to
ecedd93
Compare
|
Tested ecedd93 merged with main 8575d36 on Linux (WSL2) / Python 3.12.16: pass |
|
Tested the current head ecedd93 on Windows, where the GPU suite hadn't been run on optimized modules yet (the earlier GPU run was RADV on Linux). Windows 11 26200, MSVC 14.51 (VS 2026), Vulkan SDK 1.4.363, llvm-mc 23.1.6. The test programs were built from this head. pass Full
AI-assisted: yes |
New BUILD item. Claim: #4683 (comment)
tools/spirv_opt.py(#2298) is opt-in (rdna2spirv.py --opt), andmake_game.pynever passed it, so the game's modules were the unoptimized ones. #884 is about how large those modules get. This turns it on for the shaders stage. The gain is size, measured below and over the whole corpus in the comments; driver compile time of the largest modules does not improve (see @kapitche's timing in the comments).Commits
run_gpu_tests:LEONIDA_SPIRV_OPT=1translates the fixtures with--opt, the same wayLEONIDA_FMAadds--fma. Until now the GPU suite never ran on optimized modules.make_game:--optby default, and--no-spirv-optto turn it off.--optjoins the forwarded translator flags, after the fallbacks. It reaches every shard and the FSPX translation.translator_flags.txtand the shard plan, so turning it on or off translates again.spirv_opt.pywas already inTRANSLATION_SOURCES, so a change to the optimizer re-translates too.make_gametests about the fallbacks pass--no-spirv-opt, so they keep checking the fallbacks alone.test_spirv_opt_is_on_by_defaultchecks the default, the opt-out, and the order with a fallback.docs/testing.mdexplains what--optdoes and how to run the GPU suite on optimized modules.The tests that read raw translator output call the translator directly, without
--opt, so they are unaffected.Measured (
main98fa503f, Windows 11, RTX 3060 / NVIDIA 610.88)Corpus: shard 0/40 of my own 1.0.2.1 copy, counts only (#884).
--optspirv-val--wave64-emulate, see the comments)Every module is smaller: median −36.3%, from −11.0% to −68.8%.
GPU suite: the same test programs on both sides, with
LEONIDA_SPIRV_OPTset to 0 and to 1.--opt--optLEONIDA_W64_EMULATE=1There were no failures in any of the four runs.
Tests:
tests/test_make_game*.pygives 356 passed, and the docs tests pass.Not measured: driver compile time and memory on the optimized modules. My run of that was stopped by memory pressure on this machine. A full-corpus
pipelinesrun with this PR would settle it, and the largest modules shrink by about a third (12.4 → 7.8 MiB in this shard).No game files. AI-assisted (Claude Code).
🤖 Generated with Claude Code