code wiki / (root) / nx_mathcore_gate.nx

nx_mathcore_gate.nx

buildroot/runtime/nx_mathcore_gate.nx

14295 B259 linesdepth 5pulls 10 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_mathcore_gate.nx -- THE MATH CORE HAD NO GATE AT ALL (measured 2026-09-03). nx_catalog says it plainly: nx_bigint_gate, nx_rational_gate, nx_complex_gate and nx_derive_gate are ALL ABSENT -- no source, no binary, nothing promoted. So the estate's exact arithmetic (arbitrary-precision integers and exact rationals), which /compare/computational claims presence on in its very first rows and which the no-float determinism doctrine rests on, carried ZERO executable proof. That is why the board reads CLAIM-ONLY on the honesty census: it asserts coverage with no evidence a referee can run. EVERY TOOTH HERE IS AN ALGEBRAIC IDENTITY, WHICH IS ITS OWN ORACLE. A test that compares an implementation against a number a human typed proves only that the human agreed with the code. An identity -- a*(b+c) = a*b + a*c, (a+b)-b = a, 1/3 + 1/6 = 1/2 -- is true independently of any implementation, so a wrong add, a wrong carry or a wrong normalisation cannot satisfy it. The distributivity teeth are the load-bearing ones: they multiply and add the SAME operands two different ways and demand the same bytes. NON-VACUITY IS ASSERTED, NOT ASSUMED: the carry teeth assert the carry actually FIRED (a round-trip through a shift that never carried would pass while proving nothing), and both comparators are bite-proven -- each must REPORT a difference on values that differ and stay SILENT on values that are equal. A comparator that answers "equal" to everything would pass every identity above and is exactly what the bite catches. license_tier: ORIGINAL

dependencies 5 imports · 0 importers

nx_bigint_lib.nx nx_rational.nx nx_complex.nx nx_derive.nx nx_gate_verdict.nx nx_mathcore_gate.nx

imports: nx_bigint_lib.nxnx_rational.nxnx_complex.nxnx_derive.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ mg_new bi_zero bi_add gv_check gv_puts ↻ mg_put64 bi_zero ↻ bi_sub mg_eqn bi_cmp bi_mul bi_zero ↻ bi_shl1 bi_shr1 bi_to_bytes_be bi_from_bytes_be bi_zero ↻ bi_cmp ↻ rat_new sys_mmap ↻

structs

none

consts

27const MG_LIMB_SLOTS: i64 = 8 // scratch limbs per operand (well above the 2-4 the teeth use)
28const MG_SLOT_BYTES: i64 = 64 // MG_LIMB_SLOTS * 8
29const MG_BYTES_BE: i64 = 8 // 2 limbs = 8 big-endian bytes
30const MG_N1: i64 = 1
31const MG_N2: i64 = 2
32const MG_N4: i64 = 4
33const MG_N5: i64 = 5
34const MG_TOPBIT_LIMB: i64 = 0x80000000
35const MG_FULL_LIMB: i64 = 0xFFFFFFFF

functions

37func mg_new() -> *i64
called by 1: main calls 1: bi_zero
43func mg_put64(x: *i64, v: i64) -> i64
called by 1: main calls 1: bi_zero
49func mg_eqn(a: *i64, b: *i64, n: i64) -> i64
called by 1: main calls 1: bi_cmp
54func main() -> i64