code wiki / _hdl_build / nx_mulchain_costcap_probe.nx
nx_mulchain_costcap_probe.nx
buildroot/runtime/_hdl_build/nx_mulchain_costcap_probe.nx
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
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
structs
| none |
consts
| 10 | const K_MAGIC_10007: i64 = 10007 |
| 11 | const K_MAGIC_1000003: i64 = 1000003 |
| 12 | const K_MAGIC_715827883: i64 = 715827883 |
| 13 | const K_MAGIC_123457: i64 = 123457 |
| 14 | const K_MAGIC_43691: i64 = 43691 |
| 15 | const K_MAGIC_2730: i64 = 2730 |
functions
| 17 | func 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 |
| 18 | func cp_puts(s: *u8) -> i64 { sys_write(1, s, cp_slen(s)); return 0 } |
| 19 | func 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 } |
| 21 | func cp_run(c: i64) -> i64 |
| 26 | func main() -> i64 |