code wiki / _hdl_build / nx_atlas_gapscan.nx

nx_atlas_gapscan.nx

buildroot/runtime/_hdl_build/nx_atlas_gapscan.nx

16438 B399 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tooltopic atlas
docsdependenciesstructsconstsfunctions

about

nx_atlas_gapscan.nx -- F225/F225a STRUCTURAL GAP SCAN over the REAL from-god graph: under-connected node pairs scored on the contract axes ([[project-nishi-atlas-loop-integration-2026-07-18]]: "walk the graph for under-connected node pairs x maturity-gap x momentum"). Sibling of nx_atlas_discover (recombines the ~28-row commontask CATALOG -> 12 mcp-live units, silently capped at 48 organs / 40 first-past-the-post proposals) and of nx_atlas_recombine (dmkt PRODUCT recombination, one-best-partner-per-anchor by capability richness). This organ is the MATURITY-GAP axis: it scans all candidate pairs and ranks by true top-K. Four defects of the catalog-mode sibling are fixed BY CONSTRUCTION here: (1) SILENT CAP -> every bound is DECLARED in the envelope line (scale law: no silent truncation). (2) O(n^2 x E) exclusion rescan -> per-node wing/ca/ce are HOISTED once (O(n)); the pair body is pure arithmetic and the O(deg) edge probe runs ONLY for pairs that already clear minscore. (3) "top proposals" that were actually FIRST-40 -> a real bounded top-K insertion, descending by score. (4) toy substrate -> candidates come from the graph, islands and test scaffolding excluded. nx_atlas_gapscan [store-prefix] [out-prefix] [minscore] [topk] defaults: knowledge/store/ecograph_full knowledge/store/gapscan- 5 40 out row: DSC<n> <A>-><B> <score> proposed atlas-graph <evidence> try: plan 10 <A> then 20 <B> NOVELTY = absence of an import edge in EITHER direction (the graph's own ground truth), so an already-composed pair can never be proposed -- the F225 neg-control holds structurally, not by a filter. HUB EXCLUSION (measured, not assumed): the first live run over 16651 nodes returned a top-K saturated by nx_syscalls.nx (Ca=13539) -- a leaf imported by ~80% of the tree carries NO under-connection signal, so pairing it with anything is noise, not novelty. Nodes at or above AR_HUB_CA are therefore not candidates, and an ANCHOR CAP bounds how many emitted rows may share one node so a single anchor cannot crowd the set. Both bounds are reported in the envelope. Wing identity is an FNV hash of the name prefix through the 2nd underscore; a hash collision can only COST a cross-wing bonus (never invent one), so the failure mode is a missed proposal, never a false one. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 4 imports · 0 importers

nx_eco_graph.nx nx_store_seed_lib.nx nx_seg_store.nx nx_syscalls.nx nx_atlas_gapscan.nx

imports: nx_eco_graph.nxnx_store_seed_lib.nxnx_seg_store.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 ar_atoi 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 ↻ ar_werr sys_write ar_slen sys_exit sys_mmap ↻ ar_is_cand ar_name_has ar_slen ↻ ar_nlen ar_wing_len ar_nlen ↻ eg_hash ar_score ar_has_edge ar_shared ar_topk_ins ss_cat ↻ ss_catn sys_mmap ↻

structs

none

consts

34const AR_OUTCAP: i64 = 1048576
35const AR_MAXCAND: i64 = 8192
36const AR_TOPK_MAX: i64 = 512
37const AR_TOPK_DEF: i64 = 40
38const AR_MINSCORE_DEF: i64 = 5
39const AR_HASHMOD: i64 = 1000003
40const AR_MSGCAP: i64 = 640
41const AR_NL: i64 = 10
42const AR_TAB: i64 = 9
43const AR_STDOUT: i64 = 1
44const AR_STDERR: i64 = 2
45const AR_EXIT_IO: i64 = 1
46const AR_ZERO: i64 = 48
47const AR_NINE: i64 = 57
48const AR_B10: i64 = 10
49const AR_USCORE: i64 = 95
50const AR_OVER: i64 = 4
52const AR_W_CROSSWING: i64 = 3
53const AR_W_MOMENTUM: i64 = 2
54const AR_W_MATGAP: i64 = 2
55const AR_W_BRIDGE: i64 = 1
57const AR_MOMENTUM_CA: i64 = 2
58const AR_MATURE_CA: i64 = 5
59const AR_UNDER_CA: i64 = 1
60const AR_CAND_CE: i64 = 2
61const AR_HUB_CA: i64 = 500
62const AR_MAX_ANCHOR: i64 = 2
67const AR_W_SHARED: i64 = 1
68const AR_SHARED_CAP: i64 = 8

functions

70func ar_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: ar_werrar_name_has
71func ar_werr(s: *u8) -> i64 { sys_write(AR_STDERR, s, ar_slen(s)); return 0 }
called by 1: main calls 2: sys_writear_slen
72func ar_atoi(s: *u8) -> i64
called by 1: main
83func ar_nlen(g: *EcoGraph, idx: i64) -> i64
89func ar_name_has(g: *EcoGraph, idx: i64, s: *u8) -> i64
called by 1: ar_is_cand calls 2: ar_slenar_nlen
104func ar_catname(g: *EcoGraph, idx: i64, d: *u8, o: i64) -> i64
called by 1: main
112func ar_wing_len(g: *EcoGraph, idx: i64) -> i64
called by 1: main calls 1: ar_nlen
125func ar_has_edge(g: *EcoGraph, a: i64, b: i64) -> i64
called by 1: main
136func ar_shared(g: *EcoGraph, a: i64, b: i64) -> i64
called by 1: main
153func ar_is_cand(g: *EcoGraph, i: i64) -> i64
called by 1: main calls 1: ar_name_has
166func ar_score(wha: i64, whb: i64, caa: i64, cab: i64, cea: i64, ceb: i64) -> i64
called by 1: main
178func ar_topk_ins(ta: *i64, tb: *i64, tsc: *i64, tn: *i64, k: i64, a: i64, b: i64, sc: i64) -> i64
called by 1: main
203func main(argc: i64, argv: *i64) -> i64