[PR #1375] [MERGED] tests: the pytest helper takes a text-only sample's lines as its listing, as run_gpu_tests.py does (TEST-TRANSLATE-TEXT-ONLY) #1405

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1375
Author: @milk4sale
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142

Base: main ← Head: test/translate-text-only-sample


📝 Commits (1)

  • 8d29ffd tests: the pytest helper takes a text-only sample's lines as its listing, as run_gpu_tests.py does (TEST-TRANSLATE-TEXT-ONLY)

📊 Changes

2 files changed (+33 additions, -4 deletions)

View changed files

📝 tests/conftest.py (+13 -2)
📝 tests/test_translate.py (+20 -2)

📄 Description

Claimed in the coordination issue as: TEST-TRANSLATE-TEXT-ONLY (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7146574385)

What and why

translator-tests is red on main since 6261ca916, the merge of #957 at 21:04 UTC on 24 November, so it fails on every pull request whose run starts on a main from then on. Two tests fail, both on the fixture #957 added:

  • tests/test_translate.py::test_gpu_samples_translate_and_validate[cs_dpp_cmp.asm]
  • tests/test_translate.py::test_wave64_emulate_uses_no_subgroup_ops[cs_dpp_cmp.asm]

Both stop at the llvm-mc assertion of conftest.Shader with error: dpp variant of this instruction is not supported, before they reach the translator.

llvm-mc has no gfx1013 encoding for a VOPC compare in DPP form. #957 dealt with that for the GPU suite: cs_dpp_cmp.asm carries the comment line ; run_gpu_tests: text only, llvm-mc has no gfx1013 encoding for an instruction here, and assemble_to_s in scripts/run_gpu_tests.py then writes the listing from the file's text. The pytest helper assembles every sample with llvm-mc and did not know that line.

conftest.Shader now does what the GPU runner does for a sample that carries the line: its instruction lines are the listing, in the same form. Both tests then translate and validate the fixture. A sample without the line is assembled as before, and fails as before when llvm-mc rejects it. The fixture, the translator and the GPU runner are unchanged.

This is independent of #1365, which fixes the other test that is red on main (tests/test_ci_registration.py, in the standard-library loop). The two touch different files.

Tested

  • The two failing tests pass, and two new ones:
    • test_text_only_mark_is_spelled_as_in_the_gpu_runner reads the line out of scripts/run_gpu_tests.py, so the two copies cannot drift apart unnoticed;
    • test_only_a_marked_sample_skips_llvm_mc gives Shader lines llvm-mc rejects, once with the line (the listing is the text, comment lines dropped) and once without (the llvm-mc assertion still fires).
  • Controls, each in a scratch copy: with the line spelled differently in conftest.py, the spelling test and both cs_dpp_cmp tests fail; with every sample taking the text path, the second new test fails.
  • The "Translator tests" step with the workflow's own file list (37 files): on main 89d7dfcf5, 2 failed, 1618 passed; on this branch, 1622 passed. Run with pytest 9.2.0 on Python 3.14.10, llvm-mc 23.1.4 and SPIRV-Tools v2026.4, in an environment without numpy and Pillow, so 134 tests that need them were skipped in both runs.
  • The same two failures on a GitHub runner with llvm-mc 21 and the pinned requirements, in my fork's CI runs of main 4a50cafc7 and of #1365's branch (main 89d7dfcf5 plus its one commit, which touches neither file): 2 failed, 1879 passed, 14 skipped.
  • Every standalone test file under tests/ with python -I (491 files): 490 pass. The one failure is tests/test_ci_registration.py, red on main since #930 and fixed by #1365, not by this.
  • python -I scripts/check_no_game_data.py tests/conftest.py tests/test_translate.py, python -m compileall and git diff --check.

Not run locally: Python 3.12 and llvm-mc 21 (the versions the job installs), and the tests that need numpy or Pillow.

GPUs tested: n/a (two Python test files; no shader, fixture or runtime code)

AI-assisted: yes (Claude Code)

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. (No translator change.)

🤖 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/1375 **Author:** [@milk4sale](https://github.com/milk4sale) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/26/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `test/translate-text-only-sample` --- ### 📝 Commits (1) - [`8d29ffd`](https://github.com/ubiquitarianism/leonida/commit/8d29ffd26ce35c9bad7d0b751d0637e23139934c) tests: the pytest helper takes a text-only sample's lines as its listing, as run_gpu_tests.py does (TEST-TRANSLATE-TEXT-ONLY) ### 📊 Changes **2 files changed** (+33 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tests/conftest.py` (+13 -2) 📝 `tests/test_translate.py` (+20 -2) </details> ### 📄 Description Claimed in the coordination issue as: TEST-TRANSLATE-TEXT-ONLY (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7146574385) ### What and why `translator-tests` is red on `main` since `6261ca916`, the merge of #957 at 21:04 UTC on 24 November, so it fails on every pull request whose run starts on a `main` from then on. Two tests fail, both on the fixture #957 added: - `tests/test_translate.py::test_gpu_samples_translate_and_validate[cs_dpp_cmp.asm]` - `tests/test_translate.py::test_wave64_emulate_uses_no_subgroup_ops[cs_dpp_cmp.asm]` Both stop at the llvm-mc assertion of `conftest.Shader` with `error: dpp variant of this instruction is not supported`, before they reach the translator. llvm-mc has no gfx1013 encoding for a VOPC compare in DPP form. #957 dealt with that for the GPU suite: `cs_dpp_cmp.asm` carries the comment line `; run_gpu_tests: text only, llvm-mc has no gfx1013 encoding for an instruction here`, and `assemble_to_s` in `scripts/run_gpu_tests.py` then writes the listing from the file's text. The pytest helper assembles every sample with llvm-mc and did not know that line. `conftest.Shader` now does what the GPU runner does for a sample that carries the line: its instruction lines are the listing, in the same form. Both tests then translate and validate the fixture. A sample without the line is assembled as before, and fails as before when llvm-mc rejects it. The fixture, the translator and the GPU runner are unchanged. This is independent of #1365, which fixes the other test that is red on `main` (`tests/test_ci_registration.py`, in the standard-library loop). The two touch different files. ### Tested - The two failing tests pass, and two new ones: - `test_text_only_mark_is_spelled_as_in_the_gpu_runner` reads the line out of `scripts/run_gpu_tests.py`, so the two copies cannot drift apart unnoticed; - `test_only_a_marked_sample_skips_llvm_mc` gives `Shader` lines llvm-mc rejects, once with the line (the listing is the text, comment lines dropped) and once without (the llvm-mc assertion still fires). - Controls, each in a scratch copy: with the line spelled differently in `conftest.py`, the spelling test and both `cs_dpp_cmp` tests fail; with every sample taking the text path, the second new test fails. - The "Translator tests" step with the workflow's own file list (37 files): on `main` `89d7dfcf5`, 2 failed, 1618 passed; on this branch, 1622 passed. Run with pytest 9.2.0 on Python 3.14.10, llvm-mc 23.1.4 and SPIRV-Tools v2026.4, in an environment without numpy and Pillow, so 134 tests that need them were skipped in both runs. - The same two failures on a GitHub runner with llvm-mc 21 and the pinned requirements, in my fork's CI runs of `main` `4a50cafc7` and of #1365's branch (`main` `89d7dfcf5` plus its one commit, which touches neither file): 2 failed, 1879 passed, 14 skipped. - Every standalone test file under `tests/` with `python -I` (491 files): 490 pass. The one failure is `tests/test_ci_registration.py`, red on `main` since #930 and fixed by #1365, not by this. - `python -I scripts/check_no_game_data.py tests/conftest.py tests/test_translate.py`, `python -m compileall` and `git diff --check`. Not run locally: Python 3.12 and llvm-mc 21 (the versions the job installs), and the tests that need numpy or Pillow. GPUs tested: n/a (two Python test files; no shader, fixture or runtime code) AI-assisted: yes (Claude Code) ### 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. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (No translator change.) 🤖 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>
4ld0 2026-11-26 20:21:09 +01:00
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#1405
No description provided.