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.
`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>
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>
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.