tests: drop the 27 DEBT entries of test_semantic_translator_use that no longer exempt anything (TEST-GUARD-STALE-DEBT) #764

Manually merged
github merged 2 commits from gh-pr/764/head into gh-pr/764/base 2026-11-26 09:20:14 +00:00
Owner

@⁠qhukz13 on GitHub · 2026-11-24 13:34 UTC · original
qhukz13:cont/guard-stale-debt → main · +189 −32 · 7 files · 2 commits · merged 2026-11-24 16:06 UTC

Claimed in the coordination issue as: TEST-GUARD-STALE-DEBT (narrowed in a follow-up comment: no new check, cleanup only)

Depends on: #746 (it removes four neighbouring DEBT entries; this branch is on top of it, so its commit shows here until #746 is merged)

What and why

tests/test_semantic_translator_use.py exempts the files in DEBT from its check that every tests/semantic test reaches rdna2spirv. By the guard's own _reaches, 26 of those 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. test_lds_add_sub_src2_u32.py no longer exists. Their entries kept those files out of the check they now pass, so if one stopped calling the translator nothing would notice.

This removes the 27 entries. DEBT keeps the nine files that still model the answer themselves (div_fixup, fma_f64, fract_f64, the three frexp files, minmax_f64, mul_f64, trig_f64).

Not changed: the design in the comment above DEBT. An entry still does not have to be removed by the PR that fixes the file, and there is no new staleness check, so fixing a file never conflicts with another PR here.

Tested

  • python -I tests/test_semantic_translator_use.py: OK with the 27 entries gone (each of the 26 files passes the check on its own; the 27th file does not exist).
  • tests/test_text_write_line_endings.py, scripts/check_no_game_data.py: OK.

Linux, CPU only; no GPU, no game files.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠qhukz13** on GitHub · 2026-11-24 13:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/764) `qhukz13:cont/guard-stale-debt` → `main` · +189 −32 · 7 files · 2 commits · merged 2026-11-24 16:06 UTC Claimed in the coordination issue as: TEST-GUARD-STALE-DEBT (narrowed in a follow-up comment: no new check, cleanup only) Depends on: #746 (it removes four neighbouring DEBT entries; this branch is on top of it, so its commit shows here until #746 is merged) ### What and why `tests/test_semantic_translator_use.py` exempts the files in `DEBT` from its check that every `tests/semantic` test reaches `rdna2spirv`. By the guard's own `_reaches`, 26 of those 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. `test_lds_add_sub_src2_u32.py` no longer exists. Their entries kept those files out of the check they now pass, so if one stopped calling the translator nothing would notice. This removes the 27 entries. `DEBT` keeps the nine files that still model the answer themselves (`div_fixup`, `fma_f64`, `fract_f64`, the three `frexp` files, `minmax_f64`, `mul_f64`, `trig_f64`). Not changed: the design in the comment above `DEBT`. An entry still does not have to be removed by the PR that fixes the file, and there is no new staleness check, so fixing a file never conflicts with another PR here. ### Tested - `python -I tests/test_semantic_translator_use.py`: OK with the 27 entries gone (each of the 26 files passes the check on its own; the 27th file does not exist). - `tests/test_text_write_line_endings.py`, `scripts/check_no_game_data.py`: OK. Linux, CPU only; no GPU, no game files. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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 <[email protected]>
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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:20:13 +00:00
github manually merged commit 13cb507629 into gh-pr/764/base 2026-11-26 09:20:14 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.