code wiki / _hdl_build / nx_atlas_gapscan.nx
nx_atlas_gapscan.nx
buildroot/runtime/_hdl_build/nx_atlas_gapscan.nx
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
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
structs
| none |
consts
| 34 | const AR_OUTCAP: i64 = 1048576 |
| 35 | const AR_MAXCAND: i64 = 8192 |
| 36 | const AR_TOPK_MAX: i64 = 512 |
| 37 | const AR_TOPK_DEF: i64 = 40 |
| 38 | const AR_MINSCORE_DEF: i64 = 5 |
| 39 | const AR_HASHMOD: i64 = 1000003 |
| 40 | const AR_MSGCAP: i64 = 640 |
| 41 | const AR_NL: i64 = 10 |
| 42 | const AR_TAB: i64 = 9 |
| 43 | const AR_STDOUT: i64 = 1 |
| 44 | const AR_STDERR: i64 = 2 |
| 45 | const AR_EXIT_IO: i64 = 1 |
| 46 | const AR_ZERO: i64 = 48 |
| 47 | const AR_NINE: i64 = 57 |
| 48 | const AR_B10: i64 = 10 |
| 49 | const AR_USCORE: i64 = 95 |
| 50 | const AR_OVER: i64 = 4 |
| 52 | const AR_W_CROSSWING: i64 = 3 |
| 53 | const AR_W_MOMENTUM: i64 = 2 |
| 54 | const AR_W_MATGAP: i64 = 2 |
| 55 | const AR_W_BRIDGE: i64 = 1 |
| 57 | const AR_MOMENTUM_CA: i64 = 2 |
| 58 | const AR_MATURE_CA: i64 = 5 |
| 59 | const AR_UNDER_CA: i64 = 1 |
| 60 | const AR_CAND_CE: i64 = 2 |
| 61 | const AR_HUB_CA: i64 = 500 |
| 62 | const AR_MAX_ANCHOR: i64 = 2 |
| 67 | const AR_W_SHARED: i64 = 1 |
| 68 | const AR_SHARED_CAP: i64 = 8 |
functions
| 70 | func ar_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 71 | func ar_werr(s: *u8) -> i64 { sys_write(AR_STDERR, s, ar_slen(s)); return 0 } |
| 72 | func ar_atoi(s: *u8) -> i64 called by 1: main |
| 83 | func ar_nlen(g: *EcoGraph, idx: i64) -> i64 |
| 89 | func ar_name_has(g: *EcoGraph, idx: i64, s: *u8) -> i64 |
| 104 | func ar_catname(g: *EcoGraph, idx: i64, d: *u8, o: i64) -> i64 called by 1: main |
| 112 | func ar_wing_len(g: *EcoGraph, idx: i64) -> i64 |
| 125 | func ar_has_edge(g: *EcoGraph, a: i64, b: i64) -> i64 called by 1: main |
| 136 | func ar_shared(g: *EcoGraph, a: i64, b: i64) -> i64 called by 1: main |
| 153 | func ar_is_cand(g: *EcoGraph, i: i64) -> i64 |
| 166 | func ar_score(wha: i64, whb: i64, caa: i64, cab: i64, cea: i64, ceb: i64) -> i64 called by 1: main |
| 178 | func ar_topk_ins(ta: *i64, tb: *i64, tsc: *i64, tn: *i64, k: i64, a: i64, b: i64, sc: i64) -> i64 called by 1: main |
| 203 | func main(argc: i64, argv: *i64) -> i64 |