Commit Graph

11 Commits

Author SHA1 Message Date
71cd652671 Merge pull request #797 from trigger337/fix/mode-round-probe-stage-cleanup
mode_round_probe: publish mode on Windows (MODE-ROUND-PROBE-STAGE-CLEANUP)
2026-11-28 12:07:48 +01:00
a94cb3b8cd mode_round_probe: publish mode on Windows (MODE-ROUND-PROBE-STAGE-CLEANUP)
agent: yes
AI-assisted: yes
2026-11-24 16:56:59 +03:00
87aceb8422 tools: close hardware oracle in mode_round_probe (PROBE-MODEROUND-ORACLE-CLOSE)
Claimed in the coordination issue as: PROBE-MODEROUND-ORACLE-CLOSE (#14)

Wrap hardware oracle execution in tools/mode_round_probe.py in a
try/finally block so oracle.close() is called on normal completion,
non-GFX10 exit (code 77), report write errors, and probe exceptions.

Add unit tests in tests/test_mode_round_probe.py verifying oracle closure
on normal success, non-GFX10 skip, and probe exceptions.

AI-assisted: yes
agent: yes
2026-11-24 12:19:37 +03: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
5f280c6268 mode_round_probe: stage --json report via sibling temp file 2026-11-24 05:36:14 +08:00
4a92a119d6 Merge origin/main into fix/ldexp-f16-mode-rtz
Conflict in docs/design.md: kept main's wording for the three rows and re-added the v_ldexp_f16 sentence to the MODE.FP_ROUND row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:09:44 +00:00
64ed15f255 rdna2spirv: v_ldexp_f16 follows a MODE.FP_ROUND toward-zero write
After s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2), 3 every VALU f16 result
except the transcendentals rounds toward zero (docs/design.md), but the
v_ldexp_f16 branch never read %mode_r16: an overflow still gave +-inf
(0x7c00 for 0x7bff * 2, want 0x7bff) and a denormal result still rounded
to nearest even (0x3c03 * 2^-15 gave 0x0202, want 0x0201).

When the program writes the field, overflow now gives +-65504 and the
denormal rounding increment is dropped while the mode is 3. Programs that
never write MODE emit the same code as before.

tests/semantic/test_ldexp_f16_mode_round.py: edge cases, a seeded sweep
against an exact rational reference in both modes, and a check that every
f16 case of tools/mode_round_probe.py is the translator's word. The probe
gets two ldexp cases so an RDNA2 GPU can confirm the toward-zero words,
which are not measured on hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:23:25 +00:00
9f72b1faab buffer_store_probe, mode_round_probe: print the measured norm and transcendental counts
The per-wave summary line said 'norm exact across 5 formats + snorm2 ties' and
'7/7 f16 transcendentals 0/65536 RNE/RTZ diffs' whatever the hardware returned.
Count the exact UNORM/SNORM sweeps, the SNORM2 ties and the transcendentals from
the results, and print one line per failing sweep or op. Tests drive main() with
a fake oracle that answers from the probes' own tables and models.
2026-11-23 03:37:20 +00:00
a43e5333b1 fix(tools): validate --waves and --json up front in mode_round_probe 2026-11-22 20:30:27 +02:00
1457585979 mode_round_probe: set newline='\n' on JSON output 2026-11-22 17:19:36 +01:00
9a6add98e8 hw_oracle: native RDNA2 measurement of MODE.FP_ROUND f16/f64 (SHADER-132) 2026-11-22 17:16:34 +01:00