[PR #810] [MERGED] tests: the three frexp_f64 oracle files check the translator, and pin where their oracle models IEEE=1 (TEST-FREXP-ORACLES-TRANSLATE) #848

Closed
opened 2026-11-26 20:19:15 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/810
Author: @qhukz13
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: cont/frexp-oracles-translate


📝 Commits (3)

  • ee4dfb0 tests: the f64 rcp/rsq/sqrt/cvt oracle files check the translator, and spirv_interp divides doubles as doubles (TEST-F64-ORACLES-TRANSLATE)
  • 13cb507 tests: drop the 27 DEBT entries of test_semantic_translator_use that no longer exempt anything (TEST-GUARD-STALE-DEBT)
  • 80328dc tests: the three frexp_f64 oracle files check the translator, and pin where their oracle models IEEE=1 (TEST-FREXP-ORACLES-TRANSLATE)

📊 Changes

10 files changed (+359 additions, -35 deletions)

View changed files

➕ tests/semantic/f64_translate.py (+43 -0)
📝 tests/semantic/test_valu_cvt_f32_f64.py (+33 -0)
📝 tests/semantic/test_valu_frexp_exp_i32_f64.py (+42 -0)
📝 tests/semantic/test_valu_frexp_f64.py (+67 -0)
📝 tests/semantic/test_valu_frexp_mant_f64.py (+61 -0)
📝 tests/semantic/test_valu_rcp_f64.py (+34 -0)
📝 tests/semantic/test_valu_rsq_f64.py (+34 -0)
📝 tests/semantic/test_valu_sqrt_f64.py (+35 -0)
📝 tests/spirv_interp.py (+10 -1)
📝 tests/test_semantic_translator_use.py (+0 -34)

📄 Description

Claimed in the coordination issue as: TEST-FREXP-ORACLES-TRANSLATE

Depends on: #746 (the f64_translate.py helper and the spirv_interp binary64 fixes), #764 (neighbouring DEBT entries). This branch is on top of both, so their commits show here until they are merged.

What and why

tests/semantic/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 that runs the translated v_frexp_mant_f64 / v_frexp_exp_i32_f64 (f64_translate.py, spirv_interp) and checks it against the file's own oracle: normals, subnormals, zeros, infinities and quiet NaNs, both signs, abs/neg and clamp.

Comparing the two over 402 inputs, they disagree in two places, and in both docs/design.md sides with the translator. The v_frexp_mant_f64 row records gfx1036 measurements in the game's MODE (IEEE 0, denorm_mode_16_64 3):

  • a signalling NaN passes through unchanged; the oracles quiet it (0x7FF0000000000001 -> 0x7FF8000000000001), which is the IEEE=1 behaviour;
  • mul:2 / mul:4 / div:2 are ignored; the oracles scale the mantissa, which is the denorm_mode_16_64=0 behaviour.

The new classes pin those two measured behaviours instead of the oracle, and each file's module docstring now says that its oracle's sNaN/omod rules model IEEE=1. The oracles' own tests are not changed; aligning them with the game's MODE is left to their authors. The three DEBT entries are dropped.

Tested

  • The three files: OK as python -I scripts (the new classes run 5, 4 and 2 tests).
  • python -I tests/test_semantic_translator_use.py: OK without the three entries.
  • tools/semantic_mutants.py --op v_frexp_mant_f64 (the shared mant/exp branch): 92 of 134 mutants 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). Before, none of the three reached the translator.
  • compileall, tests/test_text_write_line_endings.py, scripts/check_no_game_data.py: OK.

tests/semantic/test_alu_frexp_f64.py already checks this translation against gfx1036 words; these classes add the oracle files' input classes to it.

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

AI-assisted (Claude Code).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/810 **Author:** [@qhukz13](https://github.com/qhukz13) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `cont/frexp-oracles-translate` --- ### 📝 Commits (3) - [`ee4dfb0`](https://github.com/ubiquitarianism/leonida/commit/ee4dfb04c7de6a6a8858b0d8ef9b43f8c9c3b91e) tests: the f64 rcp/rsq/sqrt/cvt oracle files check the translator, and spirv_interp divides doubles as doubles (TEST-F64-ORACLES-TRANSLATE) - [`13cb507`](https://github.com/ubiquitarianism/leonida/commit/13cb507629d53f5a80a938cb0c1731008ba2eff3) tests: drop the 27 DEBT entries of test_semantic_translator_use that no longer exempt anything (TEST-GUARD-STALE-DEBT) - [`80328dc`](https://github.com/ubiquitarianism/leonida/commit/80328dca772680c61650d7c3aa265eac7c6a3a92) tests: the three frexp_f64 oracle files check the translator, and pin where their oracle models IEEE=1 (TEST-FREXP-ORACLES-TRANSLATE) ### 📊 Changes **10 files changed** (+359 additions, -35 deletions) <details> <summary>View changed files</summary> ➕ `tests/semantic/f64_translate.py` (+43 -0) 📝 `tests/semantic/test_valu_cvt_f32_f64.py` (+33 -0) 📝 `tests/semantic/test_valu_frexp_exp_i32_f64.py` (+42 -0) 📝 `tests/semantic/test_valu_frexp_f64.py` (+67 -0) 📝 `tests/semantic/test_valu_frexp_mant_f64.py` (+61 -0) 📝 `tests/semantic/test_valu_rcp_f64.py` (+34 -0) 📝 `tests/semantic/test_valu_rsq_f64.py` (+34 -0) 📝 `tests/semantic/test_valu_sqrt_f64.py` (+35 -0) 📝 `tests/spirv_interp.py` (+10 -1) 📝 `tests/test_semantic_translator_use.py` (+0 -34) </details> ### 📄 Description Claimed in the coordination issue as: TEST-FREXP-ORACLES-TRANSLATE Depends on: #746 (the `f64_translate.py` helper and the `spirv_interp` binary64 fixes), #764 (neighbouring DEBT entries). This branch is on top of both, so their commits show here until they are merged. ### What and why `tests/semantic/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 that runs the translated `v_frexp_mant_f64` / `v_frexp_exp_i32_f64` (`f64_translate.py`, `spirv_interp`) and checks it against the file's own oracle: normals, subnormals, zeros, infinities and quiet NaNs, both signs, `abs`/`neg` and `clamp`. Comparing the two over 402 inputs, they disagree in two places, and in both `docs/design.md` sides with the translator. The `v_frexp_mant_f64` row records gfx1036 measurements in the game's MODE (IEEE 0, denorm_mode_16_64 3): - a signalling NaN passes through unchanged; the oracles quiet it (`0x7FF0000000000001` -> `0x7FF8000000000001`), which is the IEEE=1 behaviour; - `mul:2` / `mul:4` / `div:2` are ignored; the oracles scale the mantissa, which is the denorm_mode_16_64=0 behaviour. The new classes pin those two measured behaviours instead of the oracle, and each file's module docstring now says that its oracle's sNaN/omod rules model IEEE=1. The oracles' own tests are not changed; aligning them with the game's MODE is left to their authors. The three DEBT entries are dropped. ### Tested - The three files: OK as `python -I` scripts (the new classes run 5, 4 and 2 tests). - `python -I tests/test_semantic_translator_use.py`: OK without the three entries. - `tools/semantic_mutants.py --op v_frexp_mant_f64` (the shared mant/exp branch): 92 of 134 mutants 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). Before, none of the three reached the translator. - `compileall`, `tests/test_text_write_line_endings.py`, `scripts/check_no_game_data.py`: OK. `tests/semantic/test_alu_frexp_f64.py` already checks this translation against gfx1036 words; these classes add the oracle files' input classes to it. Linux, CPU only; no GPU, no game files. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:15 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#848
No description provided.