code wiki / _hdl_build / nx_mulchain_deep_probe.nx
nx_mulchain_deep_probe.nx
buildroot/runtime/_hdl_build/nx_mulchain_deep_probe.nx
about
nx_mulchain_deep_probe.nx -- MEASURE before building. Depth-6 cap (a deepen the team can
afford). For each constant report the minimal VERIFIED op-count at maxL=6 (or NONE), and we
time the whole batch externally to confirm depth-6 stays fast even for large primes (whose
true chain is ~30 ops -- the search must FAIL FAST there, ceding them to imul, not hang).
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_mulchain.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
| 9 | const K_MAGIC_2730: i64 = 2730 |
| 10 | const K_MAGIC_10007: i64 = 10007 |
| 11 | const K_MAGIC_43691: i64 = 43691 |
| 12 | const K_MAGIC_1000003: i64 = 1000003 |
| 13 | const K_MAGIC_715827883: i64 = 715827883 |
| 14 | const K_MAGIC_65535: i64 = 65535 |
| 15 | const K_MAGIC_123457: i64 = 123457 |
functions
| 17 | func pr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: pr_puts |
| 18 | func pr_puts(s: *u8) -> i64 { sys_write(1, s, pr_slen(s)); return 0 } |
| 19 | func pr_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 pr_minlen6(c: i64) -> i64 |
| 26 | func main() -> i64 |