Skip to content

hw_oracle: tools that cannot run on GFX12 say "hardware oracle unavailable" and exit 77 - #5758

Open
nullmarsh wants to merge 3 commits into
ItsNotRexed:mainfrom
nullmarsh:gfx12-oracle-unavailable
Open

nullmarsh wants to merge 3 commits into
ItsNotRexed:mainfrom
nullmarsh:gfx12-oracle-unavailable

Conversation

@nullmarsh

@nullmarsh nullmarsh commented Nov 23, 2026 •

Copy link
Copy Markdown

Claimed in the coordination issue as: #5581 (comment) (from my finding, #5581 (comment))

What and why

docs/testing.md says a tool that cannot use the hardware oracle prints hardware oracle unavailable: ... and exits 77. On an RDNA4 card (RX 9060 XT, gfx1200) eleven tools ended otherwise at main 561b65a8:

Tool On gfx1200 before Why its kernels cannot run there
f32_fuzz.py uncaught RuntimeError: MODE probe ..., exit 1 every kernel sets IEEE and DX10_CLAMP, which gfx1170+ fixes
fmisc_diff.py "no program ran: every one was skipped", exit 2 every kernel sets IEEE and DX10_CLAMP, which gfx1170+ fixes (added in 05bc3d83)
f16_trans_sweep.py harness error: MODE probe ..., exit 2 same
pknorm_probe.py harness error, exit 2 same
fma_mix_probe.py "follows neither rule", every row "no result", exit 1 same
vinterp_hw_probe.py 7 rows printed as MISMATCH whose hardware value is the MODE message, exit 1 same
buffer_swizzle_probe.py, smem_neg_probe.py uncaught RuntimeError: the assembler rejected every program in a chunk, exit 1 MUBUF/MTBUF forms, which the GFX12 assembler rejects (gfx1150 still takes them)
vcmp16_opsel_probe.py hw 3735879680 (the oracle's sentinel) on all 50 rows, "0/50 rows match", exit 1 raw GFX10 compare opcodes: v_cmp_lt_f16_e64 is 0xC9 on gfx1036 and 0x01 on gfx1150 and gfx1200
sampler_lod_probe.py "cannot build the kernel", exit 2 GFX10 mip fields
texoff_probe.py uncaught ValueError: no T# layout for gfx12, exit 1 no GFX12 T# (as image_fuzz.py, which exits 77)

None of these is a model failure on RDNA4, but several read like one. Each reason is known before a kernel is assembled, so each tool now prints it and exits 77:

  • asm.modes_skip_reason(modes, arch): every MODE the tool uses names a field the architecture cannot set.
  • asm.family_skip_reason(arch, families, what): the kernel text or raw encoding belongs to other families.
  • texoff_probe.py reports tsharp.check_arch's error the way image_fuzz.py does.
  • vcmp16_opsel_probe.py also stops with a harness error if the kernel left a word unwritten (the sentinel), instead of comparing it. Its control (v_add_nc_u16) kept its opcode across families, which is how it passed while the compares did not run.

Behaviour on GFX10 is unchanged. On GFX11 two tools change: vcmp16_opsel_probe.py (its raw words are other instructions there) and sampler_lod_probe.py (it already could not build its kernel there, exit 2) now exit 77.

mad_denorm_probe.py already exits 77 on main (v_mad_f32 is GFX10.1 only), so it is not touched. Neither are lds_fuzz.py and valu_fuzz.py (#3978, #4519, #5576) or the GFX12 T# layout (#4152); this branch merges cleanly with #5576.

docs/testing.md lists what runs on RDNA4 and what exits 77.

Tested

AMD Radeon RX 9060 XT (RDNA4, gfx1200), AMD driver 26.11.2 (32.0.32029.2010), Windows 11 Pro 26200, AMD clang from rocm-sdk-core 10.0.0, HIP launcher.

  • Each of the eleven tools (with --oracle hw; f16_trans_sweep.py takes no such flag): exit 77 with its reason, for example hardware oracle unavailable: MODE dx10_clamp, ieee cannot be set on gfx1200: ... and hardware oracle unavailable: the MUBUF kernel text of this probe is written for gfx10 and gfx11; gfx1200 is gfx12.
  • Unchanged on the same card: salu_diff.py (exit 0), crosslane_fuzz.py (50/50 wave64 programs match), int_hw_probe.py (186/186 cases match); mad_denorm_probe.py still exits 77 with main's reason.
  • python -I tests/test_hw_oracle_gfx12_unavailable.py (new, no GPU): each tool with a fake oracle reporting gfx1200 exits 77 with its reason, runs no kernel and closes the oracle; on gfx1030 every tool still reaches Oracle.run; gfx1150 keeps what its assembler takes. Without the tool changes it fails for all ten.
  • The tools' own tests (test_f32_fuzz, test_f16_trans_sweep, test_mad_denorm_probe, test_pknorm_probe, test_fma_mix_probe, test_vinterp_hw_probe, test_vcmp16_opsel_probe, test_texoff_probe, test_sampler_lod_probe, test_buffer_swizzle_probe, test_smem_neg_probe, test_hw_oracle), the eleven test_docs_* files, test_text_write_line_endings and test_check_no_game_data pass; python -m compileall -q make_game.py tools tests and git diff --check are clean.
  • Not run on GFX10 or GFX11 hardware. The opcode and MUBUF statements for gfx1036 and gfx1150 come from llvm-mc -show-encoding, not from a device.

Synthetic programs only; no game files.

AI-assisted: yes (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. (Not applicable: no translator change.)

🤖 Generated with Claude Code

…lable" and exit 77

docs/testing.md says a tool that cannot use the hardware oracle prints
"hardware oracle unavailable: ..." and exits 77. On an RDNA4 card (RX 9060
XT, gfx1200) ten tools ended otherwise at main 561b65a: an uncaught
RuntimeError or ValueError, a "harness error" exit 2, or rows printed as
MISMATCH whose hardware value was the reason text. None of that is a model
failure on RDNA4: their kernels cannot run there, for a reason known before
anything is assembled.

- asm.modes_skip_reason: every kernel of the tool sets IEEE and DX10_CLAMP,
  which gfx1170+ fixes (f32_fuzz, f16_trans_sweep, pknorm_probe,
  fma_mix_probe, vinterp_hw_probe).
- asm.family_skip_reason: the kernel text is an older family's.
  buffer_swizzle_probe and smem_neg_probe use MUBUF/MTBUF forms, which the
  GFX12 assembler rejects and gfx1150 still takes. vcmp16_opsel_probe is raw
  GFX10 compare opcodes (0xC9 for v_cmp_lt_f16_e64 on gfx1036, 0x01 on
  gfx1150 and gfx1200), so on GFX11 and GFX12 it printed the oracle's
  sentinel as a result; it now also refuses a word the kernel never stored.
  sampler_lod_probe sets GFX10 mip fields and exited 2 elsewhere.
- texoff_probe reports a missing T# layout as image_fuzz does, instead of
  raising.

mad_denorm_probe already exits 77 on main (v_mad_f32 is GFX10.1 only), and
lds_fuzz, valu_fuzz and the GFX12 T# are left to ItsNotRexed#3978, ItsNotRexed#4519, ItsNotRexed#5576 and
ItsNotRexed#4152.

tests/test_hw_oracle_gfx12_unavailable.py runs each tool with a fake
oracle reporting gfx1200 (exit 77, the reason, no kernel run, oracle
closed), gfx1030 (every tool still reaches Oracle.run) and gfx1150. It
fails for all ten tools without the change. docs/testing.md lists what
runs on RDNA4 and what does not.

Tested on an RX 9060 XT (gfx1200, AMD 26.11.2, rocm-sdk-core 10.0.0 clang,
HIP launcher): the ten tools exit 77 with their reason; salu_diff,
crosslane_fuzz (50/50) and int_hw_probe (186/186) are unchanged. Not run on
GFX10 or GFX11 hardware. Synthetic programs only, no game files.

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

Copy link
Copy Markdown
Contributor

Tested c16226ef on Windows Server 2022, CPython 3.13.12: pass

  • python -I tests/test_hw_oracle_gfx12_unavailable.py -> OK

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

@memorypressure

Copy link
Copy Markdown

Verified on your head at main 561b65a: the new fake-oracle suite passes 5/5 with no GPU touched, test_hw_oracle 56/56 and all nine probe/fuzzer suites for the changed tools pass (re-run). One heads-up for the stack: merge-tree against long-open #4152 shows a content conflict in tests/semantic/test_loop_ballot_barrier.py — whichever of the two lands second needs a fix there (no conflict vs #3954). The branch reports no CI checks — worth a push. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@kapitche

kapitche commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Tested c16226e merged with main 561b65a (PR already based on it) on Linux WSL2, Python 3.12.16: pass

tests/test_hw_oracle_gfx12_unavailable.py: 5 run, 5 passed, 0 failed. All tests/test_hw_oracle*.py: 61 run, 58 passed, 3 skipped, 0 failed. tests/test_docs_*.py: 33 run, 33 passed.

Negative control: with all of tools/ restored to upstream/main the new test file runs 5 tests with 12 failures and 2 errors.

Docs: every tool named in the new docs/testing.md paragraph exists in tools/, and sdwa_diff, mad_denorm_probe and image_fuzz (named there but not changed here) already contain an exit 77 path. I have no GFX12 card, so the gfx1200 / RX 9060 XT measurements in the text are not checked by me; the test uses a fake oracle that reports gfx1200.

@nullmarsh

Copy link
Copy Markdown
Author

Thanks @memorypressure. That conflict is between #4152 and main, not this PR: this branch does not touch tests/semantic/test_loop_ballot_barrier.py, and #4152 conflicts there against main 561b65a8 on its own (git merge-tree origin/main pr-4152). Merging this PR first or second changes nothing for that file.

On CI: this is a fork PR from a first-time contributor, so its runs wait for a maintainer to approve them; a push will not start them.

AI-assisted (Claude Code).

nullmarsh and others added 2 commits November 23, 2026 10:30
Every fmisc_diff hardware kernel runs under HW_MODE (IEEE and DX10_CLAMP), which
gfx1170+ fixes, so on an RX 9060 XT (gfx1200) `--oracle hw` skipped all of its
programs and exited 2 ("no program ran"). It now prints "hardware oracle
unavailable: MODE dx10_clamp, ieee cannot be set on gfx1200 ..." and exits 77,
through asm.modes_skip_reason like f32_fuzz and pknorm_probe. docs/testing.md
had listed it among the tools that run on RDNA4; it moves to the fixed-MODE
list. The GFX12 test now covers it (fails without the gate; still runs its
kernels on gfx1030 and gfx1150).

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

Copy link
Copy Markdown
Author

Added 05bc3d83 (on a merge of main 1cc6e3c1): fmisc_diff.py gets the same GFX12 gate. Every one of its hardware kernels runs under HW_MODE (IEEE and DX10_CLAMP), so on gfx1200 --oracle hw skipped all its programs and exited 2. bunbeans2-arch saw the same on gfx1201 in #5931. I had wrongly listed it under "Run" in docs/testing.md; it moves to the fixed-MODE list.

Tested on RX 9060 XT (gfx1200, AMD 26.11.2), Windows 11:

  • fmisc_diff.py --oracle hw: exit 77, hardware oracle unavailable: MODE dx10_clamp, ieee cannot be set on gfx1200 .... The translator-only run is unchanged (exit 0).
  • tests/test_hw_oracle_gfx12_unavailable.py: 5 OK; with the gate removed, the fmisc_diff subtest fails. tests/test_fmisc_diff.py: 25 OK.

AI-assisted (Claude Code), no game files.

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.

4 participants