code wiki / (root) / nx_swcompare_sota_lib.nx

nx_swcompare_sota_lib.nx

buildroot/runtime/nx_swcompare_sota_lib.nx

33972 B533 linesdepth 10pulls 52 transitivereach 6 importersview sourcekind librarytopic swcompare
docsdependenciesstructsconstsfunctions

about

nx_swcompare_sota_lib.nx -- THE SOTA FIELD AS ONE LIB PASS (2026-09-02, operator: "all the /compare on the same emitted output, not random; if a previous compare had more capabilities bring it into the emitter"). WHY. Two generators emitted the /compare surface and their pages had drifted to two SHAPES: the ten sota-class domains (any domain with a knowledge/compare/<dom>.sota) rendered the N-peer grade grid plus the shared passes, and LACKED the Evidence profile, Do this next, Critical path and Capability matrix sections every matrix-class page carries; the matrix-class pages lacked the grade grid. Measured on the live pages 2026-09-02 (lang vs graphics). Since the grade grid, its measured bindings and its census were the ONLY capability the sota generator had that the matrix generator did not, they move HERE as a pass the matrix generator composes when a .sota exists -- absent file = byte-identical emit, the refs/gallery/bench precedent -- and every domain then renders through ONE assembler. nx_swcompare_sota's page path becomes redundant by construction. EVERYTHING THAT WAS MEASURED STAYS MEASURED, WITH THE SAME WORDS: the binding classes (CONSISTENT / STALE-UNDER / UNBACKED refuses / UNRESOLVED / UNREADABLE), the `BIND:` census line, the per-row drift lines, the html badge strings and the api.json field names are carried verbatim, because nx_sota_drift_gate asserts on those exact bytes (it drives the promoted generator on a /tmp fixture tree) and a gate that has to be re-taught its subject's vocabulary on every refactor is a gate that gets loosened. THE DATA (unchanged): knowledge/compare/<dom>.sota @title / @sub / @verdict / @cols Nishi|<c1>|..|<cM> / @cat <category> <axis>|<kind num|g>|<v0>|..|<v(M-1)>[|=<symbol> or =<organ>:<symbol>]|<note> API. sl_new() allocates the state; sl_load(domain, st) parses and measures (1 loaded . 0 no .sota . -1 empty); sl_css(fd) the grid's type rules; sl_html(st, domain, fd) the section; sl_json(st, domain, fd) a `,"sota":{..}` fragment (leading comma, caller places it before the ppp key); sl_census(st, domain, fd) the plain-mode lines, returning 1 when the liar-kill passes and 0 when it refuses (the caller folds that into its own verdict). license_tier: ORIGINAL Read-only. No hw writes (Rule 26).

dependencies 2 imports · 4 importers

nx_syscalls.nx nx_swcompare_lib.nx nx_swcompare_sota_lib.nx nx_compare_growth_matrix_full_2026 nx_swcompare_matrix.nx nx_swcompare_matrix_ladder_test_20 nx_swcompare_matrix_rank_guard_t16

imports: nx_syscalls.nxnx_swcompare_lib.nx

imported by: nx_compare_growth_matrix_full_20260910.nxnx_swcompare_matrix.nxnx_swcompare_matrix_ladder_test_20260907.nxnx_swcompare_matrix_rank_guard_t162.nx

structs

53struct SotaState

consts

31const SL_HASH_SEED: i64 = 5381
32const SL_CAP: i64 = 262144
33const SL_MAXR: i64 = 96
34const SL_MAXF: i64 = 24
35const SL_STATE_BYTES: i64 = 1024 // SotaState is 36 words = 288 B; 1024 leaves room for fields added later
36const SL_PATH: i64 = 512
37const SL_LIAR_COLS: i64 = 8 // the generator's liar-kill floors, unchanged: cols>=8 rows>=20 quantitative>=3
38const SL_LIAR_ROWS: i64 = 20
39const SL_LIAR_NUM: i64 = 3
40const SL_DRIFT_NONE: i64 = 0
41const SL_DRIFT_CONSISTENT: i64 = 1
42const SL_DRIFT_STALE_UNDER: i64 = 2
43const SL_DRIFT_UNBACKED: i64 = 3
44const SL_DRIFT_UNRESOLVED: i64 = 4
45const SL_DRIFT_UNREADABLE: i64 = 5
50const SL_DRIFT_UNSERVED: i64 = 6
51const SL_MEAS_UNRESOLVED: i64 = 0 - 2

functions

88func sl_src_hash(b: *u8, n: i64) -> i64
called by 1: sl_load
95func sl_has(h: *u8, needle: *u8) -> i64
112func sl_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c }
called by 1: sl_has_ci
113func sl_has_ci(hay: *u8, needle_lc: *u8) -> i64
called by 1: sl_note_has_evidence calls 1: sl_lc
134func sl_note_has_evidence(note: *u8) -> i64
called by 2: sl_loadsl_census calls 2: sl_has_cisl_has
143func sl_drift_name(d: i64) -> *u8
152func sl_drift_class(d: i64) -> *u8
called by 1: sl_html_heading
159func sl_meas_name(m: i64) -> *u8
166func sl_new() -> *SotaState
175func sl_load(domain: *u8, st: *SotaState) -> i64
327func sl_css(fd: i64) -> i64
342func sl_html(st: *SotaState, domain: *u8, fd: i64) -> i64 { return sl_html_heading(st, domain, fd, 2) }
called by 1: main calls 1: sl_html_heading
343func sl_html_heading(st: *SotaState, domain: *u8, fd: i64, heading_level: i64) -> i64
436func sl_json(st: *SotaState, domain: *u8, fd: i64) -> i64
486func sl_census(st: *SotaState, domain: *u8, fd: i64) -> i64