build.py: a text-only fixture's lines are its listing, as in run_gpu_tests.py (TEST-BUILD-TEXT-ONLY) #1444

Open
github-bot wants to merge 1 commit from github-bot/gh-1444 into main AGit
Owner

@⁠hugo0024 on GitHub · 2026-11-25 00:21 UTC · original
hugo0024:build-text-only → main · +168 −14 · 2 files · 1 commits · open

Claimed in the coordination issue as: TEST-BUILD-TEXT-ONLY (claim)

Depends on: #822

It does not build on #822; the two conflict. Both add a block right after barycentric_fallback() in runtime/test/shaders/build.py, so whichever merges second needs a rebase that keeps both blocks (Tauwni tested that resolution in a comment on #822).

What and why

Since #957, runtime/test/shaders/build.py with no names builds nothing:

cs_dpp_cmp.asm did not assemble:
<stdin>:15:1: error: dpp variant of this instruction is not supported
v_cmp_gt_f32_dpp vcc_lo, v1, v1 quad_perm:[1,0,3,2] row_mask:0xf bank_mask:0xf bound_ctrl:1

cs_dpp_cmp.asm holds a VOPC compare in DPP form, which llvm-mc has no gfx1013 encoding for. The file says so in a comment line of its own, and scripts/run_gpu_tests.py passes such a source's instruction lines to the translator as they are. build.py still sent it to llvm-mc and stopped before publishing anything, so the two-step form is broken for the whole list: check.py reports 0 of 226 (it has an expected entry for cs_dpp_cmp), and w64_graphics.py finds no module.

  • build.py: a source that carries the marker line is not assembled; text_only_listing() writes the listing assemble_to_s of run_gpu_tests.py writes. Everything else in translate_tests (the compute header, the containers) is as before.
  • tests/test_shader_build_text_only.py: the marker is the same line in both runners, the two write the same listing for every marked fixture, a marked source never reaches llvm-mc, and an unmarked one still does and still stops the build on an assembler error.

run_gpu_tests.py is not touched: it keeps its own TEXT_ONLY_MARK line, which #1375 (the pytest helper, open) also checks for. No file overlaps with #1375.

Tested

Apple M5, MoltenVK 1.4.2, llvm-mc 23.1.6. Before is main 1154976d4, after is this branch on b4b7756e8; LEONIDA_F16_INTERP_FALLBACK=1 for both scripts, as a Mac needs:

Before After
build.py <out> exit 1, 0 modules 288 of 288 translated and valid, 288 modules
check.py 0 of 226 pass, 4 skipped 183 of 226 pass, 41 skipped; cs_dpp_cmp ok
w64_graphics.py 30 of 30 "missing .spv" 0 missing
run_gpu_tests.py 192/256 passed, 63 skipped the same, test for test
  • The cs_dpp_cmp module build.py now writes is byte-identical to the one run_gpu_tests.py builds (8724 bytes).
  • After, check.py leaves cs_fma_fused (the MoltenVK 1.4.2 row of docs/testing.md) and the intermittent ps_imgatomic (#543), as before #957. w64_graphics.py still exits 1 on a Mac for the seven vs_w64_* fixtures, which is #900's subject.
  • tests/test_shader_build_text_only.py: 8 tests pass. With main's build.py, 6 of them error.
  • tests/test_shader_build_fallbacks.py, tests/test_docs_*.py, tests/test_i18n_index.py pass; python -m compileall -q make_game.py tools tests is clean.
  • pytest files: 1881 passed, 2 failed, before and after alike. The two are tests/test_translate.py on cs_dpp_cmp.asm, which #1375 fixes.
  • Standard-library loop: 492 files, 1 failed, tests/test_mod_pack_output_alias.py; it fails the same way on main 1154976d4 here.

Not tested: Windows and Linux, and an LLVM other than 23.1.6. The change does not depend on the assembler: a marked source no longer reaches it.

GPUs tested: Apple M5 (8-core GPU), MoltenVK 1.4.2, macOS 27.2.1 (26B131)

AI-assisted: yes

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

**@⁠hugo0024** on GitHub · 2026-11-25 00:21 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1444) `hugo0024:build-text-only` → `main` · +168 −14 · 2 files · 1 commits · open Claimed in the coordination issue as: TEST-BUILD-TEXT-ONLY ([claim](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14)) Depends on: #822 It does not build on #822; the two conflict. Both add a block right after `barycentric_fallback()` in `runtime/test/shaders/build.py`, so whichever merges second needs a rebase that keeps both blocks (Tauwni tested that resolution in a comment on #822). ### What and why Since #957, `runtime/test/shaders/build.py` with no names builds nothing: ```text cs_dpp_cmp.asm did not assemble: <stdin>:15:1: error: dpp variant of this instruction is not supported v_cmp_gt_f32_dpp vcc_lo, v1, v1 quad_perm:[1,0,3,2] row_mask:0xf bank_mask:0xf bound_ctrl:1 ``` `cs_dpp_cmp.asm` holds a VOPC compare in DPP form, which llvm-mc has no gfx1013 encoding for. The file says so in a comment line of its own, and `scripts/run_gpu_tests.py` passes such a source's instruction lines to the translator as they are. `build.py` still sent it to llvm-mc and stopped before publishing anything, so the two-step form is broken for the whole list: `check.py` reports 0 of 226 (it has an expected entry for `cs_dpp_cmp`), and `w64_graphics.py` finds no module. - `build.py`: a source that carries the marker line is not assembled; `text_only_listing()` writes the listing `assemble_to_s` of `run_gpu_tests.py` writes. Everything else in `translate_tests` (the compute header, the containers) is as before. - `tests/test_shader_build_text_only.py`: the marker is the same line in both runners, the two write the same listing for every marked fixture, a marked source never reaches llvm-mc, and an unmarked one still does and still stops the build on an assembler error. `run_gpu_tests.py` is not touched: it keeps its own `TEXT_ONLY_MARK` line, which #1375 (the pytest helper, open) also checks for. No file overlaps with #1375. ### Tested Apple M5, MoltenVK 1.4.2, llvm-mc 23.1.6. Before is `main` `1154976d4`, after is this branch on `b4b7756e8`; `LEONIDA_F16_INTERP_FALLBACK=1` for both scripts, as a Mac needs: | | Before | After | |---|---|---| | `build.py <out>` | exit 1, 0 modules | 288 of 288 translated and valid, 288 modules | | `check.py` | 0 of 226 pass, 4 skipped | 183 of 226 pass, 41 skipped; `cs_dpp_cmp` ok | | `w64_graphics.py` | 30 of 30 "missing .spv" | 0 missing | | `run_gpu_tests.py` | 192/256 passed, 63 skipped | the same, test for test | - The `cs_dpp_cmp` module `build.py` now writes is byte-identical to the one `run_gpu_tests.py` builds (8724 bytes). - After, `check.py` leaves `cs_fma_fused` (the MoltenVK 1.4.2 row of `docs/testing.md`) and the intermittent `ps_imgatomic` (#543), as before #957. `w64_graphics.py` still exits 1 on a Mac for the seven `vs_w64_*` fixtures, which is #900's subject. - `tests/test_shader_build_text_only.py`: 8 tests pass. With `main`'s `build.py`, 6 of them error. - `tests/test_shader_build_fallbacks.py`, `tests/test_docs_*.py`, `tests/test_i18n_index.py` pass; `python -m compileall -q make_game.py tools tests` is clean. - pytest files: 1881 passed, 2 failed, before and after alike. The two are `tests/test_translate.py` on `cs_dpp_cmp.asm`, which #1375 fixes. - Standard-library loop: 492 files, 1 failed, `tests/test_mod_pack_output_alias.py`; it fails the same way on `main` `1154976d4` here. Not tested: Windows and Linux, and an LLVM other than 23.1.6. The change does not depend on the assembler: a marked source no longer reaches it. GPUs tested: Apple M5 (8-core GPU), MoltenVK 1.4.2, macOS 27.2.1 (26B131) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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)
cs_dpp_cmp.asm (#957) holds a VOPC compare in DPP form, which llvm-mc has
no gfx1013 encoding for. The file says so in a comment line, and
run_gpu_tests.py passes such a source to the translator as text. build.py
still sent it to llvm-mc, so with no names it stopped at "cs_dpp_cmp.asm
did not assemble" before publishing anything: check.py then reported 0
of 226 and w64_graphics.py found no module.

build.py now writes the same listing run_gpu_tests.py writes for a
source that carries the marker line. On an Apple M5 the two-step form
goes from nothing built to 288 of 288 translated and valid, check.py
from 0 to 183 of 226 passing with cs_dpp_cmp ok, and the module is
byte-identical to the one run_gpu_tests.py builds.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:51:37 +00:00
Author
Owner

@⁠Tauwni on GitHub · 2026-11-25 10:02 UTC · original

Tested on an Apple M3 (MoltenVK 1.4.2, macOS 26.5.1, llvm-mc 23.1.6 from Homebrew), this PR at ae4e7d75d applied on main 626d1281a:

  • On main, runtime/test/shaders/build.py stops at cs_dpp_cmp.asm ("dpp variant of this instruction is not supported") and writes no SPIR-V, so check.py runs nothing.
  • With this PR: 297 shaders, 297 translated, 297 pass spirv-val; check.py 183 of 231 pass, 43 skipped, and cs_dpp_cmp is ok. The five failures are the known Mac ones (cs_fma_fused, ps_ssharp, ps_ij_computed, ps_interp_f16_high) and cs_imgatomic_ext (#1518).
  • python -I tests/test_shader_build_text_only.py: 8 tests OK.

Full record in #1718. AI-assisted (Claude Code).

**@⁠Tauwni** on GitHub · 2026-11-25 10:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1444#issuecomment-7159149276) Tested on an Apple M3 (MoltenVK 1.4.2, macOS 26.5.1, llvm-mc 23.1.6 from Homebrew), this PR at `ae4e7d75d` applied on `main` `626d1281a`: - On `main`, `runtime/test/shaders/build.py` stops at `cs_dpp_cmp.asm` ("dpp variant of this instruction is not supported") and writes no SPIR-V, so `check.py` runs nothing. - With this PR: 297 shaders, 297 translated, 297 pass `spirv-val`; `check.py` 183 of 231 pass, 43 skipped, and `cs_dpp_cmp` is `ok`. The five failures are the known Mac ones (`cs_fma_fused`, `ps_ssharp`, `ps_ij_computed`, `ps_interp_f16_high`) and `cs_imgatomic_ext` (#1518). - `python -I tests/test_shader_build_text_only.py`: 8 tests OK. Full record in #1718. AI-assisted (Claude Code).
Author
Owner

@⁠Anzymanz on GitHub · 2026-11-25 13:45 UTC · original

Confirmed on an RX 9070 XT (RADV, Mesa 26.2.6, CachyOS, llvm-mc 23.1.5) at main 5e95fa2. On main, build.py exits at cs_dpp_cmp.asm ("dpp variant of this instruction is not supported"), so check.py has no modules and reports 0 of 230. With this branch (and #1518), build.py translates 297/297 and all pass spirv-val, and check.py gives 227 of 231 pass, 4 skipped, both native and LEONIDA_W64_EMULATE=1; cs_dpp_cmp passes. tests/test_shader_build_text_only.py passes. Recorded in #1870. AI-assisted.

**@⁠Anzymanz** on GitHub · 2026-11-25 13:45 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1444#issuecomment-7164251202) Confirmed on an RX 9070 XT (RADV, Mesa 26.2.6, CachyOS, llvm-mc 23.1.5) at main 5e95fa2. On main, `build.py` exits at `cs_dpp_cmp.asm` ("dpp variant of this instruction is not supported"), so `check.py` has no modules and reports 0 of 230. With this branch (and #1518), `build.py` translates 297/297 and all pass spirv-val, and `check.py` gives 227 of 231 pass, 4 skipped, both native and `LEONIDA_W64_EMULATE=1`; `cs_dpp_cmp` passes. `tests/test_shader_build_text_only.py` passes. Recorded in #1870. AI-assisted.
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 15:30 UTC · original

Reviewed ae4e7d7: build.py now writes a text-only listing (instruction lines, run_gpu_tests.py's exact format) for .asm sources carrying the shared TEXT_ONLY_MARK - cs_dpp_cmp - instead of sending them to llvm-mc, which has no gfx1013 encoding for the DPP-form VOPC compare; unmarked sources are unchanged and assembler errors still stop the build. Ran python -I tests/test_shader_build_text_only.py on the PR tree (8 tests OK; 6 errors against main's build.py), tests/test_shader_build_fallbacks.py on both trees (OK), and a probe on both with a stubbed llvm-mc: main dies with "cs_dpp_cmp.asm did not assemble" before publishing anything, the PR builds it with zero assembler calls and a listing byte-identical to run_gpu_tests.py's for the same fixture. No llvm-mc/spirv-val/GPU on this machine, so the end-to-end totals are unverified; no findings, no game data touched.
AI-assisted review.
Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 15:30 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1444#issuecomment-7166939852) Reviewed ae4e7d7: build.py now writes a text-only listing (instruction lines, run_gpu_tests.py's exact format) for .asm sources carrying the shared TEXT_ONLY_MARK - cs_dpp_cmp - instead of sending them to llvm-mc, which has no gfx1013 encoding for the DPP-form VOPC compare; unmarked sources are unchanged and assembler errors still stop the build. Ran `python -I tests/test_shader_build_text_only.py` on the PR tree (8 tests OK; 6 errors against main's build.py), tests/test_shader_build_fallbacks.py on both trees (OK), and a probe on both with a stubbed llvm-mc: main dies with "cs_dpp_cmp.asm did not assemble" before publishing anything, the PR builds it with zero assembler calls and a listing byte-identical to run_gpu_tests.py's for the same fixture. No llvm-mc/spirv-val/GPU on this machine, so the end-to-end totals are unverified; no findings, no game data touched. AI-assisted review. **Recommendation:** Merge
Author
Owner

@⁠kevincommits on GitHub · 2026-11-26 07:15 UTC · original

Independent run with the real assembler, not stand-ins. Apple M5 Pro, macOS 27.2.1 (26B131), Python 3.14.2, Homebrew LLVM 23.1.6 (llvm-mc with the AMDGPU target), SPIRV-Tools from Homebrew. I merged main at a73a57e13 into the branch locally (822 commits behind, no conflicts). Head tested: ae4e7d75d.

build.py with no names: on main it stops at cs_dpp_cmp and publishes nothing; on this branch it builds all 301 shaders and all 301 pass spirv-val.

Command on both trees: LLVM_MC=/opt/homebrew/opt/llvm/bin/llvm-mc python3 -I runtime/test/shaders/build.py <out>.

tree result files in <out>/spirv
main at a73a57e13 exit 1: <stdin>:17:1: error: dpp variant of this instruction is not supported at v_cmp_gt_f32_dpp vcc_lo, v1, v1 dpp8:[4,5,6,7,0,1,2,3] 0
this branch merged with main 301 shaders: 301 translated, 301 pass spirv-val 604, 20 of them for the dpp fixtures

So the failure in the description reproduces here with a current llvm-mc, and the change removes it.

  • Test file. python -I tests/test_shader_build_text_only.py: 8/8 on the merged tree.
  • Full standalone suite on the merged tree: 514 run, 513 pass; the 1 that fails is main's test_mod_pack_output_alias (fixed by #1412).

Not tested: check.py and the GPU runs on the built shaders, and the LEONIDA_* build variants. No game files used. AI-assisted.

**@⁠kevincommits** on GitHub · 2026-11-26 07:15 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1444#issuecomment-7185261671) Independent run with the real assembler, not stand-ins. Apple M5 Pro, macOS 27.2.1 (26B131), Python 3.14.2, Homebrew LLVM 23.1.6 (`llvm-mc` with the AMDGPU target), SPIRV-Tools from Homebrew. I merged `main` at `a73a57e13` into the branch locally (822 commits behind, no conflicts). Head tested: `ae4e7d75d`. **`build.py` with no names: on `main` it stops at `cs_dpp_cmp` and publishes nothing; on this branch it builds all 301 shaders and all 301 pass `spirv-val`.** Command on both trees: `LLVM_MC=/opt/homebrew/opt/llvm/bin/llvm-mc python3 -I runtime/test/shaders/build.py <out>`. | tree | result | files in `<out>/spirv` | |---|---|---| | `main` at `a73a57e13` | exit 1: `<stdin>:17:1: error: dpp variant of this instruction is not supported` at `v_cmp_gt_f32_dpp vcc_lo, v1, v1 dpp8:[4,5,6,7,0,1,2,3]` | 0 | | this branch merged with `main` | `301 shaders: 301 translated, 301 pass spirv-val` | 604, 20 of them for the `dpp` fixtures | So the failure in the description reproduces here with a current llvm-mc, and the change removes it. - **Test file.** `python -I tests/test_shader_build_text_only.py`: 8/8 on the merged tree. - **Full standalone suite on the merged tree:** 514 run, 513 pass; the 1 that fails is `main`'s `test_mod_pack_output_alias` (fixed by #1412). Not tested: `check.py` and the GPU runs on the built shaders, and the `LEONIDA_*` build variants. No game files used. AI-assisted.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1444/head:github-bot/gh-1444'
git switch 'github-bot/gh-1444'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1444'
git switch 'github-bot/gh-1444'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1444'
git switch 'github-bot/gh-1444'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1444'
git switch 'main'
git merge --squash 'github-bot/gh-1444'
git switch 'main'
git merge --ff-only 'github-bot/gh-1444'
git switch 'main'
git merge 'github-bot/gh-1444'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.