Commit Graph

9 Commits

Author SHA1 Message Date
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
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