wint_diff: GFX12 has no always-true/false VALU compare; skip those programs by name (OLD-9928) #1332

Open
github-bot wants to merge 1 commit from github-bot/gh-1332 into main AGit
Owner

@⁠fin-github on GitHub · 2026-11-24 21:58 UTC · original
fin-github:takeover/old-9928-wint-diff-gfx12 → main · +92 −6 · 4 files · 1 commits · open

Claimed in the coordination issue as: OLD-9928 (#14)

Supersedes draft #197, carried over from old upstream PR 9928 in the original repository. This is the same change cherry-picked onto current main (git cherry-pick -x), with the original author (Størm) kept on every commit. The change and its explanation are theirs; see #197 for the original description.

Tested

Windows 11 Pro 26200, CPython 3.14.4, on main 4a50cafc7. No GPU, no game files.

  • On this branch: tests/test_hw_oracle.py: 60 OK (3 skipped); tests/test_wint_diff.py: 30 OK
  • The same test file(s) with main's code: test_gfx12_has_no_always_true_or_false_valu_compare and test_gfx12_skips_its_removed_compares_by_name_and_never_assembles_them error, so the tests still catch the bug on current main.
  • scripts/check_no_game_data.py on the changed files and tests/test_text_write_line_endings.py: clean.

GPUs tested: n/a

AI-assisted: yes (Claude Code). The cherry-pick and the test runs were done by the agent; the code is the original author's.

**@⁠fin-github** on GitHub · 2026-11-24 21:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1332) `fin-github:takeover/old-9928-wint-diff-gfx12` → `main` · +92 −6 · 4 files · 1 commits · open Claimed in the coordination issue as: `OLD-9928` (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) Supersedes draft #197, carried over from old upstream PR 9928 in the original repository. This is the same change cherry-picked onto current `main` (`git cherry-pick -x`), with the original author (Størm) kept on every commit. The change and its explanation are theirs; see #197 for the original description. ### Tested Windows 11 Pro 26200, CPython 3.14.4, on `main` 4a50cafc7. No GPU, no game files. - On this branch: `tests/test_hw_oracle.py`: 60 OK (3 skipped); `tests/test_wint_diff.py`: 30 OK - The same test file(s) with `main`'s code: `test_gfx12_has_no_always_true_or_false_valu_compare` and `test_gfx12_skips_its_removed_compares_by_name_and_never_assembles_them` error, so the tests still catch the bug on current `main`. - `scripts/check_no_game_data.py` on the changed files and `tests/test_text_write_line_endings.py`: clean. GPUs tested: n/a AI-assisted: yes (Claude Code). The cherry-pick and the test runs were done by the agent; the code is the original author's.
GFX12 dropped v_cmp_{t,f}_{i32,u32,i64,u64} and their v_cmpx_ forms: AMD LLVM 23
(rocm-sdk-core 10.0.0) assembles all sixteen for gfx1036, gfx1100 and gfx1150 and rejects
every one for gfx1201. wint_diff emits v_cmp_t_u32 and v_cmp_f_i32 (and the v_cmpx_ forms),
so on an RX 9070 XT those programs were counted as "assembler rejected", and the whole batch
carried the first error's text: on main all 69 skips of seed 1 read "... v_cmp_t_u32",
including the programs that only use v_cmp_f_i32.

- tools/hw_oracle/asm.py: GFX12_VALU_REMOVED lists the sixteen. valu_skip_reason() names
  them on gfx12xx (and ignores an _e32/_e64 suffix); program_skip_reason() returns the
  first such reason of a program's lines. The GFX10.1-only mads are unchanged.
- tools/wint_diff.py: hw_results() sends only the programs the GPU can run; the others get
  their reason and are never assembled. The run and the shrinker both use it.
- Tests: the sixteen, the suffixes, gfx1013/1036/1100/1150 unchanged, and hw_results with a
  fake oracle (gfx1201 assembles only the program it can run; gfx1036/1150 run all four).

RX 9070 XT, `wint_diff.py --oracle hw --programs 500 --wave both`: seeds 1 and 2 give the
same 431 / 426 passes and 69 / 74 skips as main, 0 mismatch; the skips now read v_cmp_f_i32
29, v_cmp_t_u32 25, v_cmpx_f_i32 8, v_cmpx_t_u32 7 (seed 1) and 25 / 25 / 12 / 12 (seed 2).
gfx1036: 500/500 on both seeds, as on main.

AI-assisted (Claude Code).

(cherry picked from commit 32a9427ba4)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:47:41 +00:00
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-24 23:43 UTC · original

Independent verification (overnight shift, CPU/tooling only, no game data).

Commands run on head ddd1923c (Git Bash, py -3.14):

  • py -3.14 -m compileall -q tools/wint_diff.py tools/hw_oracle/asm.py tests/test_wint_diff.py tests/test_hw_oracle.py — clean
  • py -3.14 -I tests/test_hw_oracle.py: Ran 60 tests, OK (3 skipped — environment, unrelated)
  • py -3.14 -I tests/test_wint_diff.py: Ran 30 tests, OK
  • py -3.14 -I tools/wint_diff.py --self-test: match True, hand values True, unsupported form skipped True
  • Direct check of asm.valu_skip_reason: v_cmp_t_u32, v_cmp_t_u32_e64, v_cmpx_f_i32_e32, v_cmp_f_i64_e64 all return the 'removed in GFX12' reason on gfx1201 and None on gfx1150; v_cmp_eq_u32 unaffected.

Code check: GFX12_VALU_REMOVED covers all 16 v_cmp_/v_cmpx_ × t/f × i32/u32/i64/u64 spellings; the new _e32/_e64 suffix strip in valu_skip_reason is safe because it only feeds the removal tables (VALU_REMOVED ops are gone in all _e forms too). hw_results partitions programs so skipped ones are never sent to oracle.run — verified by the Fake oracle test asserting only 1 of 4 kernels was assembled on gfx1201. Skipped programs surface as str reasons which compare already counts as named skips (isinstance(got, str) → Skip), not assembler rejections. Real oracles (hw_oracle/runner.py, drm.py) expose .arch, and hw_skip no-ops for oracles without one.

Verdict: verified, correct.

AI-assisted verification (Devin).

**@⁠whoalin1** on GitHub · 2026-11-24 23:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1332#issuecomment-7147727809) Independent verification (overnight shift, CPU/tooling only, no game data). Commands run on head ddd1923c (Git Bash, py -3.14): - `py -3.14 -m compileall -q tools/wint_diff.py tools/hw_oracle/asm.py tests/test_wint_diff.py tests/test_hw_oracle.py` — clean - `py -3.14 -I tests/test_hw_oracle.py`: Ran 60 tests, OK (3 skipped — environment, unrelated) - `py -3.14 -I tests/test_wint_diff.py`: Ran 30 tests, OK - `py -3.14 -I tools/wint_diff.py --self-test`: match True, hand values True, unsupported form skipped True - Direct check of `asm.valu_skip_reason`: `v_cmp_t_u32`, `v_cmp_t_u32_e64`, `v_cmpx_f_i32_e32`, `v_cmp_f_i64_e64` all return the 'removed in GFX12' reason on gfx1201 and None on gfx1150; `v_cmp_eq_u32` unaffected. Code check: `GFX12_VALU_REMOVED` covers all 16 v_cmp_/v_cmpx_ × t/f × i32/u32/i64/u64 spellings; the new `_e32/_e64` suffix strip in `valu_skip_reason` is safe because it only feeds the removal tables (VALU_REMOVED ops are gone in all _e forms too). `hw_results` partitions programs so skipped ones are never sent to `oracle.run` — verified by the Fake oracle test asserting only 1 of 4 kernels was assembled on gfx1201. Skipped programs surface as str reasons which `compare` already counts as named skips (`isinstance(got, str)` → Skip), not assembler rejections. Real oracles (`hw_oracle/runner.py`, `drm.py`) expose `.arch`, and `hw_skip` no-ops for oracles without one. Verdict: verified, correct. AI-assisted verification (Devin).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1332/head:github-bot/gh-1332'
git switch 'github-bot/gh-1332'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1332'
git switch 'github-bot/gh-1332'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1332'
git switch 'github-bot/gh-1332'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1332'
git switch 'main'
git merge --squash 'github-bot/gh-1332'
git switch 'main'
git merge --ff-only 'github-bot/gh-1332'
git switch 'main'
git merge 'github-bot/gh-1332'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.