Skip to content

run_gpu_tests: a fixture llvm-mc can't assemble is that test's FAIL (TEST-961) - #4416

Open
vibryxcx wants to merge 1 commit into
ItsNotRexed:mainfrom
vibryxcx:test-961-assemble-per-fixture
Open

vibryxcx wants to merge 1 commit into
ItsNotRexed:mainfrom
vibryxcx:test-961-assemble-per-fixture

Conversation

@vibryxcx

Copy link
Copy Markdown

Claimed in the coordination issue as: TEST-961 (claim; split with @LouisRiverstone, who keeps the #4337 fixture fix, here)

What and why

scripts/run_gpu_tests.py assembles every fixture before running anything, and assemble_to_s() raises RuntimeError when llvm-mc rejects one. So a single fixture the installed llvm-mc can't assemble (today #4337's new one, with llvm-mc 23.1.6) stopped the whole GPU suite before any test ran.

The error is now caught per fixture in run_suite():

  • the fixture is left out of the translation (and its old .spv in a reused --work folder is still removed first);
  • it is reported as FAIL <name> llvm-mc: <first error: line>, next to the existing missing .spv (translation failed) case;
  • every other fixture still assembles, translates and runs.

A missing llvm-mc is unchanged: mc_command.run still stops with its one-line message about LLVM_MC/--llvm-mc.

Tested

Windows 11 Pro 25H2 (build 26200), Python 3.12.10, llvm-mc 23.1.6 (conda-forge), AMD Radeon RX 6800 (RDNA2), AMD 26.8.1. No game files.

  • python -I tests/test_run_gpu_tests.py: 42/42 OK, with two new tests in FixtureLlvmMcRejects: the rejected fixture is a FAIL with llvm-mc's error line, is not handed to the translator, nothing runs for it, and the suite returns 1 with 0/1 passed; assembler_error() picks the first error: line. Against main's run_gpu_tests.py they fail (2 errors).
  • python -I tests/test_run_gpu_tests_paths.py: 20/20 OK.
  • Real run on the GPU with a temporary bad fixture cs_dpp8_bogus.asm (deleted afterwards) next to cs_dpp8, --filter cs_dpp8:
      PASS  cs_dpp8               7 6 5 4 3 2 1 0
      FAIL  cs_dpp8_bogus         llvm-mc: <stdin>:2:1: error: invalid instruction
    1/2 passed
    
  • python -m compileall -q on both files and git diff --check: clean.

AI-assisted (Claude Code).

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. (N/A: test runner only.)

🤖 Generated with Claude Code

…TEST-961)

assemble_to_s() raised RuntimeError for any fixture the installed llvm-mc
rejects, and run_suite() assembled every fixture up front, so one such
fixture ended the whole GPU suite before any test ran. The error is now
caught per fixture: the fixture is left out of the translation and
reported as `FAIL <name>  llvm-mc: <first error: line>`, next to the
existing "missing .spv" failure, and the other fixtures still run. Its old
.spv in a reused --work folder is removed first, as for any fixture.

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

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this at 0576550f on Windows 11: pytest tests/test_run_gpu_tests.py -q -> 42 passed, 46 subtests passed; git diff --check clean.

An assembler error on one fixture is now that test's failure instead of aborting the whole suite, matching the readback handling. No blocking issue.

@bobcatchris

Copy link
Copy Markdown
Contributor

Apple M2 validation of the runner change (macOS 26.4, MoltenVK 1.4.2 direct, subgroup 4..32, llvm-mc 23.1.6, clean full build exit 0). Tested head 0576550.

  • pytest -q tests/test_run_gpu_tests.py tests/test_run_gpu_tests_paths.py: 62 passed, 51 subtests passed.
  • Full python -I scripts/run_gpu_tests.py --build runtime/build/linux: 213 shaders translated, 213 pass spirv-val; 127/210 passed, 76 skipped, 7 failed — the seven failures are exactly the known MoltenVK expected set (cs_fma_fused, ps_ssharp, ps_vcmp_f16, ps_vcmp_f16_e64, ps_vcmp_f32_nan, ps_vcmpx_f16, ps_vcmpx_f16_e64), unchanged from main aa2988c on this M2. No new failure caused by the runner change.

Head fetched read-only, no rebase/edit/push. Synthetic shaders and counts only; no game files.

AI-assisted.

@MKmajster

Copy link
Copy Markdown

Tested 0576550 on Windows 11, NVIDIA RTX 3070 / 617.42, llvm-mc 23.1.6: it does what TEST-961 asked.

  • Broken fixture: s_mov_b64 s[21:22], s[24:25] (odd 64-bit SGPR base) appended to cs_w32_lane_wrap.asm in a local copy. The full suite now runs to the end, 163/210 passed, 46 skipped, exit 1, and that fixture is reported on its own line as FAIL cs_w32_lane_wrap llvm-mc: <stdin>:32:11: error: invalid register alignment. Before this change the same file gave a traceback and 0 tests.
  • Clean tree, with GPU test cs_w32_movrels64: s_movrels_b64 #4337 merged in: 165/211 passed, 46 skipped, exit 0, so nothing else changes.

AI-assisted (Claude).

@akimfomin

Copy link
Copy Markdown

Windows GPU A/B with a reused work directory on Windows 11 28000.3501, RTX 4070 Ti SUPER / 617.14, llvm-mc 23.1.6 with AMDGPU. Exact 03b09a08 versus 0576550f; the portable GPU harness was built from the unchanged runtime source. I selected the stock cs_dpp8 plus a synthetic copy with one invalid instruction, and pre-seeded the bad-name .spv with a previously valid shader.

  • On main the assembler error raised a traceback before any GPU result and left the old .spv in place.
  • On the PR the good fixture ran on the GPU (7 6 5 4 3 2 1 0), its assembled module passed spirv-val and was byte-identical to the good-only baseline. The bad fixture reported FAIL with the invalid-instruction diagnostic, removed the stale .spv, and the mixed run ended 1/2, exit 1, without a traceback.
  • Bad-only with a fresh stale file gave 0/1, exit 1, and deleted that file. Good-only still gave 1/1, exit 0.

test_run_gpu_tests.py and test_run_gpu_tests_paths.py passed all 62 tests at the PR head. Synthetic inputs only. AI-assisted (Codex).

@Flyander Flyander left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An llvm-mc rejection is now isolated to that fixture, reported as a FAIL, and excluded from translation; stale SPIR-V is removed first. Missing llvm-mc and GPU capability skips keep their existing behavior.

@whattheflop whattheflop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted Windows CPU verification at 0576550f with uv CPython 3.12.13. The runner, path, and LLVM command suites passed 79 tests.

A fresh and a reused work folder each produced PASS / FAIL / PASS in fixture order, 2/3 passed, exit 1. I placed the fake LLVM rejection between two ordinary pixel fixtures. Both siblings reached the translator and harness. The failed fixture showed the first LLVM error and its seeded stale SPIR-V was removed. Existing .s and .raw files for that fixture stayed on disk, but neither was used in the failed run.

A file-level dry merge of the runner with #4426 0d062f28 was clean and preserved both batch outcomes when fake tool output included non-UTF-8 bytes. The batch used stubbed tools and no GPU or game data.

@CaravelaLabs

Copy link
Copy Markdown
Contributor

Automated test: 0576550f merged onto main 03b09a08 on AMD Radeon 8060S (RADV GFX1151, RDNA 3.5), Mesa 25.2.8, Ubuntu 24.04, runtime rebuilt from this branch in a clean sandbox. Result: pass.

Same machine and setup as my earlier manual reports. AI-assisted (Claude Code).

@tupacfan04

Copy link
Copy Markdown
Contributor

APPROVE. tests/test_run_gpu_tests.py 42/42 and _paths 20/20 pass, compileall clean, merge clean, and the negative control against main gives 2 errors.

The absent-assembler path is unchanged: tools/mc_command.py:67-68 raises SystemExit, which the new except RuntimeError (scripts/run_gpu_tests.py:739-744) does not catch; with a bogus --llvm-mc it is one-line "could not be started", not a per-test FAIL. The old .spv is removed before assembly.

Minor: :805 checks the ps_ij_computed SKIP before asm_failures (:811), so that fixture stays SKIP even if llvm-mc rejects it, which slightly contradicts the "unassemblable fixture FAILs" wording.

Approve. AI-assisted review, no game files, no GPU.

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.

9 participants