code wiki / _hdl_build / nx_dup_detect.nx

nx_dup_detect.nx

buildroot/runtime/_hdl_build/nx_dup_detect.nx

9200 B158 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_dup_detect.nx -- FUSED duplicate detection (operator 2026-07-16: "we dont know what's in what bucket ... fuzzy vs exact"). Exact-match (imports) sees 0 dup; crude NAME-fuzzy over-merges verbs (add x999). This FUSES two axes from the family graph: (1) canonical NAME (strip nx_/.nx + version/redundancy qualifiers) AND (2) IMPORT-SIGNATURE (the order-independent set of files an organ imports = its structural fingerprint, = sum of FNV(neighbor-name) over out-edges). Two organs are DUPLICATES only if BOTH match -> nx_bignum_add and nx_p256_add share canon "add" but have DIFFERENT import signatures -> correctly SPLIT (the verb false-merge dies). Supersedes nx_fuzzy_dup (name-only). Read-only over the eco_graph store. nx_dup_detect <store-prefix> license_tier: ORIGINAL module: nishi-core.architect.dup_detect

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_eco_graph.nx nx_dup_detect.nx

imports: nx_syscalls.nxnx_eco_graph.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main dd_p sys_write eg_load sys_mmap sov_get_ints sys_mmap ↻ ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ss_readall ss_r32 sov_get_copy sys_mmap ↻ ss_get ↻ dd_streq_ao sys_mmap ↻ dd_canon dd_is_stop dd_streq_ao ↻ sys_write ↻ dd_pn sys_mmap ↻ sys_write ↻ dd_name_fnv dd_hash

structs

none

consts

11const DD_MAGIC_2166136261: i64 = 2166136261
12const DD_MAGIC_16777619: i64 = 16777619
13const DD_MAGIC_4294967295: i64 = 4294967295
14const DD_MAGIC_4611686018427387903: i64 = 4611686018427387903
15const DD_MAGIC_1000003: i64 = 1000003
17const DD_SLOTS: i64 = 131072
18const DD_ARENA: i64 = 4194304

functions

20func dd_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
21func dd_pn(v: i64) -> i64 { let b: *u8 = sys_mmap(24); var m: i64 = v; var k: i64 = 0; let t: *u8 = sys_mmap(24); if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48+(m%10)) as u8; m = m/10; k = k+1 } var i: i64 = 0; while i < k { b[i] = t[k-1-i]; i = i+1 } sys_write(1, b, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
22func dd_streq_ao(a: *u8, ao: i64, al: i64, b: *u8) -> i64
called by 2: dd_is_stopmain
29func dd_is_stop(buf: *u8, to: i64, tl: i64) -> i64
called by 1: dd_canon calls 1: dd_streq_ao
50func dd_canon(g: *EcoGraph, idx: i64, out: *u8) -> i64
called by 1: main calls 1: dd_is_stop
69func dd_hash(s: *u8, l: i64) -> i64 { var h: i64 = DD_MAGIC_2166136261; var i: i64 = 0; while i < l { h = h ^ (s[i] as i64); h = (h * DD_MAGIC_16777619) & DD_MAGIC_4294967295; i = i + 1 } return h }
called by 1: main
71func dd_name_fnv(g: *EcoGraph, idx: i64) -> i64
called by 1: main
78func main(argc: i64, argv: *i64) -> i64