code wiki / _hdl_build / nx_math_genealogist.nx

nx_math_genealogist.nx

buildroot/runtime/_hdl_build/nx_math_genealogist.nx

14085 B279 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic math
docsdependenciesstructsconstsfunctions

about

nx_math_genealogist.nx -- the MATH-DOMAIN FAMILY-SEARCH (operator 2026-06-13: "we need math and other types of genealogist family search beyond just the overall family-search map ... so we can trace how the math scales and can be rebuilt without floating"). The whole-ecosystem lineage.tsv is too coarse to answer "in what ORDER, from the hardware rung up, do I rebuild the math engine with ZERO floating, and what is each rung GRADED?". This organ is the domain-scoped genealogist for that question. It is organ-AUTHORED (not hand-drawn): it COMPOSES three live surfaces and computes the family tree -- knowledge/specs/math_rungs.tsv -> the REBUILD RECIPE per function (spec-emitter -> kernel-emitter -> test -> oracle-gate -> f64-gate), the "how to rebuild" knowledge/status/math_engine.log -> the GRADE per rung (last RUNGRUN rung=<n> verdict), and the foundation grades the two FOUNDATIONS (DATA below) -> ME0 nx_f64 (IEEE754 binary64 bits-up, the hardware rung) and ME3 nx_bigfloat120 (the 120-bit sovereign oracle every gate measures against). EVERY function rests on both. The genealogy is a clean 3-layer rebuild DAG (verified, not asserted): layer 0 ME0 nx_f64 (founds-on: - ) the hardware rung layer 1 ME3 nx_bigfloat120 (founds-on: nx_f64) the oracle layer 2 every function rung (founds-on: nx_f64, nx_bigfloat120) FLOATING (math sense) = a rung GRADED GREEN that rests on a foundation NOT GREEN -- a proven function standing on an unverified base (an impossible-to-rebuild claim). The no-float LAW for math: zero floating => the whole engine is reconstructible bottom-up. Emits: knowledge/registry/math_genealogy.tsv (machine table, layer-ascending) + a human REBUILD-ORDER tree to stdout + a MATHGENE coherence gate to knowledge/status/math_genealogy.log. SELF-VALIDATING (no false-green): baked pos/neg controls (green rung on green base -> grounded; green rung on a RED base -> floating; grade-eval GREEN on green log / not-green on red) run BEFORE the real surfaces. module: nishi-core.math.genealogist depends: nishi-core.sys.syscalls capability: MATH_FAMILY_SEARCH_NO_FLOAT license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_math_genealogist.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_now_realtime_sec sys_mmap sys_clock_gettime_real mg_selftest sys_mmap ↻ mg_cpy mg_grade mg_len mg_at mg_len ↻ mg_floating mg_field mg_at ↻ mg_w sys_write mg_wn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close sys_exit sys_mmap ↻ mg_read sys_openat_rd sys_read sys_close ↻ mg_grade ↻ sys_openat_wr mg_grade_str mg_floating ↻ mg_field ↻ mg_len ↻ mg_cat

structs

none

consts

39const MG_MAGIC_1048576: i64 = 1048576
40const MG_MAGIC_65536: i64 = 65536
42const MG_RUNGS: *u8 = "knowledge/specs/math_rungs.tsv"
43const MG_LOG: *u8 = "knowledge/status/math_engine.log"
44const MG_MAP: *u8 = "knowledge/registry/math_genealogy.tsv"
45const MG_GATE: *u8 = "knowledge/status/math_genealogy.log"

functions

47func mg_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main calls 1: sys_write
48func mg_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(fd,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
49func mg_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
50func mg_cpy(dst: *u8, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[i]=s[i]; i=i+1} dst[i]=0 as u8; return i }
called by 1: mg_selftest
51func mg_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i]; i=i+1} return off+i }
called by 1: main
53func mg_at(buf: *u8, n: i64, i: i64, pat: *u8, pl: i64) -> i64
called by 2: mg_grademg_selftest
60func mg_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
71func mg_grade(buf: *u8, n: i64, anchor: *u8) -> i64
called by 2: mg_selftestmain calls 2: mg_lenmg_at
100func mg_field(buf: *u8, ls: i64, le: i64, f: i64, dst: *u8, cap: i64) -> i64
called by 2: mg_selftestmain
119func mg_floating(grade_green: i64, base_all_green: i64) -> i64
called by 2: mg_selftestmain
124func mg_grade_str(g: i64) -> *u8
called by 1: main
131func mg_selftest() -> i64
154func main() -> i64