nx_field_lib.nx
buildroot/runtime/nx_field_lib.nx
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
imports: nx_syscalls.nx
imported by: nx_field_discover.nxnx_field_gate.nx
structs
| none |
consts
| 20 | const FL_MAX_CAND: i64 = 4096 // candidates per run; a fill is announced (capped=1), never silently dropped |
| 21 | const FL_NAME_CAP: i64 = 96 // bytes per name incl. NUL |
| 22 | const FL_LINK_CAP: i64 = 160 // bytes per link incl. NUL |
| 23 | const FL_MAX_SEEDS: i64 = 62 // seeds_hit is a bit mask; bit 62 is the last safe bit in an i64 |
| 24 | const FL_REC_W: i64 = 4 // per-candidate words: mentions, seeds_hit, first_seed, kind_of_first |
| 25 | const FL_KIND_WIKI: i64 = 1 |
| 26 | const FL_KIND_GH: i64 = 2 |
| 27 | const FL_KIND_MD: i64 = 3 |
| 28 | const FL_KIND_NAMED: i64 = 4 // a DECLARED member of the population (seed row seed|key|url|named|why|Display Name): the operator's |
| 31 | const FL_CH_LB: i64 = 91 // [ |
| 32 | const FL_CH_RB: i64 = 93 // ] |
| 33 | const FL_CH_LBRACE: i64 = 123 // |
| 34 | const FL_CH_RBRACE: i64 = 125 // } |
| 35 | const FL_CH_LT: i64 = 60 // < |
| 36 | const FL_CH_GT: i64 = 62 // > |
| 37 | const FL_CH_SLASH: i64 = 47 |
| 38 | const FL_CH_PIPE: i64 = 124 |
| 39 | const FL_CH_COLON: i64 = 58 |
| 40 | const FL_CH_HASH: i64 = 35 |
| 41 | const FL_CH_SPACE: i64 = 32 |
| 42 | const FL_CH_NL: i64 = 10 |
| 43 | const FL_CH_CR: i64 = 13 |
| 44 | const FL_CH_TAB: i64 = 9 |
| 45 | const FL_CH_MINUS: i64 = 45 |
| 46 | const FL_CH_STAR: i64 = 42 |
| 47 | const FL_CH_LPAREN: i64 = 40 |
| 48 | const FL_CH_RPAREN: i64 = 41 |
| 49 | const FL_CH_QUOTE: i64 = 34 |
| 50 | const FL_CH_UPPER_A: i64 = 65 |
| 51 | const FL_CH_UPPER_Z: i64 = 90 |
| 52 | const FL_CASE_DELTA: i64 = 32 |
| 53 | const FL_GH_HREF_BACK: i64 = 400 // bytes to look back from the repo-name anchor for its href |
| 54 | const FL_ASCII_ZERO: i64 = 48 |
| 55 | const FL_ASCII_NINE: i64 = 57 |
| 327 | const FL_DECLARED_TIER: i64 = 64 |
functions
| 58 | func fl_tbl_new() -> *i64 |
| 68 | func fl_count(t: *i64) -> i64 { return t[3] } called by 1: main |
| 69 | func fl_capped(t: *i64) -> i64 { return t[4] } called by 1: main |
| 70 | func fl_mentions_total(t: *i64) -> i64 { return t[5] } called by 1: main |
| 71 | func fl_name_at(t: *i64, i: i64) -> *u8 { return (t[0] + i * FL_NAME_CAP) as *u8 } |
| 72 | func fl_link_at(t: *i64, i: i64) -> *u8 { return (t[1] + i * FL_LINK_CAP) as *u8 } |
| 73 | func fl_rec(t: *i64, i: i64, f: i64) -> i64 { let r: *i64 = t[2] as *i64; return r[i * FL_REC_W + f] } |
| 74 | func 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 } |
| 75 | func fl_lc(c: i64) -> i64 { if c >= FL_CH_UPPER_A { if c <= FL_CH_UPPER_Z { return c + FL_CASE_DELTA } } return c } |
| 77 | func fl_name_eq(name: *u8, b: *u8, s: i64, e: i64) -> i64 |
| 89 | func fl_find(t: *i64, b: *u8, s: i64, e: i64) -> i64 |
| 96 | func fl_trim(b: *u8, sp: *i64, ep: *i64) -> i64 called by 1: fl_add |
| 113 | func fl_add(t: *i64, b: *u8, s0: i64, e0: i64, link: *u8, ls: i64, le: i64, seed: i64, kind: i64) -> i64 called by 4: fl_wiki_scanfl_gh_scanfl_md_scanfl_named_add calls 7: sys_mmapfl_trimfl_findfl_rec_setfl_recfl_name_at+1 |
| 155 | func fl_span_has(b: *u8, s: i64, e: i64, ch: i64) -> i64 called by 1: fl_wiki_scan |
| 160 | func fl_starts_at(b: *u8, n: i64, p: i64, lit: *u8) -> i64 |
| 171 | func fl_wiki_scan(t: *i64, b: *u8, n: i64, seed: i64) -> i64 |
| 229 | func fl_gh_scan(t: *i64, b: *u8, n: i64, seed: i64) -> i64 |
| 268 | func fl_md_scan(t: *i64, b: *u8, n: i64, seed: i64) -> i64 |
| 300 | func 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 } |
| 301 | func 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 } |
| 302 | func fl_putn(fd: i64, v: i64) -> i64 |
| 315 | func fl_kind_name(k: i64) -> *u8 |
| 328 | func fl_named_add(t: *i64, name: *u8, url: *u8, seed: i64) -> i64 |
| 341 | func fl_puts_nopipe(fd: i64, s: *u8) -> i64 |
| 352 | func fl_order(t: *i64, order: *i64) -> i64 |
| 383 | func fl_emit(t: *i64, fd: i64, seedkeys: *i64, nseeds: i64) -> i64 |