code wiki / _hdl_build / nx_mulchain_costcap_probe.nx

nx_mulchain_costcap_probe.nx

buildroot/runtime/_hdl_build/nx_mulchain_costcap_probe.nx

2175 B44 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind probetopic mulchain
docsdependenciesstructsconstsfunctions

about

nx_mulchain_costcap_probe.nx -- TEST the research claim: the tractability lever is the Levin cost-cap (don't search past the depth where a chain could beat imul), NOT a cleverer prune. Run the PRUNED deep search (Thurber-family reach bound) at the cost-competitive cap maxL=5 over the escalated constants AND the primes that hung at depth 6/12. If depth-5 is fast for everyone (finds 466/683/691=5 ops, fails-fast on 10007/1000003), the claim holds. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_mulchain_deep.nx nx_syscalls.nx nx_mulchain_costcap_probe.nx

imports: nx_mulchain_deep.nxnx_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_mmap cp_puts sys_write cp_slen cp_num sys_mmap ↻ sys_write ↻ cp_run sys_mmap ↻ mulchain_deep_verified mulchain_find_deep mc_abs mcd_enum mcd_reach mc_abs ↻ mcd_maxmag mc_abs ↻ mc_avslot mc_abs ↻ mcd_enum ↻ mc_eval sys_exit

structs

none

consts

10const K_MAGIC_10007: i64 = 10007
11const K_MAGIC_1000003: i64 = 1000003
12const K_MAGIC_715827883: i64 = 715827883
13const K_MAGIC_123457: i64 = 123457
14const K_MAGIC_43691: i64 = 43691
15const K_MAGIC_2730: i64 = 2730

functions

17func cp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: cp_puts
18func cp_puts(s: *u8) -> i64 { sys_write(1, s, cp_slen(s)); return 0 }
called by 1: main calls 2: sys_writecp_slen
19func cp_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 }
called by 1: main calls 2: sys_mmapsys_write
21func cp_run(c: i64) -> i64
called by 1: main calls 2: sys_mmapmulchain_deep_verified
26func main() -> i64