upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/code_hooks_test.cpp
diff options
context:
space:
mode:
authorqhukz13 <v.onashchuk@gmail.com>2026-11-24 15:22:31 +0200
committerqhukz13 <v.onashchuk@gmail.com>2026-11-24 15:22:31 +0200
commitee4dfb04c7de6a6a8858b0d8ef9b43f8c9c3b91e (patch)
treea11a7addb49aad2cc95772d0df5ed26aa4b26046 /runtime/test/code_hooks_test.cpp
parent2d73c242fddfe26d57b52ee150704e6c3b23cff4 (diff)
tests: the f64 rcp/rsq/sqrt/cvt oracle files check the translator, and spirv_interp divides doubles as doubles (TEST-F64-ORACLES-TRANSLATE)
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>
Diffstat (limited to 'runtime/test/code_hooks_test.cpp')
0 files changed, 0 insertions, 0 deletions