make_game: --mesh-serial-waves forwards the translator's switch (BUILD-MAKEGAME-MESH-SERIAL-WAVES) #2513
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2513"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T23:39:16Z.
Claimed in the coordination issue as: BUILD-MAKEGAME-MESH-SERIAL-WAVES (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7230268050)
Depends on: none. #2506 (the
--mesh-computeform of the same switch) touches the translator, notmake_game.py; the README sentence added here about--mesh-computewould need one word changed if #2506 lands.What and why
#2435 added
rdna2spirv.py --mesh-serial-waves, butmake_game.pynever passes it, so a build ofmaingets none of its effect (finding by @MoonEyes and @OreoFR: https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7230178735).This adds
make_game.py --mesh-serial-wavesas one more entry inFALLBACK_FLAGS:rdna2spirv.py),translator_flags.txtwith the other flags, so turning it on or off translates the shaders again,Off by default. Whether it should be on for everyone is a maintainer decision and not part of this change: the gain is measured on an RTX 4080 and an RTX 4070 Laptop, and the RTX 2070 SUPER runs in #2435 neither gained nor clearly lost. The translator applies the switch only to emulated wave64 mesh shaders, so it changes nothing for a native translation or with
--mesh-compute.Tested
python -I tests/test_make_game_translator_flags.py: 37 tests, OK (3 new: the option is opt-in and forwarded; it is recorded after the older flags; every forwarded flag is anadd_argumentoftools/rdna2spirv.py, so a flag the translator does not define cannot be added here unnoticed).tests/test_make_game*.pyfiles withpython -I: OK.python -m pytest tests/test_make_game_translator_flags.py tests/test_mesh_serial_waves.py -q: 60 passed.python -I scripts/check_no_game_data.py: exit 0.make_game.pyshaders stage with the option (the forwarding is covered by the mocked tests; the translator side is #2435's own tests and the game runs reported there).GPUs tested: n/a (no GPU code; Windows 11, Python 3)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T23:57:21Z.
CI note for reviewers: the three failing jobs here (
check,stdlib-tests-linux,macos-python) fail the same way on the base commit,maind44285197, whose own run shows those three as failed too. AI-assisted (Claude Code).The
checkjob's annotations nametests/test_docs_cli_flags.py,test_docs_repo_paths.py,test_docs_python_deps.py,test_tool_stdout_encoding.pyandtest_windows_boot_journal_seed.py. I ran the first four locally ond44285197without this change and on this branch: each fails with one failure in both, about files this PR does not touch (d3d12/docs/README-fxceless.md,docs/port_plan.md,port_ctl.py,tools/leonida_launcher.py), and--mesh-serial-wavesis not in the docs-flags test's list of missing flags. The fifth passes here on Windows; I have not reproduced its Linux failure. The jobs this change can affect by itself (translator-tests,semantic-tests,no-game-data,change-scope) pass.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T00:03:04Z.
Test of
c6f39028a, from the agent that posted the make_game finding in #1608. No game files were used for the unit tests.python -m unittest test_make_game_translator_flags): 37 OK on this head. Against main'smake_game.py(d44285197),test_mesh_serial_waves_is_opt_in_and_forwardederrors, as it should, because main has no such option.test_every_forwarded_flag_is_a_translator_optionpasses on both.stage == "ms"programs withrdna2spirv.py --no-asm --wave64-emulate --mesh-serial-wavesatad1789d7e, in shards then--merge, and swapped them into a copy of the pack. On an RTX 4070 Laptop 8 GB (NVIDIA 621.40), same exe, n=2, alternated C M C M: 0.072-0.076 -> 0.122-0.159 fps after the world-entry stop, and direct GPU per frame 9.3-12.1 -> 2.8-3.6 s (details in #1608). This PR forwards the same flag to every shard, so a fullmake_game --mesh-serial-wavesrun should give the same pack. I have not re-run the whole shaders stage with it.AI-assisted (Claude Code, Claude Opus 5.5), for OreoFR.
Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-28T01:49:00Z.
Review: APPROVED
Approving. Merged onto current main (
431ceba4f) with no conflicts.tests/test_make_game_translator_flags.py: 37 passed (23 subtests). Against main'smake_game.pythe two newMainWiringTestcases fail, so they do catch the missing forwarding; the new check that every forwarded flag is anap.add_argumentinrdna2spirv.pyis a nice guard for the next flag.make_game.py --helplists the option.The one thing I wanted to rule out: since the flag goes to every translator run, a native wave64 build (no
--wave64-emulate) must not choke on it. It doesn't:rdna2spirv.pyaccepts it unconditionally and only readsMESH_SERIAL_WAVESinside the emulation branch (line 18942, afterg.emulate = True, and withnot MESH_COMPUTE), so without emulation or with--mesh-computeit is a no-op, as the README text says. Appending it last toFALLBACK_FLAGSkeeps the recordedtranslator_flags.txtof existing folders unchanged, and turning it on retranslates, as it should.This is what makes #2435 reachable in a game build, so it's worth having in the next tools batch. AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T02:02:41Z.
Reviewed at head
c6f39028aon Windows 11 (Python 3).Verification
python -B -m unittest tests/test_make_game_translator_flags.py -v: 37/37 tests OK (0.459 s).Notes (non-blocking)
--mesh-serial-wavescleanly to the end of the boolean forwarding tuple keeps saved flag strings stable when unset and threads consistently through preflight reuse checks, shard plan invalidation/execution, FSPX, pipeline library, BVH, and executable translation (make_game.py:1266-1865,2142-2220,2992-3005,3158-3308).README.md:210-214;make_game.py:3158-3161): Both descriptions say the switch serializes mesh shaders above 64 threads with emulation, whereas the translator (tools/rdna2spirv.py:18937-18952,20319-20322;docs/design.md:370) additionally requires wave64, a thread count divisible by 64, and no LDS instructions/stores/atomics. Qualifying the help/README text avoids users triggering a full retranslation expecting ineligible shaders to serialize (and note open#2506if it also lands and lifts the--mesh-computeexclusion).Approve.
AI-assisted review + local Python verification.
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-28T02:11:47Z.
@timbot103 thanks, that is right and it is in
4ff5c9064: the--helptext and the README sentence now say that only a wave64 mesh shader of more than 64 threads, a multiple of 64, with no LDS instruction, store or atomic takes the serial form, that every other shader (and anything translated natively or with--mesh-compute) comes out as before, and that turning the option on retranslates everything while changing only those. Text only;tests/test_make_game_translator_flags.pyis still 37 OK. If #2506 lands first, the--mesh-computeclause is the one to change. AI-assisted (Claude Code).Imported from ubiquitarianism/leonida. Originally posted by azsekazvamdimitar on 2026-11-28T14:48:01Z.
An in-game data point for the default question: with every mesh shader translated with
--wave64-emulate --mesh-serial-waves(main's translator, 9,235 of 9,282 took the serial form), the recompiled runtime on an RTX 3090 (NVIDIA 590.48.01, Linux, GE-Proton) went from 1.8-2.4 s to 0.23-0.26 s of mesh GPU time per in-world frame, and from 0.18-0.37 to 0.56-0.75 frames/s, with the same picture in the screenshots and no hangs or device loss. Cold mesh pipeline compiles also took about half the time (3.6 s -> 1.9 s on average). Two boots on one GPU; details in the coordination issue: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7240939574From that, turning it on by default looks worth it, at least on NVIDIA. AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T14:56:44Z.
Review: APPROVED
Reviewed
4ff5c9064and verified locally on Windows 11.Code audit:
make_game.py: appends("--mesh-serial-waves", "mesh_serial_waves")at the end ofFALLBACK_FLAGSso existingtranslator_flags.txtfiles keep their recorded flag order, and accurately documents which wave64 mesh shaders are affected.tests/test_make_game_translator_flags.py: verifies every forwarded flag exists intools/rdna2spirv.pyand tests opt-in forwarding and flag recording order.Verification (Windows 11, CPython 3.12.1):
python -I tests/test_make_game_translator_flags.py -v: 37/37 passed (2.95 s).python -I scripts/check_no_game_data.py: passed.AI-assisted (Antigravity, Gemini).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:11:57Z.
Red/green: on main
745aa4398the two new MainWiringTest cases error because make_game.py rejects --mesh-serial-waves (the missing feature), and with the PR merged all 37 tests pass.Full local suite (python standalone, pytest, semantic, node) with the PR merged on main
1a441d336: no new failure; merge-tree clean on main745aa4398.AI-assisted (Claude Code, Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by azsekazvamdimitar on 2026-11-28T21:42:21Z.
Correction to my comment above: the frame rates in it were measured with all 25,450 native PSOs failing in the mesh-serial boot (my shader folder had no
dxbc/besidespirv/). The per-draw numbers still hold. Re-measured with every native PSO created (RTX 3090, NVIDIA 590.48.01, Linux, GE-Proton, Series X, in world):--mesh-serial-waves3+PS11 per draw: 2.14 ms vs 0.17 msSo I still recommend making it the default, but on its own it does not give a 3x frame-rate gain. Details: https://github.com/ProjectLeonida/mandy/issues/2570 (my correction comment). AI-assisted.