mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[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
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#848
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
ee4dfb0tests: the f64 rcp/rsq/sqrt/cvt oracle files check the translator, and spirv_interp divides doubles as doubles (TEST-F64-ORACLES-TRANSLATE)13cb507tests: drop the 27 DEBT entries of test_semantic_translator_use that no longer exempt anything (TEST-GUARD-STALE-DEBT)80328dctests: 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.pyhelper and thespirv_interpbinary64 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.pyandtest_valu_frexp_exp_i32_f64.pywere DEBT private oracles that never ran the translator. Each gets aTranslatorMatchesOracleclass that runs the translatedv_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/negandclamp.Comparing the two over 402 inputs, they disagree in two places, and in both
docs/design.mdsides with the translator. Thev_frexp_mant_f64row records gfx1036 measurements in the game's MODE (IEEE 0, denorm_mode_16_64 3):0x7FF0000000000001->0x7FF8000000000001), which is the IEEE=1 behaviour;mul:2/mul:4/div:2are 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
python -Iscripts (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 withtest_valu_frexp_f64.py, 77 withtest_valu_frexp_mant_f64.py, 42 withtest_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.pyalready 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.