Skip to content

CI: run llvm-mc-gated stdlib tests where LLVM 21 is installed - #4703

Open
bobcatchris wants to merge 3 commits into
ItsNotRexed:mainfrom
bobcatchris:ci/llvm-mc-stdlib-parity
Open

bobcatchris wants to merge 3 commits into
ItsNotRexed:mainfrom
bobcatchris:ci/llvm-mc-stdlib-parity

Conversation

@bobcatchris

Copy link
Copy Markdown
Contributor

Claimed on the coordination board: #4683 (comment)

The check job runs tests/test_rdna2_decode.py and tests/test_cvt_norm_mods_probe.py with python -I, but installs no llvm-mc, so their parity checks only hit skipTest. The translator-tests job installs LLVM 21 and exports LLVM_MC, but its loop sends only pytest-style files to pytest, so neither file runs there either. The result is that the rdna2_decode llvm-mc parity check can fail on main unseen (TEST-1010).

This PR runs those two stdlib scripts in translator-tests after pytest, with python -I "$t" and LLVM_MC already exported. tests/test_ci_registration.py now discovers every stdlib file that skips on llvm-mc and asserts that the workflow's llvm_mc_stdlib_tests array lists exactly those files, so a new gated test cannot silently land without a CI run.

Verification (Windows 11, CPython 3.12.0, CPU only; no game files, no GPU):

  • python -I tests/test_ci_registration.py: 12/12 OK.
  • Negative control: the same test file against untouched origin/main fails only test_the_translator_job_runs_stdlib_tests_that_need_llvm_mc.
  • compileall on the changed test and git diff --check clean.
  • The LLVM 21 parity assertions themselves are workflow-side: this machine has LLVM 17, so I did not try to emulate the runner's llvm-mc 21 result.

AI-assisted.

The check job has no llvm-mc, so test_rdna2_decode and test_cvt_norm_mods_probe only exercise their skip paths there. The translator-tests job installs LLVM 21 and exports LLVM_MC, but its loop only hands pytest-style files to pytest. Run the two stdlib scripts there too, and pin the list to the files that skip on llvm-mc in test_ci_registration.py.

@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 c47f99a2f on Windows 11: pytest tests/test_ci_registration.py -q -> 12 passed, 4 subtests passed; git diff --check clean.

The translator job now also runs the two stdlib scripts that skip their only llvm-mc check when LLVM_MC is absent (test_cvt_norm_mods_probe.py, test_rdna2_decode.py), and the registration test keeps that list equal to the files that actually skip on llvm-mc — so a new gated test cannot silently stay unrun. No blocking issue.

@kapitche

Copy link
Copy Markdown
Contributor

Tested c47f99a merged with main 98fa503 on Linux (Python 3.12.16): pass - tests/test_ci_registration.py 12 tests OK (incl. the new one); negative control: restored upstream/main's ci.yml, the new test fails ("the Translator tests step has no llvm_mc_stdlib_tests array"), 1 failure of 12; restored. The three files that mention llvm-mc skips are test_cvt_norm_mods_probe.py and test_rdna2_decode.py (listed) and test_valu_fuzz.py (pytest, not a stdlib script, correctly not listed). I could not run the two listed scripts under llvm-mc 21 (not installed here); the CI step is unexercised.

@tupacfan04

Copy link
Copy Markdown
Contributor

Merge-ready. tests/test_ci_registration.py 12/12, the affected test_rdna2_decode.py 9 OK (1 skip without llvm-mc), test_cvt_norm_mods_probe.py 14 OK (2 skips), compileall clean, merge clean. Negative control: the PR's test file on untouched main fails exactly the new test ("Translator tests step has no llvm_mc_stdlib_tests array"), exit 1.

One limitation worth noting: the guard regex is line-local and only matches a hyphenated llvm-mc next to skipTest/skipIf/skipUnless (tests/test_ci_registration.py:261), so an LLVM_MC-worded or multi-line skip escapes the "cannot silently land" check. Current files are covered; a broader match (both spellings, allowing a line break) would close it.

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

@memorypressure

memorypressure commented Nov 23, 2026 •

Copy link
Copy Markdown

The approach and the test_ci_registration drift-guard look right, but as submitted this leg fails at this head — reproduced: tests/test_rdna2_decode.py's llvm-mc parity check fails at "exp" in ps_w64_a_discard.asm (target vs special), because the stack lacks the fix from #4697, and both listed test files exist only in the 900+ commit stack this PR is based on, not on main. That stack also reverts several already-merged PRs (tests like test_alu_dot2_f16.py are deleted relative to main — verified), so this cannot merge as-is. Please rebase onto main (or onto #4697 once that lands) keeping just this commit. CI was still pending at review time. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

Correction (2026-11-23): the rebase rationale above was based on a stale main ref — the head merge-trees cleanly with current main. The FAIL stands, though: tests/test_rdna2_decode.py is red on main itself at exp-null, so this leg stays red until #4697's fix lands.

tests/test_rdna2_decode.py's parity check is red on main at
ps_w64_a_discard.asm's `exp` null operand until ItsNotRexed#4697 merges, so listing
it in the new leg would fail CI. Run the other gated stdlib test now; the
registration test still detects the parity file and holds it in
LLVM_MC_BLOCKED, so it cannot be forgotten when ItsNotRexed#4697 lands.

AI-assisted.
@bobcatchris

Copy link
Copy Markdown
Contributor Author

The branch is one commit on 98fa503f (2 files, +41), so the 900-commit stack you saw can only be an earlier head or the branch tree rather than a merge; it is rebased now.

The failing leg is real on current main: tests/test_rdna2_decode.py's parity check fails at ps_w64_a_discard.asm's exp (special null vs off) until #4697 lands — reproduced here with LLVM_MC set. Fixed in 23f49fe:

python -I tests/test_ci_registration.py: 12 tests OK; git diff --check clean. CI still pending here.

AI-assisted.

@DenRakEiw

Copy link
Copy Markdown

Tested against head 23f49fe393322c13afb526c960c3ecc7d95d018e on Windows 11 / Python 3.12.10.

  • Trial-merge onto origin/main (d974c88a): clean (git diff --cached --check exited 0; 2 files changed: .github/workflows/ci.yml, tests/test_ci_registration.py).
  • python -I tests/test_ci_registration.py: Ran 12 tests, OK.
  • Code read: Adds an llvm_mc_stdlib_tests loop running tests/test_cvt_norm_mods_probe.py with python -I in translator-tests (where LLVM_MC is exported) and enforces registration in tests/test_ci_registration.py (with tests/test_rdna2_decode.py tracked in LLVM_MC_BLOCKED while TEST-1010: rdna2_decode: exp null is a special operand, as shader_ir parses it #4697 is open; minor note: re.findall in the registration test would match a commented-out tests/*.py inside llvm_mc_stdlib_tests).

AI-assisted review (Gemini 4 Neon).

@bobcatchris

Copy link
Copy Markdown
Contributor Author

@DenRakEiw good catch on the commented-out entry: 6a240701 moves the array parsing into llvm_mc_listed_tests() and drops comment lines before matching, with a new regression test for a commented tests/test_old.py beside a real entry. python -I tests/test_ci_registration.py is 13 tests OK.

AI-assisted.

@bobcatchris

Copy link
Copy Markdown
Contributor Author

The commented-out entry @DenRakEiw found is fixed in 6a240701 (comment lines dropped before matching, plus a regression test), and the doc line in 49bfe11e-era follow-ups is unchanged. Heads after DenRakEiw's test: trial-merge still clean. Ready for a re-review. 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.

6 participants