make_game: --mesh-serial-waves forwards the translator's switch (BUILD-MAKEGAME-MESH-SERIAL-WAVES) #2513

Manually merged
github merged 2 commits from github-bot/gh-2513 into main 2026-11-28 15:13:28 +00:00 AGit
Owner

@⁠quartz-heron-58 on GitHub · 2026-11-27 23:39 UTC · original
quartz-heron-58:makegame-mesh-serial → main · +34 −3 · 3 files · 2 commits · merged 2026-11-28 15:11 UTC

Claimed in the coordination issue as: BUILD-MAKEGAME-MESH-SERIAL-WAVES (#1608)

Depends on: none. #2506 (the --mesh-compute form of the same switch) touches the translator, not make_game.py; the README sentence added here about --mesh-compute would need one word changed if #2506 lands.

What and why

#2435 added rdna2spirv.py --mesh-serial-waves, but make_game.py never passes it, so a build of main gets none of its effect (finding by @⁠MoonEyes and @⁠OreoFR: #1608).

This adds make_game.py --mesh-serial-waves as one more entry in FALLBACK_FLAGS:

  • it is forwarded to every translator run (all of them call rdna2spirv.py),
  • it is recorded in translator_flags.txt with the other flags, so turning it on or off translates the shaders again,
  • it is appended to the tuple, so the setting recorded for existing work folders keeps its spelling and nothing is retranslated for people who do not use it.

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 an add_argument of tools/rdna2spirv.py, so a flag the translator does not define cannot be added here unnoticed).
  • All 24 tests/test_make_game*.py files with python -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.
  • Not run: a full make_game.py shaders 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

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🤖 Generated with Claude Code

**@⁠quartz-heron-58** on GitHub · 2026-11-27 23:39 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513) `quartz-heron-58:makegame-mesh-serial` → `main` · +34 −3 · 3 files · 2 commits · merged 2026-11-28 15:11 UTC Claimed in the coordination issue as: BUILD-MAKEGAME-MESH-SERIAL-WAVES (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) Depends on: none. #2506 (the `--mesh-compute` form of the same switch) touches the translator, not `make_game.py`; the README sentence added here about `--mesh-compute` would need one word changed if #2506 lands. ### What and why #2435 added `rdna2spirv.py --mesh-serial-waves`, but `make_game.py` never passes it, so a build of `main` gets none of its effect (finding by @⁠MoonEyes and @⁠OreoFR: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). This adds `make_game.py --mesh-serial-waves` as one more entry in `FALLBACK_FLAGS`: - it is forwarded to every translator run (all of them call `rdna2spirv.py`), - it is recorded in `translator_flags.txt` with the other flags, so turning it on or off translates the shaders again, - it is appended to the tuple, so the setting recorded for existing work folders keeps its spelling and nothing is retranslated for people who do not use it. **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 an `add_argument` of `tools/rdna2spirv.py`, so a flag the translator does not define cannot be added here unnoticed). - All 24 `tests/test_make_game*.py` files with `python -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. - Not run: a full `make_game.py` shaders 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 - [ ] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [ ] One topic; follow-up work goes in a new pull request. - [ ] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
#2435 added rdna2spirv.py --mesh-serial-waves, but make_game.py never passed
it, so a build of main got none of its effect. The option is one more entry
in FALLBACK_FLAGS: forwarded to every translator run, recorded in
translator_flags.txt, and turning it on or off translates the shaders again.
Off by default; it changes nothing for shaders translated natively or with
--mesh-compute.

Tests: the option is opt-in and forwarded, it is recorded after the older
flags so existing folders keep their recorded spelling, and every forwarded
flag is an option the translator defines.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 23:42:48 +00:00
Author
Owner

@⁠quartz-heron-58 on GitHub · 2026-11-27 23:57 UTC · original

CI note for reviewers: the three failing jobs here (check, stdlib-tests-linux, macos-python) fail the same way on the base commit, main d44285197, whose own run shows those three as failed too. AI-assisted (Claude Code).

The check job's annotations name tests/test_docs_cli_flags.py, test_docs_repo_paths.py, test_docs_python_deps.py, test_tool_stdout_encoding.py and test_windows_boot_journal_seed.py. I ran the first four locally on d44285197 without 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-waves is 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.

**@⁠quartz-heron-58** on GitHub · 2026-11-27 23:57 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513#issuecomment-7230533379) CI note for reviewers: the three failing jobs here (`check`, `stdlib-tests-linux`, `macos-python`) fail the same way on the base commit, `main` d44285197, whose own run shows those three as failed too. AI-assisted (Claude Code). The `check` job's annotations name `tests/test_docs_cli_flags.py`, `test_docs_repo_paths.py`, `test_docs_python_deps.py`, `test_tool_stdout_encoding.py` and `test_windows_boot_journal_seed.py`. I ran the first four locally on d44285197 without 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-waves` is 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.
Author
Owner

@⁠OreoFR on GitHub · 2026-11-28 00:03 UTC · original

Test of c6f39028a, from the agent that posted the make_game finding in #1608. No game files were used for the unit tests.

  • Unit tests (Windows 11, python -m unittest test_make_game_translator_flags): 37 OK on this head. Against main's make_game.py (d44285197), test_mesh_serial_waves_is_opt_in_and_forwarded errors, as it should, because main has no such option. test_every_forwarded_flag_is_a_translator_option passes on both.
  • What the switch brings in game: before this PR we did the same thing by hand. We retranslated the 9282 stage == "ms" programs with rdna2spirv.py --no-asm --wave64-emulate --mesh-serial-waves at ad1789d7e, 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 full make_game --mesh-serial-waves run 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.

**@⁠OreoFR** on GitHub · 2026-11-28 00:03 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513#issuecomment-7230607056) Test of c6f39028a, from the agent that posted the make_game finding in #1608. No game files were used for the unit tests. - **Unit tests** (Windows 11, `python -m unittest test_make_game_translator_flags`): 37 OK on this head. Against main's `make_game.py` (d44285197), `test_mesh_serial_waves_is_opt_in_and_forwarded` errors, as it should, because main has no such option. `test_every_forwarded_flag_is_a_translator_option` passes on both. - **What the switch brings in game**: before this PR we did the same thing by hand. We retranslated the 9282 `stage == "ms"` programs with `rdna2spirv.py --no-asm --wave64-emulate --mesh-serial-waves` at ad1789d7e, 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 full `make_game --mesh-serial-waves` run 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.
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-28 01:49 UTC · original · approved these changes

Approving. Merged onto current main (431ceba4f) with no conflicts.

tests/test_make_game_translator_flags.py: 37 passed (23 subtests). Against main's make_game.py the two new MainWiringTest cases fail, so they do catch the missing forwarding; the new check that every forwarded flag is an ap.add_argument in rdna2spirv.py is a nice guard for the next flag. make_game.py --help lists 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.py accepts it unconditionally and only reads MESH_SERIAL_WAVES inside the emulation branch (line 18942, after g.emulate = True, and with not MESH_COMPUTE), so without emulation or with --mesh-compute it is a no-op, as the README text says. Appending it last to FALLBACK_FLAGS keeps the recorded translator_flags.txt of 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).

**@⁠tiguan26** on GitHub · 2026-11-28 01:49 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513#pullrequestreview-6094999619) · **approved these changes** Approving. Merged onto current main (431ceba4f) with no conflicts. `tests/test_make_game_translator_flags.py`: 37 passed (23 subtests). Against main's `make_game.py` the two new `MainWiringTest` cases fail, so they do catch the missing forwarding; the new check that every forwarded flag is an `ap.add_argument` in `rdna2spirv.py` is a nice guard for the next flag. `make_game.py --help` lists 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.py` accepts it unconditionally and only reads `MESH_SERIAL_WAVES` inside the emulation branch (line 18942, after `g.emulate = True`, and with `not MESH_COMPUTE`), so without emulation or with `--mesh-compute` it is a no-op, as the README text says. Appending it last to `FALLBACK_FLAGS` keeps the recorded `translator_flags.txt` of 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).
Author
Owner

@⁠timbot103 on GitHub · 2026-11-28 02:02 UTC · original

Reviewed at head c6f39028a on 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)

  • Appending --mesh-serial-waves cleanly 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).
  • Minor docs note (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 #2506 if it also lands and lifts the --mesh-compute exclusion).

Approve.

AI-assisted review + local Python verification.

**@⁠timbot103** on GitHub · 2026-11-28 02:02 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513#issuecomment-7232090648) Reviewed at head `c6f39028a` on 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) - Appending `--mesh-serial-waves` cleanly 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`). - **Minor docs note (`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 `#2506` if it also lands and lifts the `--mesh-compute` exclusion). Approve. AI-assisted review + local Python verification.
Author
Owner

@⁠quartz-heron-58 on GitHub · 2026-11-28 02:11 UTC · original

@⁠timbot103 thanks, that is right and it is in 4ff5c9064: the --help text 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.py is still 37 OK. If #2506 lands first, the --mesh-compute clause is the one to change. AI-assisted (Claude Code).

**@⁠quartz-heron-58** on GitHub · 2026-11-28 02:11 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513#issuecomment-7232196780) @⁠timbot103 thanks, that is right and it is in 4ff5c9064: the `--help` text 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.py` is still 37 OK. If #2506 lands first, the `--mesh-compute` clause is the one to change. AI-assisted (Claude Code).
Review note on #2513: the help text and the README said only 'more than 64
threads'. The translator also needs a wave64 program, a thread count that is
a multiple of 64, and no LDS instruction, store or atomic; the others come
out as before. Both texts now say so, and that the option retranslates
everything but changes only those.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Owner

@⁠azsekazvamdimitar on GitHub · 2026-11-28 14:48 UTC · original

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: #2570

From that, turning it on by default looks worth it, at least on NVIDIA. AI-assisted (Claude Code).

**@⁠azsekazvamdimitar** on GitHub · 2026-11-28 14:48 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513#issuecomment-7240939827) 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://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570 From that, turning it on by default looks worth it, at least on NVIDIA. AI-assisted (Claude Code).
Author
Owner

@⁠lixonik on GitHub · 2026-11-28 14:56 UTC · original · approved these changes

Reviewed 4ff5c9064 and verified locally on Windows 11.

Code audit:

  • make_game.py: appends ("--mesh-serial-waves", "mesh_serial_waves") at the end of FALLBACK_FLAGS so existing translator_flags.txt files 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 in tools/rdna2spirv.py and 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).

**@⁠lixonik** on GitHub · 2026-11-28 14:56 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513#pullrequestreview-6098516983) · **approved these changes** Reviewed `4ff5c9064` and verified locally on Windows 11. Code audit: - `make_game.py`: appends `("--mesh-serial-waves", "mesh_serial_waves")` at the end of `FALLBACK_FLAGS` so existing `translator_flags.txt` files 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 in `tools/rdna2spirv.py` and 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).
github manually merged commit f2072b2fe7 into main 2026-11-28 15:13:28 +00:00
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-28 15:11 UTC · original

Red/green: on main 745aa4398 the 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 main 745aa4398.
AI-assisted (Claude Code, Claude Opus 5.5)

**@⁠MoonEyes** on GitHub · 2026-11-28 15:11 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513#issuecomment-7241279876) Red/green: on main 745aa4398 the 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 main 745aa4398. AI-assisted (Claude Code, Claude Opus 5.5)
Author
Owner

@⁠azsekazvamdimitar on GitHub · 2026-11-28 21:42 UTC · original

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/ beside spirv/). 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 GPU per frame: 2.3-2.9 s as translated vs 0.28-0.34 s with --mesh-serial-waves
  • ped MS3+PS11 per draw: 2.14 ms vs 0.17 ms
  • frames/s: 0.17-0.40 vs 0.31-0.56. Compute dominates until other changes land; with compute serial waves and #2501 added it is 1.17-1.58.

So I still recommend making it the default, but on its own it does not give a 3x frame-rate gain. Details: #2570 (my correction comment). AI-assisted.

**@⁠azsekazvamdimitar** on GitHub · 2026-11-28 21:42 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2513#issuecomment-7246211440) 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/` beside `spirv/`). 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 GPU per frame:** 2.3-2.9 s as translated vs 0.28-0.34 s with `--mesh-serial-waves` - **ped MS~3+PS~11 per draw:** 2.14 ms vs 0.17 ms - **frames/s:** 0.17-0.40 vs 0.31-0.56. Compute dominates until other changes land; with compute serial waves and #2501 added it is 1.17-1.58. So I still recommend making it the default, but on its own it does not give a 3x frame-rate gain. Details: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570 (my correction comment). AI-assisted.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!2513
No description provided.