code wiki / _hdl_build / nx_mech_engines_lib.nx

nx_mech_engines_lib.nx

buildroot/runtime/_hdl_build/nx_mech_engines_lib.nx

5972 B91 linesdepth 2pulls 3 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_mech_engines_lib.nx -- the REAL mechanistic engines as a SHARED LIBRARY (no main): the optimizer, the machine scientist (symbolic regression), the ensemble classifier, and the heuristic planner -- the genuine algorithms (extracted from their verified gates) so the neurosymbolic dispatch loop calls REAL code, not demo stubs (operator: wire the remaining engines into the loop). Integer + f32, deterministic, NO LLM. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_f32_hw.nx nx_syscalls.nx nx_mech_engines_lib.nx nx_neurosym_complete_gate.nx nx_neurosym_full_gate.nx

imports: nx_f32_hw.nxnx_syscalls.nx

imported by: nx_neurosym_complete_gate.nxnx_neurosym_full_gate.nx

structs

none

consts

8const K_MAGIC_999999999: i64 = 999999999
9const K_MAGIC_1024: i64 = 1024

functions

12func eng_optimize(target: i64) -> i64 { var bx: i64=0; var bv: i64=K_MAGIC_999999999; var x: i64=0; while x<=50 { let d: i64=x-target; let v: i64=d*d; if v<bv { bv=v; bx=x } x=x+1 } return bx }
called by 2: mainmain
15func f32_le_l(x: i64, y: i64) -> i64 { let d: i64=f32_sub(x,y) & 0xFFFFFFFF; if ((d>>31)&1)==1 { return 1 } if (d & 0x7FFFFFFF)==0 { return 1 } return 0 }
called by 1: eng_discover calls 1: f32_sub
16func eng_discover(X: *i64, Y: *i64, N: i64) -> i64
30func eng_stump(xv: i64) -> i64 { if xv>5 { return 1 } return 0 }
called by 1: eng_forest
31func eng_forest(x1: i64, x2: i64, x3: i64) -> i64 { let v: i64=eng_stump(x1)+eng_stump(x2)+eng_stump(x3); if v>=2 { return 1 } return 0 }
called by 2: mainmain calls 1: eng_stump
34func eng_apply(s: i64, a: i64, pre: *i64, add: *i64, del: *i64) -> i64 { return (s & (0-1-del[a])) | add[a] }
called by 1: eng_plan
35func eng_hrelax(s: i64, goal: i64, pre: *i64, add: *i64, NA: i64) -> i64
called by 1: eng_plan
40func eng_plan() -> i64
60func eng_pareto_hv(f1: *i64, f2: *i64, N: i64, R: i64) -> i64
called by 1: main calls 1: sys_mmap
68func eng_sat2(cl0: *i64, cl1: *i64, ncl: i64) -> i64
called by 1: eng_prove
82func eng_prove() -> i64
called by 1: main calls 2: sys_mmapeng_sat2