code wiki / (root) / nx_field_lib.nx

nx_field_lib.nx

buildroot/runtime/nx_field_lib.nx

18041 B405 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic field
docsdependenciesstructsconstsfunctions

about

nx_field_lib.nx -- THE FIELD DISCOVERY CORE (/compare/fieldwatch FW1, 2026-09-05): the industry's own lists, read mechanically, become a DISCOVERED population of rivals per domain -- never a seat's six picks. WHY (operator 2026-09-05, on the modding board's six columns): "those arent a good sample of the industry ... the /compare emitter lags heavily there instead of giving a true beyond gartner or google search return alternatives and competitors and beyond real view for all these domains." A column is a choice; a field is a measurement. This lib turns three kinds of public list into candidate rows with EVIDENCE COUNTS: wiki-raw Wikipedia wikitext (action=raw): every [[Target]] and [[Target|Text]] link OUTSIDE <ref> blocks and OUTSIDE {{templates}} (citations and infobox plumbing are not rivals), namespace links excluded by their colon (Category: File: Help: Template: ...), counted per occurrence gh-topic a GitHub topic page: the repository anchors, whose markup carries the class token the page itself uses for the repo name; the two-segment href is kept as the link md-list a raw Markdown list (awesome-style): every - [Name](link) or * [Name](link) item One table holds every candidate across seeds; a name seen in several seeds carries a seeds_hit mask and a mentions count, and fl_emit writes rows sorted by seeds then mentions, so "who the field agrees on" is arithmetic. The table is a declared population: when it fills, capped=1 is ANNOUNCED, never silent. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_field_lib.nx nx_field_discover.nx nx_field_gate.nx

imports: nx_syscalls.nx

imported by: nx_field_discover.nxnx_field_gate.nx

structs

none

consts

20const FL_MAX_CAND: i64 = 4096 // candidates per run; a fill is announced (capped=1), never silently dropped
21const FL_NAME_CAP: i64 = 96 // bytes per name incl. NUL
22const FL_LINK_CAP: i64 = 160 // bytes per link incl. NUL
23const FL_MAX_SEEDS: i64 = 62 // seeds_hit is a bit mask; bit 62 is the last safe bit in an i64
24const FL_REC_W: i64 = 4 // per-candidate words: mentions, seeds_hit, first_seed, kind_of_first
25const FL_KIND_WIKI: i64 = 1
26const FL_KIND_GH: i64 = 2
27const FL_KIND_MD: i64 = 3
28const FL_KIND_NAMED: i64 = 4 // a DECLARED member of the population (seed row seed|key|url|named|why|Display Name): the operator's
31const FL_CH_LB: i64 = 91 // [
32const FL_CH_RB: i64 = 93 // ]
33const FL_CH_LBRACE: i64 = 123 //
34const FL_CH_RBRACE: i64 = 125 // }
35const FL_CH_LT: i64 = 60 // <
36const FL_CH_GT: i64 = 62 // >
37const FL_CH_SLASH: i64 = 47
38const FL_CH_PIPE: i64 = 124
39const FL_CH_COLON: i64 = 58
40const FL_CH_HASH: i64 = 35
41const FL_CH_SPACE: i64 = 32
42const FL_CH_NL: i64 = 10
43const FL_CH_CR: i64 = 13
44const FL_CH_TAB: i64 = 9
45const FL_CH_MINUS: i64 = 45
46const FL_CH_STAR: i64 = 42
47const FL_CH_LPAREN: i64 = 40
48const FL_CH_RPAREN: i64 = 41
49const FL_CH_QUOTE: i64 = 34
50const FL_CH_UPPER_A: i64 = 65
51const FL_CH_UPPER_Z: i64 = 90
52const FL_CASE_DELTA: i64 = 32
53const FL_GH_HREF_BACK: i64 = 400 // bytes to look back from the repo-name anchor for its href
54const FL_ASCII_ZERO: i64 = 48
55const FL_ASCII_NINE: i64 = 57
327const FL_DECLARED_TIER: i64 = 64

functions

58func fl_tbl_new() -> *i64
called by 1: main calls 1: sys_mmap
68func fl_count(t: *i64) -> i64 { return t[3] }
called by 1: main
69func fl_capped(t: *i64) -> i64 { return t[4] }
called by 1: main
70func fl_mentions_total(t: *i64) -> i64 { return t[5] }
called by 1: main
71func fl_name_at(t: *i64, i: i64) -> *u8 { return (t[0] + i * FL_NAME_CAP) as *u8 }
73func fl_rec(t: *i64, i: i64, f: i64) -> i64 { let r: *i64 = t[2] as *i64; return r[i * FL_REC_W + f] }
74func fl_rec_set(t: *i64, i: i64, f: i64, v: i64) -> i64 { let r: *i64 = t[2] as *i64; r[i * FL_REC_W + f] = v; return 0 }
called by 2: fl_addfl_named_add
75func fl_lc(c: i64) -> i64 { if c >= FL_CH_UPPER_A { if c <= FL_CH_UPPER_Z { return c + FL_CASE_DELTA } } return c }
77func fl_name_eq(name: *u8, b: *u8, s: i64, e: i64) -> i64
called by 1: fl_find calls 1: fl_lc
89func fl_find(t: *i64, b: *u8, s: i64, e: i64) -> i64
called by 1: fl_add calls 2: fl_name_eqfl_name_at
96func fl_trim(b: *u8, sp: *i64, ep: *i64) -> i64
called by 1: fl_add
113func fl_add(t: *i64, b: *u8, s0: i64, e0: i64, link: *u8, ls: i64, le: i64, seed: i64, kind: i64) -> i64
155func fl_span_has(b: *u8, s: i64, e: i64, ch: i64) -> i64
called by 1: fl_wiki_scan
160func fl_starts_at(b: *u8, n: i64, p: i64, lit: *u8) -> i64
called by 2: fl_wiki_scanfl_gh_scan calls 1: fl_lc
171func fl_wiki_scan(t: *i64, b: *u8, n: i64, seed: i64) -> i64
called by 1: main calls 3: fl_starts_atfl_span_hasfl_add
229func fl_gh_scan(t: *i64, b: *u8, n: i64, seed: i64) -> i64
called by 1: main calls 2: fl_starts_atfl_add
268func fl_md_scan(t: *i64, b: *u8, n: i64, seed: i64) -> i64
called by 1: main calls 1: fl_add
300func fl_popcount(v: i64) -> i64 { var c: i64 = 0; var x: i64 = v; while x > 0 { c = c + (x & 1); x = x >> 1 } return c }
called by 2: fl_orderfl_emit
301func fl_puts(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 2: mainfl_emit calls 1: sys_write
302func fl_putn(fd: i64, v: i64) -> i64
called by 2: mainfl_emit calls 2: sys_mmapsys_write
315func fl_kind_name(k: i64) -> *u8
called by 2: mainfl_emit
328func fl_named_add(t: *i64, name: *u8, url: *u8, seed: i64) -> i64
called by 1: main calls 2: fl_addfl_rec_set
341func fl_puts_nopipe(fd: i64, s: *u8) -> i64
called by 1: fl_emit calls 2: sys_mmapsys_write
352func fl_order(t: *i64, order: *i64) -> i64
called by 1: fl_emit calls 3: sys_mmapfl_popcountfl_rec
383func fl_emit(t: *i64, fd: i64, seedkeys: *i64, nseeds: i64) -> i64