code wiki / (root) / nx_f64_oracle_sov.nx

nx_f64_oracle_sov.nx

buildroot/runtime/nx_f64_oracle_sov.nx

12591 B373 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic f64
docsdependenciesstructsconstsfunctions

about

nx_f64_oracle_sov.nx -- SOVEREIGN f64 oracle: pure-Nishi independent recompute of IEEE 754 binary64 add/sub/mul/div/sqrt expected values (operator law: no py, no sh -- the Python vector generator becomes a retired debt for ME0). INDEPENDENCE: this is a structurally different path from nx_f64. The impl rounds through per-op guard/sticky shortcuts (sticky-jam GRS); the oracle carries the EXACT result in a two-word 120-bit significand (hi:lo, 60 bits per word) plus a sticky flag, finds the true msb, and rounds from the full value. Anchor proof: _f64_soak_gate_authored phase 1 reproduces ALL 1217 hardware-IEEE-anchored KAT expected values; phase 2 soaks random vectors impl-vs-oracle (sovereign xorshift PRNG). Word convention: value = (hi*2^60 + lo) * 2^(e112 - 1135); a normal 53-bit significand sig placed at hi=sig, lo=0 has its msb at bit 112 and biased exponent e112. orc_pack derives eo = e112 + (msb - 112), denormalizes below eo=1 into sticky, rounds to nearest even from the exact tail. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_tier.nx nx_f64_oracle_sov.nx _f64_soak_gate_authored.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: _f64_soak_gate_authored.nx

structs

none

consts

22const ORC_MAGIC_2047: i64 = 2047
23const ORC_MAGIC_1075: i64 = 1075
24const ORC_MAGIC_1107: i64 = 1107
26const ORC_M60: i64 = 0x0FFFFFFFFFFFFFFF // 2^60 - 1
27const ORC_NAN: i64 = 0x7FF8000000000000
28const ORC_INF: i64 = 0x7FF0000000000000
29const ORC_IMP: i64 = 0x0010000000000000 // 1 << 52
30const ORC_M52: i64 = 0x000FFFFFFFFFFFFF

functions

32func orc_sign(raw: i64) -> i64 { return (raw >> 63) & 1 }
33func orc_ef(raw: i64) -> i64 { return (raw >> 52) & 0x7FF }
called by 2: orc_clsorc_sig_norm
34func orc_mf(raw: i64) -> i64 { return raw & ORC_M52 }
called by 2: orc_clsorc_sig_norm
37func orc_cls(raw: i64) -> i64
47func orc_sig_norm(raw: i64, eout: *i64) -> i64
61func orc_bit(hi: i64, lo: i64, i: i64) -> i64
called by 1: orc_pack
67func orc_below(hi: i64, lo: i64, i: i64) -> i64
called by 1: orc_pack
81func orc_extract53(hi: i64, lo: i64, s: i64) -> i64
called by 1: orc_pack
93func orc_pack(sign: i64, e112: i64, hi: i64, lo: i64, sticky_in: i64) -> i64
154func orc_add(a: i64, b: i64) -> i64
245func orc_sub(a: i64, b: i64) -> i64
called by 1: f6s_orc calls 1: orc_add
251func orc_mul(a: i64, b: i64) -> i64
300func orc_div(a: i64, b: i64) -> i64
337func orc_sqrt(a: i64) -> i64