code wiki / _hdl_build / nx_search_governor_test.nx
nx_search_governor_test.nx
buildroot/runtime/_hdl_build/nx_search_governor_test.nx
about
nx_search_governor_test.nx -- PROOF the team UNDERSTANDS the principle (not just one function):
the SAME governor (sg_decide / sg_cost_cap) judges TWO unrelated search spaces, each fed by a
REAL shortest-program search. If one judgment drives both multiply-by-constant AND boolean
circuits, the team has internalized the general idea (cost-bounded shortest-program search /
resource-bounded Kolmogorov complexity), not memorized a multiply rule.
Space 1 -- MULTIPLY: real chain search; baseline = imul (3 cyc); op_cost = 1 cyc/op.
Space 2 -- BOOLEAN: real minimal-circuit search; baseline = naive 2-level sum-of-products
(~3m+2 two-input gates for m minterms -- what un-optimized logic emits); op_cost = 1.
Exit 0 only if every verdict matches and equals sg_decide recomputed independently.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_mulchain_deep.nxnx_boolsynth.nxnx_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
| none |
functions
| 16 | func gt_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 17 | func gt_num(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m}; 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); m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(1, bb, k); return 0 } |
| 19 | func gt_popcount(v: i64) -> i64 { var n: i64 = 0; var x: i64 = v & 255; while x > 0 { n = n + (x & 1); x = x >> 1 } return n } called by 1: gt_bool |
| 22 | func gt_mul(c: i64, cap: i64, imul_cost: i64) -> i64 |
| 28 | func gt_bool(tt: i64, maxL: i64) -> i64 |
| 35 | func main() -> i64 |