test_valu_frexp_f64.py, test_valu_frexp_mant_f64.py and test_valu_frexp_exp_i32_f64.py were DEBT private oracles that
never ran the translator. Each gets a TranslatorMatchesOracle class (tests/semantic/f64_translate.py, run in
tests/spirv_interp.py) that checks the translated v_frexp_mant_f64 / v_frexp_exp_i32_f64 against the file's own
oracle on normals, subnormals, zeros, infinities and quiet NaNs, both signs, abs/neg and clamp.
On two points the oracles model IEEE=1 / denorm_mode_16_64=0, not the game's MODE: they quiet a signalling NaN and
scale the mantissa by mul:2 / mul:4 / div:2. The v_frexp_mant_f64 row of docs/design.md records that gfx1036 under
IEEE 0 and denorm_mode_16_64 3 passes a signalling NaN through and ignores those modifiers, and so does the translator;
the classes pin those two measured behaviours instead of the oracle, and each file's docstring says so. The oracles'
own tests are unchanged. The three DEBT entries are dropped.
semantic_mutants --op v_frexp_mant_f64 (the shared mant/exp branch): 92 of 134 caught with test_valu_frexp_f64.py,
77 with test_valu_frexp_mant_f64.py, 42 with test_valu_frexp_exp_i32_f64.py (exponent only); none of the three
reached the translator before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
By the guard's own _reaches, 26 of the DEBT files already run the translator (the eight saveexec files,
add_sub_co, alignbyte, perm, sad_u32, lerp_u8, mul_hi, dot4/dot8, cndmask_b64, int_to_float, and the f16
fract/pack/pk_*/rcp/rsq/sqrt files), and test_lds_add_sub_src2_u32.py no longer exists. Their entries kept those
files out of the check they now pass, so a file that stopped calling the translator would go unnoticed. DEBT keeps
the nine files that still model the answer themselves. The DEBT comment's design is unchanged: an entry still does
not have to be removed by the PR that fixes the file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_valu_{rcp,rsq,sqrt}_f64.py and test_valu_cvt_f32_f64.py were private oracles exempted in
test_semantic_translator_use.py: nothing in them ran the translator, so swapping the high and low word of the f64
source in rdna2spirv.py's shared f64() helper failed no test. Each now has a TranslatorMatchesOracle class that
translates the instruction (tests/semantic/f64_translate.py), runs it in tests/spirv_interp.py and checks the word
against the file's own oracle, on inputs whose SPIR-V result is defined (no NaN; no zero divisor for rcp, nothing
below zero for the roots, no binary32 subnormal or overflow for cvt): both signs, subnormals, infinities, neg/abs and
clamp. The four exemptions are dropped.
Doing that found that spirv_interp had no binary64 OpFDiv: the op fell through to the binary32 table, so the
translated v_rcp_f64 of 3.0 gave 0x3fd5555560000000 instead of 0x3fd5555555555555, and of 1e300 gave 0. OpFDiv joins
the F64 table (x / 0 as the binary32 one), and OpFConvert is added (binary64 -> binary32 rounds to nearest even).
semantic_mutants --op v_rcp_f64 (and rsq, sqrt, cvt_f32_f64): the line-8487 hi -> lo mutant of f64() now fails each
file (it survived all four before).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three files ran private models (the guard allowlisted them as hand-written SPIR-V). v_sad_hi_u32 and v_pack_b32_u16
are not valid on gfx1030 and v_lshl_add_u64 is not supported there (llvm-mc).
test_alu_dot2acc_f16.py no longer exists and test_ballot_votes.py
reaches the translator, both since f9de6c12 (TEST-603). While
test_ballot_votes.py stays in DEBT the guard skips it, so a model-only
overwrite of it would pass unnoticed; that has already happened to
test_alu_u16_clamp.py and test_int_to_float.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nWg6BssUf8MjNaKuMSkfc
docs/design.md (Integer clamp) cites tests/semantic/test_alu_u16_clamp.py
as the CPU check of the VOP3 clamp on v_add_nc_u16 / v_sub_nc_u16 and the
v_add/sub/subrev_u16 e64 names: saturate to [0, 0xFFFF] and keep the high
half of the destination. 523c32ed added it as a translator test together
with that translator change. fb9743a9, 1352258e and 91b2c31e then
overwrote it with Python min/max helpers that never call the translator
and name no instruction, so the rule had no test left: on main, with the
clamp select in rdna2spirv.py removed (results wrap) or with sub
saturating high, this file and the seven other test files that use these
ops all still pass.
Bring back 523c32ed's file unchanged (3/3 pass on main; both mutations
fail it) and drop it from DEBT in tests/test_semantic_translator_use.py.
Co-Authored-By: quackottu <224479491+quackottu@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nWg6BssUf8MjNaKuMSkfc
test_salu_bitfield_ins_u32.py imported translate_lines but never called
it. It modelled an s_bfi_b32 that neither tools/rdna2spirv.py nor
RDNA2's scalar ALU has, through a private ScalarAluInterpreter, so it
passed whatever the translator did; it was listed in DEBT in
tests/test_semantic_translator_use.py.
Keep its real subject, the sequence shaders use to insert a field
(s_bfm_b32, s_lshl_b32, s_and_b32, s_andn2_b32, s_or_b32): translate it
and execute it in spirv_mini_interp with run-time operands (an
offset/width/value grid and seeded random cases) and with s_mov_b32
immediates folded at translation time, plus the destination written
over base. Assert the result, SCC and the s_bfm_b32 mask against the
ISA pseudocode, and drop the file from DEBT.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nWg6BssUf8MjNaKuMSkfc
- shader_disasm: prune stale listings against every input, not the --skip-existing remainder (a resumed run
deleted every listing it had just reused).
- progress_dashboard: a drive-letter path is never inside the repository off Windows (it printed user names);
its own read_text helper is read_utf8, so the encoding check does not take it for pathlib's.
- Translator tests follow this round's rules: desc_lookup's BroadcastFirst in the typed-load condition walker;
resinfo sizes are 0 past the last level and a 2D depth word is 0 (SHADER-388); SHADER-315 constant folding in
the perm and i16 tests; #2089's structured wave64 emulation.
- test_semantic_translator_use: 57 oracle-only files merged before it are DEBT; test_spirv_tools_required is
allowed (CI meta-test).
- Test fixes: image_fuzz fake writes the programs, preflight follows c506d00c's loader hint rule, feature_scan
reads the first line of a pytest-decorated message, w64_graphics wording.
- docs: rows merged again in design.md, README.md, d3d12_vulkan.md; GameInput table rebuilt from #3172's rows;
orphan rows in models.md and embedded_shaders.md; repeated bullets; anchors; a flag not on main.
- Repo rules: stdout guard on 14 programs; LF writes; csv lineterminator in bink_play.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/semantic is the translator regression suite, but a file there can reimplement the instruction in Python and pass whatever the translator does. Add an ast-based guard: direct import, a helper that reaches the translator, or a subprocess naming rdna2spirv.py. The interpreter self-tests, the hand-written-SPIR-V files and the three pre-existing offenders are listed with a reason, and a second test rejects stale entries.