code wiki / _hdl_build / nx_funcmine.nx
nx_funcmine.nx
buildroot/runtime/_hdl_build/nx_funcmine.nx
about
nx_funcmine.nx -- FUNCTION MINING for OO consolidation (operator 2026-07-20: "archive the functions
for functions mining... object oriented without losing functionalities"). Scans a dir's .nx files,
extracts every function BODY, FNV-1a hashes it, and reports IDENTICAL bodies appearing in 2+ places
= the TRUE function-level dedup the file-level detector can't see: a copy-pasted helper across N organs
is a base/shared-lib EXTRACTION target (rule 15: pattern in 3+ -> shared/), behaviour-preserving because
the body is byte-identical. Bucket-chained hash (O(files+funcs), not O(funcs^2)). Emits the mining
substrate for the SHARP2 archive.
argv: <dir>
Report: DUPFUNC hash=<h> copies=<n> : <file>:<func> | ... , then NX-FUNCMINE files=F funcs=N dupgroups=G dupfuncs=D
exit 0 = ran. Deterministic. license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_seat_drive_lib.nxnx_deploy_lib.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
| 14 | const FM_MAGIC_524288: i64 = 524288 |
| 15 | const FM_MAGIC_262144: i64 = 262144 |
| 16 | const FM_MAGIC_1024: i64 = 1024 |
| 17 | const FM_MAGIC_2048: i64 = 2048 |
| 19 | const FM_MAXREC: i64 = 60000 |
| 20 | const FM_NB: i64 = 65536 |
| 21 | const FM_NAMEBUF: i64 = 6291456 |
| 22 | const FM_FILECAP: i64 = 2097152 |
| 23 | const FM_MAXFILES: i64 = 12000 |
| 24 | const FM_FNV_OFF: i64 = 1469598103934665603 |
| 25 | const FM_FNV_PRIME: i64 = 1099511628211 |
functions
| 27 | func fm_isid(c: i64) -> i64 called by 1: main |
| 34 | func fm_ends_nx(nm: *u8) -> i64 called by 1: main |
| 41 | func fm_fnv(buf: *u8, s: i64, e: i64) -> i64 called by 1: main |
| 48 | func main(argc: i64, argv: *i64) -> i64 |