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

Open
opened 2026-11-26 20:21:22 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1444
Author: @hugo0024
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: build-text-only


📝 Commits (1)

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

📊 Changes

2 files changed (+168 additions, -14 deletions)

View changed files

📝 runtime/test/shaders/build.py (+37 -14)
➕ tests/test_shader_build_text_only.py (+131 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1444 **Author:** [@hugo0024](https://github.com/hugo0024) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `build-text-only` --- ### 📝 Commits (1) - [`ae4e7d7`](https://github.com/ubiquitarianism/leonida/commit/ae4e7d75dd231912facf118b2b5d66869e3cc6f4) build.py: a text-only fixture's lines are its listing, as in run_gpu_tests.py (TEST-BUILD-TEXT-ONLY) ### 📊 Changes **2 files changed** (+168 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/shaders/build.py` (+37 -14) ➕ `tests/test_shader_build_text_only.py` (+131 -0) </details> ### 📄 Description Claimed in the coordination issue as: TEST-BUILD-TEXT-ONLY ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148298254)) 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#1474
No description provided.