code wiki / _hdl_build / nx_funcmine.nx

nx_funcmine.nx

buildroot/runtime/_hdl_build/nx_funcmine.nx

10452 B237 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_seat_drive_lib.nx nx_deploy_lib.nx nx_syscalls.nx nx_funcmine.nx

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

main sd_w sys_write sys_exit sys_openat_wr sys_dup3 sys_mmap sys_openat_rd sys_getdents64 dirent_type dirent_name fm_ends_nx sys_read sys_close fm_isid fm_fnv dirent_reclen sd_num sys_mmap ↻ sys_write ↻

structs

none

consts

14const FM_MAGIC_524288: i64 = 524288
15const FM_MAGIC_262144: i64 = 262144
16const FM_MAGIC_1024: i64 = 1024
17const FM_MAGIC_2048: i64 = 2048
19const FM_MAXREC: i64 = 60000
20const FM_NB: i64 = 65536
21const FM_NAMEBUF: i64 = 6291456
22const FM_FILECAP: i64 = 2097152
23const FM_MAXFILES: i64 = 12000
24const FM_FNV_OFF: i64 = 1469598103934665603
25const FM_FNV_PRIME: i64 = 1099511628211

functions

27func fm_isid(c: i64) -> i64
called by 1: main
34func fm_ends_nx(nm: *u8) -> i64
called by 1: main
41func fm_fnv(buf: *u8, s: i64, e: i64) -> i64
called by 1: main
48func main(argc: i64, argv: *i64) -> i64