code wiki / _hdl_build / nx_math_genealogist.nx
nx_math_genealogist.nx
buildroot/runtime/_hdl_build/nx_math_genealogist.nx
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
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
structs
| none |
consts
| 39 | const MG_MAGIC_1048576: i64 = 1048576 |
| 40 | const MG_MAGIC_65536: i64 = 65536 |
| 42 | const MG_RUNGS: *u8 = "knowledge/specs/math_rungs.tsv" |
| 43 | const MG_LOG: *u8 = "knowledge/status/math_engine.log" |
| 44 | const MG_MAP: *u8 = "knowledge/registry/math_genealogy.tsv" |
| 45 | const MG_GATE: *u8 = "knowledge/status/math_genealogy.log" |
functions
| 47 | func 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 } |
| 48 | func 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 } |
| 49 | func mg_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 50 | func 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 |
| 51 | func 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 |
| 53 | func mg_at(buf: *u8, n: i64, i: i64, pat: *u8, pl: i64) -> i64 |
| 60 | func mg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 71 | func mg_grade(buf: *u8, n: i64, anchor: *u8) -> i64 |
| 100 | func mg_field(buf: *u8, ls: i64, le: i64, f: i64, dst: *u8, cap: i64) -> i64 |
| 119 | func mg_floating(grade_green: i64, base_all_green: i64) -> i64 |
| 124 | func mg_grade_str(g: i64) -> *u8 called by 1: main |
| 131 | func mg_selftest() -> i64 |
| 154 | func main() -> i64 |