Commit Graph

14 Commits

Author SHA1 Message Date
edec4db60e Merge pull request #1332 from fin-github/takeover/old-9928-wint-diff-gfx12
wint_diff: GFX12 has no always-true/false VALU compare; skip those programs by name (OLD-9928)
2026-11-28 15:30:40 +01:00
395bbc12a1 wint_diff: model v_mbcnt/v_writelane operands and validate masks, pairs, op_sel, and arity (WINT-DIFF-REF-VALIDATION) 2026-11-25 21:09:54 +05:30
ddd1923cb2 wint_diff: GFX12 has no always-true/false VALU compare; skip those programs by name
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)
2026-11-24 16:57:31 -05:00
6dece92317 Merge TreXito's unmerged PRs: translator fixes, fuzzers, CPU emulation, xapu/chad shims
Merged from the TreXito/mangrove copy of the original repository, which carried
contributor pull requests that were never merged here.

Kept: rdna2spirv fixes (ds_append/ds_consume, v_ldexp_f16 under MODE.FP_ROUND,
thread-group SGPR, fma exact), the differential fuzzers (dot, vint, wint, vrel, cvt,
f16misc, salu, mode) with their tests, the exe/import fail-fast and int3 cause tools,
Zen 2 instruction emulation (cpu_emulation.h) and the xapu.dll/chad.dll shims.

Not taken, because they conflict with different implementations already on main:
the D3D12 Xbox-ABI layer, xmem, acphal, loader TLS, f64_diff, DirectStorage (needs the
typed-error zlib inflate), and the copy's own MANGROVE.md and README changes.
2026-11-23 19:42:33 -05:00
124f120a7b Merge remote-tracking branch 'origin/pr/9729' 2026-11-23 17:24:44 -05:00
6dd206df9e wint_diff: reject truncated, short, or None hardware oracle results 2026-11-23 23:58:48 +02:00
f447410b49 Merge #5012 (fuzz/wint-clamp) 2026-11-23 21:45:02 +00:00
717e8a8db2 wint_diff: validate non-empty op selection in Gen.__init__ 2026-11-23 16:38:56 -05:00
6de3970e15 vk_fuzz_run: exit 2 when every --oracle hw,vk comparison skips (#6820)
Squash-merged after diff review of PR #6820 - vk_fuzz_run: exit 2 when every --oracle hw,vk comparison skips
2026-11-23 09:47:05 -06:00
a284bad1e9 pk16_diff, vint_diff, sdwa_diff, wint_diff: --oracle hw,vk runs the translated programs on a Vulkan GPU (#6306)
Squash-merged after diff review of PR #6306 - pk16_diff, vint_diff, sdwa_diff, wint_diff: --oracle hw,vk runs the translated programs on a Vulkan GPU
2026-11-23 08:25:41 -06:00
4105ca1ff0 wint_diff: check clamp and op_sel before step's early returns
`s_mov_b32 exec_lo, 1 clamp` set EXEC to 1: s_mov_b32, v_mbcnt and
v_writelane return before the modifier check. Both checks now come
first, so those forms raise RefError and leave the state unchanged.
op_sel outside the 16-bit ops was ignored the same way; it is now
rejected too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 08:23:39 +00:00
b491c51c5e tools/wint_diff.py: generate clamp on the carry-out ops
The e64 forms of v_add/sub/subrev_co_u32 and v_add/sub/subrev_co_ci_u32
now get clamp on about a third of their lines. The reference saturates D
(0xffffffff on an add's carry, 0 on a sub's borrow) and still writes the
real carry or borrow to the mask, as measured on gfx1035 and gfx1036 in
the docs/design.md "Integer clamp" row. clamp on any other line is a
RefError.

One source of an e64 _co_ci_ line is now -1 one time in five: then the
carry (borrow) in alone decides the carry (borrow) out, the edge an
overflow test written as "result < source" misses. In the e64 form both
constant-bus slots hold masks, so before this only the inline constant
-1 (one value in 81) or a stray all-ones lane reached it.

Four new tests; a paragraph in docs/shader_validation.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 07:34:04 +00:00
e3d461cb99 wint_diff: exit 2 when every program was skipped, not 0 2026-11-23 02:04:33 +01:00
bbf009fda0 tools: wint_diff.py, a whole-wave differential fuzzer for integer VALU under random EXEC
Seeded integer VALU programs run on every lane of a wave32 or wave64 wave with EXEC rewritten between instructions: compares into SGPR masks and VCC, v_cmpx, v_cndmask on the masks, carry-out/carry-in forms, v_mad_u64/i64 with a mask carry-out, 16-bit op_sel half writes and 32-bit ops. A per-lane ISA model is compared with rdna2spirv run in tests/semantic/spirv_wave_interp.py, optionally with the hardware through tools/hw_oracle. Known divergences (VCC data read as a mask, #2206; a mask read as data, #293) only with --known.

AI-assisted.
2026-11-22 17:42:08 +01:00