Skip to content

Docs/Tests: sync mesh v5 notes in design.md and add NumThreads constant regression test - #261

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
timelery:mesh-v5-docs-tests
Nov 21, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
timelery:mesh-v5-docs-tests

Conversation

@timelery

Copy link
Copy Markdown
Contributor

What and why

Small follow-up to #209 (caac27b), #219 (49f24bf), 7b82460 and 3fae38a to sync stale docs/design.md notes with the merged mesh v5 model and lock down the NumThreads constant-registration fix with a translator regression test:

  1. docs/design.md:
  2. tests/test_translate.py:
    • Added test_mesh_v5_seed_and_threads_constant parametrized over NumThreads = 96 and 128 (with max_vertices=64, max_primitives=64, so neither constant is referenced elsewhere in ms_tri.asm), asserting OpConstant %uint <threads> is declared, %wbase = OpIMul %uint %wlin <cid>, %v5v = OpIAdd %uint %wbase %lidx, OpStore %v5p %v5v, and validating with spirv-as/spirv-val so 7b82460 cannot regress.

Note: docs/design.md line 230 overlaps with open PR #240; happy to rebase if #240 merges first.

AI-assisted.

Tested

  • No translator code changes (tools/rdna2spirv.py untouched).
  • Local (Windows, Python 3.14, CPU-only; no local pytest/llvm-mc/spirv-val/GPU run):
    • python -m compileall -q make_game.py tools tests — exit 0
    • python -I make_game.py --help — exit 0
    • python -I tests/test_shader_checks.py — 10/10 OK
    • python -I -m unittest discover -s tests/semantic -v — 388/388 OK
    • Verified all SPIR-V assertions (OpConstant, OpIMul, OpIAdd, OpStore) directly against rdna2spirv.translate() for threads=96 (%c60) and threads=128 (%c80) using ms_tri.asm with max_vertices=64, max_primitives=64.
  • pytest tests/test_translate.py with llvm-mc + spirv-as + spirv-val runs in CI (translator-tests).

Checklist

  • 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.

@eIBart0

eIBart0 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Heads-up: #240 also edits the Mesh shaders row of docs/design.md (it adds the SHADER-4 corpus counts after the v5 text), so the two conflict there. Whichever lands second needs a small rebase. If #261 goes first, I'll rebase #240 and keep your wording for v5.

@ItsNotRexed
ItsNotRexed merged commit 1c62e91 into ItsNotRexed:main Nov 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants