code wiki / _hdl_build / nx_idiomcensus.nx
nx_idiomcensus.nx
buildroot/runtime/_hdl_build/nx_idiomcensus.nx
about
nx_idiomcensus.nx -- WHAT COUNTER IDIOM DOES THE SKIP-IDIOM FAMILY ACTUALLY USE?
nx_gate_dry_apply SKIPs a large family because it cannot recognise how the gate counts pass/total, and
the remedy proposed for it has been "write a recogniser" -- for a shape distribution nobody has measured.
★DIAGNOSE THE POPULATION BEFORE BUILDING THE GENERAL MACHINE. A recogniser written against the one shape
somebody happened to eyeball is a recogniser for n=1.
★SUBJECT MATCHES CLAIM. It censuses EXACTLY the gates dry_apply classed SKIP-IDIOM, read from the
NEWEST generation of knowledge/status/drysweep.log -- not "all gates", which is a different population
wearing the same name. drysweep.log is APPEND-ONLY across runs: reading every generation double-counts
(the identical defect already found and fixed in nx_adoptsweep), so the newest block is isolated first.
★UNKNOWN IS ITS OWN BUCKET and the partition is PRINTED AND CHECKED TO SUM. A shape that falls into a
known bucket because nothing matched is the number somebody then plans against.
★MARKER TALLIES ARE NON-EXCLUSIVE AND LABELLED AS SUCH, separately from the exclusive partition -- two
different questions ("how many gates contain X" vs "what IS this gate") must never share a counter.
nx_idiomcensus [max] [logpath] [dir]
exit: 0 censused | 2 usage | 3 NO-CONCLUSION (log unreadable / no SKIP-IDIOM rows / partition disagrees)
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_artifact_root.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
| 23 | const IC_DIR: *u8 = "buildroot/runtime/_hdl_build" |
| 24 | const IC_LOG: *u8 = "knowledge/status/drysweep.log" |
| 25 | const IC_LOGCAP: i64 = 4194304 |
| 26 | const IC_SRCCAP: i64 = 524288 |
| 27 | const IC_NAMECAP: i64 = 512 |
| 28 | const IC_SETCAP: i64 = 262144 |
| 29 | const IC_MAXN: i64 = 4096 |
functions
| 31 | func ic_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 32 | func ic_n(v: i64) -> i64 |
| 43 | func ic_row(label: *u8, v: i64) -> i64 { ic_puts(" " as *u8); ic_puts(label); ic_puts("=" as *u8); ic_n(v); ic_puts("\n" as *u8); return 0 } |
| 48 | func ic_find(buf: *u8, n: i64, pat: *u8, from: i64) -> i64 |
| 62 | func ic_has(buf: *u8, n: i64, pat: *u8) -> i64 { if ic_find(buf, n, pat, 0) >= 0 { return 1 } return 0 } |
| 64 | func ic_rfind(buf: *u8, n: i64, pat: *u8) -> i64 |
| 85 | func ic_strip(buf: *u8, n: i64) -> i64 called by 1: main |
| 107 | func ic_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 115 | func main(argc: i64, argv: *i64) -> i64 |