code wiki / _hdl_build / nx_browser_census.nx

nx_browser_census.nx

buildroot/runtime/_hdl_build/nx_browser_census.nx

20606 B330 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tooltopic browser
docsdependenciesstructsconstsfunctions

about

nx_browser_census.nx -- SOVEREIGN browser-parity census scoreboard organ (MCP tool + API payload). Operator directive 2026-07-23: "mcp and api and object oriented and agentic and workflow ready ... it needs to scale." Replaces the one-off PowerShell -> static-JSON pipeline (the scattering root) with a data-driven sovereign organ: sites + per-site results live in the SEG-STORE PLANE knowledge/store/browsercensus- (NOT hardcoded, NOT a tsv per the sovereign-formats law) -> ADD SITES WITHOUT TOUCHING CODE = scales to N. Reads the plane, parses each site RECORD, aggregates a SCOREBOARD (mean reading-recall vs Chrome, class counts, mean height-ratio), emits structured JSON to stdout (the MCP + API payload) AND colocates it to knowledge/status/browser_census.log (evidence). Fail-closed: absent/empty plane -> RED exit 1 (no scoreboard without data). ---- BR2, 2026-08-26: THE STRUCTURAL-EXACTNESS COLUMN (rung BR2, symbol bc_struct_col) ---------------- The operator ratchet of 2026-07-28 is EXACT structural match to Chrome/Edge/Firefox, measured by struct_diff matched-permil with dy and dx toward 0. Until today that lived in hand-run readings pasted into a plan row; the census -- the thing that publishes -- had no column for it, so the ratchet could not be tracked per site and could not be judged mechanically. Row schema, now TEN tab fields (the last four are ADDITIVE -- a six-field row still parses and its struct columns read UNMEASURED, never a silent 0): site class reading_recall_pm ratio_pct chrome_h nishi_h struct_matched_pm struct_dy struct_dx struct_bands_oracle THE FOURTH NEW COLUMN IS THE DENOMINATOR AND IT IS NOT DECORATION. Measured on saved bytes on 2026-08-26 with the incumbent ruler: google returned "matched=2 (1000 permille)" over TWO oracle text bands, and stackoverflow returned "matched=0 (0 permille)" over ZERO. A perfect score and a total failure, both arithmetic on an empty subject, both arriving as a number a scoreboard would average. bsc_band_floor() derives the smallest usable denominator FROM THE BAR itself and such rows are counted as UNDERPOWERED -- named, excluded, never averaged and never silently dropped. reading_recall_pm/ratio_pct = "-" or non-digit means UNMEASURED (excluded from the mean, never a silent 0). Workflow-ready: one plane row per site, one JSON record per site -> composable/fan-out. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_store_seed_lib.nx nx_seg_store.nx nx_syscalls.nx nx_browser_struct_col_lib.nx nx_browser_census.nx

imports: nx_store_seed_lib.nxnx_seg_store.nxnx_syscalls.nxnx_browser_struct_col_lib.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sts_load sts_gen_note sts_pfxhash ss_max_segid sys_mmap ↻ ss_cat ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ss_segid_ok ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat ↻ sys_fstatat ssc_streq ss_open ss_open2 ss_open3 sys_now_us

structs

none

consts

36const BC_MAGIC_4096: i64 = 4096
38const BC_PLANE_CAP: i64 = 1048576
39const BC_JSON_CAP: i64 = 262144
42const BC_MAXF: i64 = 10
43const BC_WORD: i64 = 8
44const BC_FLD_BYTES: i64 = 80 // BC_MAXF * BC_WORD
45const BC_SITECAP: i64 = 512
46const BC_MODECAP: i64 = 64
47const BC_PAIR_PLANE: *u8 = "knowledge/store/browsercensuspair-\x00"
150const BC_MODE_UNKNOWN: i64 = 0
151const BC_MODE_ON: i64 = 1
152const BC_MODE_OFF: i64 = 2

functions

50func bc_puts(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
51func bc_cat(o: *u8, at: i64, s: *u8) -> i64 { var i: i64=0; var a: i64=at; while s[i]!=(0 as u8){o[a]=s[i]; a=a+1; i=i+1} return a }
called by 1: main
52func bc_catf(o: *u8, at: i64, p: *u8, n: i64) -> i64 { var i: i64=0; var a: i64=at; while i<n { o[a]=p[i]; a=a+1; i=i+1 } return a }
called by 1: main
53func bc_catn(o: *u8, at: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
63func bc_field_has(p: *u8, n: i64, sub: *u8) -> i64
called by 2: bc_leg_modemain
75func bc_field_int(p: *u8, n: i64) -> i64
called by 2: bc_leg_meansmain
93func bc_struct_col(acc: *i64, csv: *u8, site: *u8, slen: i64, p6: *u8, n6: i64, p7: *u8, n7: i64, p8: *u8, n8: i64, p9: *u8, n9: i64, floor: i64, bar_pm: i64, bar_dy: i64) -> i64
called by 1: main calls 2: bsc_field_intbsc_row
100func bc_struct_state(r: i64) -> *u8
called by 1: main
109func bc_leg_means(mb: *u8, mn: i64, out: *i64) -> i64
called by 1: main calls 3: sys_mmapbc_field_intbsc_mean
153func bc_mode_name(m: i64) -> *u8
called by 1: main
158func bc_leg_mode(mb: *u8, mn: i64) -> i64
called by 1: main calls 1: bc_field_has
180func main() -> i64