Skip to content

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

Open
hugo0024 wants to merge 1 commit into
ProjectLeonida:mainfrom
hugo0024:build-text-only
Open

hugo0024 wants to merge 1 commit into
ProjectLeonida:mainfrom
hugo0024:build-text-only

Conversation

@hugo0024

@hugo0024 hugo0024 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

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

@Tauwni

Tauwni commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

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 (cs_imgatomic_ext: use the volume T# key vk_store_test now expects (GPU-IMG-ATOMIC-EXT-VOLUME-TAG) #1518).
  • python -I tests/test_shader_build_text_only.py: 8 tests OK.

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

@Anzymanz

Copy link
Copy Markdown
Contributor

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.

@PierreEbele

Copy link
Copy Markdown
Contributor

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

@kevincommits

Copy link
Copy Markdown
Contributor

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.

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

DadaCap pushed a commit that referenced this pull request Nov 28, 2026
…U-RX9060XT-WIN)

First record of an RX 9060 XT (RDNA4, GFX1200 / Navi 44): run_gpu_tests.py
247/268 passed, 19 skipped, 2 failed (cs_imgatomic_ext #1518, cs_texture_uav
#2261) natively and with LEONIDA_W64_EMULATE=1; build.py and check.py with
#1444; ctest with the four known failures and their pull requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DadaCap pushed a commit that referenced this pull request Nov 28, 2026
…e95fa2 (GPU-RX9070XT-RADV)

run_gpu_tests.py, build.py and check.py, native and LEONIDA_W64_EMULATE=1,
on an RX 9070 XT under RADV. One failure on main (cs_imgatomic_ext), which
#1518 fixes on this GPU; build.py stops at cs_dpp_cmp on main and runs
clean with #1444. ms_wave_info_s3 passes in every run here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OreoFR

OreoFR commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Verified by OreoFR

Run 1 (win02)

  • Base: main 5cb45921e + PR head 3fd1a37dc; green run in a merge package of 2 PRs, no new ctest failure vs main
  • Test: python -I tests/test_shader_build_text_only.py ; package ctest
  • Red on main: 6 ERROR (AttributeError TEXT_ONLY_MARK: main has no text-only path in build.py; the constant and text_only_listing are the feature): the missing function itself
  • Green with the PR: 8 OK, package with no new ctest failure
  • Verdict: READY

Run 2 (lot 4)

  • Base: main 09c153948 + PR head 3fd1a37dc; integration package 1 of 6 (20 PRs, merged without conflict)
  • Test: full runtime build; ctest -j 6 without the 28 tests that launch gta6rt; full Python suite; translator suite
  • Red on main: n/a (integration test; main baseline: xbox_present and d3d12_set_descriptor_heaps)
  • Green with the PR: ctest: only xbox_present and d3d12_set_descriptor_heaps fail, as on main; Python: the same 7 failing files as main, the PRs' 11 test files pass; translator: 0 failures
  • Verdict: CLEAN PACKAGE (no new failure vs main)

Run 3 (lot 4 bis)

All runs

  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 28, 2026
@MoonEyes

Copy link
Copy Markdown
Collaborator

Hi @hugo0024, thanks for this pull request. OreoFR checked it red/green on Windows (RTX 4070 Laptop, driver 621.40): tests/test_shader_build_text_only.py fails on main without it and passes with it, and the C++ bundle showed no new ctest failure. It was ready to merge, but #822 was merged just before it and both touch runtime/test/shaders/build.py, so it now conflicts with main (c7753ed) in that file. Could you merge main into your branch (no rebase needed) and resolve that one file? It can be merged right after.

AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.

…tests.py (TEST-BUILD-TEXT-ONLY)

cs_dpp_cmp.asm (ProjectLeonida#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 <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 29, 2026
@zmasi

zmasi commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Verification Report (703b69134c merged into main c8bf0e7b6)

  • Environment: Windows 11, Python 3.12.10, llvm-mc 21.x (amdgcn target), Vulkan SDK 1.4.363.1 (spirv-as, spirv-val, LEONIDA_VK_VALIDATION=1 with VK_LAYER_KHRONOS_validation), NVIDIA GeForce RTX 3090 (Ampere, driver 610.88, subgroup 32..32). No game data used (check_no_game_data.py rc=0).
  • Diff & Merge Audit: Merged 703b69134c cleanly into current origin/main (25cf1aa4ec / c8bf0e7b6, 0 conflicts; 2 files changed: runtime/test/shaders/build.py, tests/test_shader_build_text_only.py). Confirmed that the #822 conflict resolution in runtime/test/shaders/build.py preserves both barycentric_fallback() / f16_interp_fallback_override() and TEXT_ONLY_MARK / text_only_listing(), staging synthetic FSSM headers and bypassing llvm-mc only when TEXT_ONLY_MARK appears as a full standalone line.

Red -> Green Results (Post-#822 Resolution + Live RTX 3090 Shader Execution)

Check Base main build.py Merged main + #1444 (703b69134c)
python -I tests/test_shader_build_text_only.py RED (rc=1, FAILED (errors=6): AttributeError: ... 'TEXT_ONLY_MARK') GREEN (rc=0, Ran 8 tests in 0.846s — OK)
python -I tests/test_shader_build_fallbacks.py (#822 regression check) — GREEN (rc=0, Ran 9 tests in 1.874s — OK)
python -I runtime/test/shaders/build.py <out> RED (rc=1, aborts at cs_dpp_cmp.asm did not assemble: error: dpp variant of this instruction is not supported; 0 .spv modules written) GREEN (rc=0: 306 shaders: 306 translated, 306 pass spirv-val, including cs_dpp_cmp.spv)
check.py <out> on RTX 3090 (LEONIDA_VK_VALIDATION=1) RED (0 modules built) GREEN (cs_dpp_cmp ok + all 10 cs_dpp* fixtures ok, 0 validation errors)
w64_graphics.py <out> on RTX 3090 (LEONIDA_VK_VALIDATION=1) RED (30/30 missing .spv) GREEN (rc=0: 18/18 Tier A/B draws ok, 12 Tier C cleanly skipped without W64G_REF, 0 missing .spv)
  • Verdict: PASS (post-#822 merge resolution at 703b69134c merges cleanly into current main, preserves #822's fallback tests, unblocks full build.py translation of all 306 fixtures, and passes live cs_dpp_cmp + w64_graphics.py execution on RTX 3090).

AI-assisted.

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.

8 participants