Commit Graph

14 Commits

Author SHA1 Message Date
27a7a0c633 cf_diff: the scalar 'not equal' condition is s_cmp_lg, not s_cmp_ne
CCS serves both v_cmp (VOPC, where v_cmp_ne_* exists) and the sif shape's
s_cmp, but SOPC has no 'ne' encoding: rdna2spirv correctly refuses
s_cmp_ne_u32 (tests/semantic/test_sopc_validation.py lists it as a
nonexistent mnemonic). One of the six seeded programs then came back as
'translator unsupported: s_cmp_ne_u32' and test_small_fixed_seed_run_is_clean[structured-32]
failed with pass 5 != 6 (dispatch-loop-32 likewise). Map 'ne' to the
real encoding 'lg' at the scalar emission site only; the vector compares
keep v_cmp_ne_*.

(cherry picked from commit 9ccfea42211aa7268ddd5a91ff2b9f0eb20adb1a)
2026-11-24 03:29:35 +02:00
6cdb668e8a f32_fuzz, cf_diff: import the translator where it is used (EGEN-FUZZ-LAZY-IMPORT)
Both tools set sys.dont_write_bytecode and imported rdna2spirv at the
top, so on a checkout without __pycache__ every start compiled the
translator before parsing the arguments: about 20 s to print a usage
line, which made test_no_arguments_prints_usage time out (5 s) in
tests/test_f32_fuzz.py and tests/test_cf_diff.py. They now import it in
the functions that use it.

Also removes the second, identical CliTests class in
tests/test_f32_fuzz.py, which replaced the first one at import.

Supersedes #5056, which conflicts with main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 00:04:40 +02:00
496da20477 Require a program when showing a control-flow listing (#6659)
Squash-merged after diff review of PR #6659
2026-11-23 11:03:56 -06:00
76cf23f5c3 Merge pull request #4448 from tedin7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:14:49 -05:00
50fe243d3e fix: cf_diff --program exits 2 when the program was skipped, like the suite (review) 2026-11-23 02:51:23 +01:00
6caeae4ac6 cf_diff, mem_diff, shader_diff, fmisc_diff: exit 2 when every program was skipped 2026-11-23 02:29:16 +01:00
c420ad28d6 Merge pull request #3629 from Kam471 2026-11-22 17:03:05 -05:00
e37e6e136f cf_diff/f32_fuzz: print usage and exit 2 with no arguments 2026-11-22 21:06:33 +00:00
02b331e254 Merge pull request #3055 from Marco Luzzaro 2026-11-22 15:14:24 -05:00
649e90481f cf_diff: reject an empty program batch 2026-11-22 20:14:15 +01:00
b624eff02c tools: add saveexec logic variants to cf_diff 2026-11-22 22:09:04 +03:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.

AI-assisted (Claude), on behalf of dev-ewann.
2026-11-22 14:20:30 +00:00
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").

tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:27:00 +00:00
71a16c11cf FUZZ-8: control-flow/EXEC differential fuzzer; wave32 SCC of mask ops is wave-wide
tools/cf_diff.py generates seeded wave32/wave64 pixel shaders from the
control-flow shapes compilers emit (saveexec if/else, v_cmpx, VCC- and
SCC-voted branches, uniform and per-lane loops, two-entry cycles) and
compares every lane's export between:
  * tools/cf_ref.py: cpu_ref's Machine plus branches, compares, v_cmpx,
    saveexec and 64-bit masks (the ISA model, one wave)
  * rdna2spirv + tests/semantic/spirv_wave_interp.py: every invocation of
    one subgroup in lockstep, split at selections and rejoined at merges,
    with the subgroup operations the translator emits
in both the structured and the dispatch-loop form; --spirv-val also
validates each module, --minimize reduces a mismatch.

Finding (fixed here): in a wave32 program s_and/or/xor/andn2/orn2/nand/
nor/xnor_b32 on lane masks set SCC from the lane's own bit instead of the
whole mask, so `s_and_b32 s0, vcc_lo, exec_lo; s_cbranch_scc0` and loops
closed by `s_andn2_b32 exec_lo, ...; s_cbranch_scc1` split the wave. SCC
is now the same subgroup vote as for the _b64 forms. GPU test
ps_scc_mask32 (not run on a GPU yet).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:02:16 +00:00