Repository navigation
Tools: hardware oracle for crosslane_fuzz — 24,000 cross-lane programs on real AMD hardware, wave32 and native wave64, 0 mismatches - #1202
Conversation
…st bit 31 tools/hw_oracle wraps the generated scalar programs in GFX10/GFX11 kernels, assembles them with AMD clang and runs them through the HIP runtime of the AMD Windows driver (hw_oracle.c, loaded with LoadLibrary, no SDK). salu_diff compares the hardware's three SGPRs + SCC with the reference, alone or together with the translator. A missing tool prints "unavailable" and exits 77. First finding: s_bfe_i32 with offset + width > 32 stops the field at bit 31 on gfx1150 (width = min(width, 32 - offset)); the reference followed the pseudocode literally. The translator already did the hardware thing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rness errors) - LEONIDA_HIP_DLL is now passed to the launcher and loaded - an all-rejected chunk is a RuntimeError (harness error), not skips - -1 and 0xffffffff count as one literal; clang is no longer found by globbing */.venv under the cwd (env, PATH, HIP_PATH, ROCM_PATH, repo .venv) - s_bfe past bit 31: say "analogous to LLVM's v_bfe fold", rule rests on the gfx1150 measurement; contract row in docs/design.md; Linux/ROCm note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runs each FUZZ-7 program natively on the AMD GPU in wave32 and native wave64, with its real group size and EXEC setup, every thread storing its 14 words, and compares them with the model. hw_oracle gains raw kernels (own stores), per-kernel workgroup size and wave64 code objects; the launcher takes name:threads:words tokens. 24,000 programs on gfx1150: 0 mismatches; the permlane FI=0 and DPP8 inactive-source hypotheses hold on the hardware too. Translator mismatches all trace to masks read as data (ItsNotRexed#293) and permlane (ItsNotRexed#580). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eep writes the kernel that ran - run_hw: a failing hypothesis op counts as a mismatch (exit 1) and in hyp_only; --minimize marks the hypothesis ops that remain - Oracle startup probe: a wave64 kernel must see lane 32 as 32, a wave32 kernel as lane 0 of the second wave - test_on_hardware also asserts rejected == 0, no mismatches, no hyp_only - --keep / --minimize write hw_lines() for hardware failures - docs: where the permlane FI=0 (ItsNotRexed#374, ItsNotRexed#580) and DPP8 (ItsNotRexed#238) hypotheses come from, and the re-run table (24,000 programs, hyp_only 0) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 5636ae8 on an AMD Radeon RX 9070 (RDNA4, gfx1201), AMD 26.11.2, Windows 11 Pro 26300, As in #1160 (comment there), gfx1201 still stops with a traceback: With a local, uncommitted 2-line change ( 8,000 programs, 0 mismatches, 0 rejected. The table uses
So the permlane16/x16 FI=0 and DPP hypotheses hold on gfx1201 as well: With the mapping, I'll claim the gfx12 support as a follow-up in #1006 and open it after this PR lands, since both touch AI-assisted (Claude Code). |
|
Tested Numbers (this commit, 8 threads):
Port attempt, local only, not part of this PR: with a ~40-line POSIX launcher the device is detected as Method: build as in the FUZZ-7 section, run the stock GPU suite for a green baseline, run crosslane_fuzz with the translator oracle and diff its summary against No hardware risk from the diff itself (docs, tests and |
Builds on the hardware oracle from #1160, which has landed.
What and why
tools/crosslane_fuzz.py(FUZZ-7) can now run its generated cross-lane programs natively on an AMD GPU and compare the hardware against the model. Until now that model of wave and cross-lane behaviour had only been checked against the translator, never against hardware.--oracle hwcompares the hardware against the model;--oracle translator,hwruns both comparisons.tools/hw_oracleadditions: raw kernels, a workgroup size per kernel, and wave64 code objects (-mwavefrontsize64,.amdhsa_wavefront_size32 0, wavefront size in the HSA metadata).v_mbcntprobe checks that wave64 really runs 64-wide, so a runtime that ignored the metadata fails loudly.s_nop 7, because the model has no hazards;--no-hw-guardturns it off.--keep/--minimizewrite the kernel that actually ran.Results: Radeon 880M (gfx1150, RDNA3.5), driver 26.11.2
24,000 programs, 0 mismatches. 2000 programs per wave size in each run:
--dpp--dpp --ops 40--ops 12--dpp --no-hw-guard--no-maskdata --dpp --ops 60fi=0: it reads 0. This comes from GPU tests: cover non-mov DPP with bound_ctrl #238 and had not been measured before.v_readlane, and--permlane-fetch-inactive. So the wrapper does not hide differences.s_nopguard: results are identical, so the generator hits no hazard on this GPU.Translator against the model (
translator,hw, 200 programs, seed 7): the hardware matches the model in every program.--no-maskdatathere are 0.GFX11 differences checked: none of the generated ops needed a skip.
row_share,row_xmask,dpp8,fi,bound_ctrlandv_permlane16/x16are spelled the same on gfx1030 and gfx1150.v_cmpxis generated only as_e32, which writes EXEC only.s_ff1is an alias ofs_ctzon gfx11.The limit is the same as in #1160: gfx1150 is RDNA3.5, not RDNA2. Agreement here is strong evidence for the model, not proof for gfx1013.
Tested
py -I tests/test_crosslane_fuzz.py,tests/test_hw_oracle.py,tests/test_salu_diff.py: green. Without hardware the hardware test is skipped. With hardware it also assertsrejected == 0andhyp_only == 0.--oracle hwruns above, on a Radeon 880M with AMD clang 23.0.0git.An independent review checked that the hardware wrapper matches the model: initial registers, EXEC for partial waves and groups of several waves, lane ids, store layout and branch labels. It reran the controls and confirmed by hand that wave64 really runs 64-wide. Its findings are fixed:
hyp_only;--keepwrites the kernel that ran;AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (No translator change; the model is confirmed on hardware.)🤖 Generated with Claude Code