nx_swcompare_sota.nx source
↩ module page · 647 lines · 51518 B
1// nx_swcompare_sota.nx -- STATE-OF-THE-ART software comparison generator (operator 2026-07-09: "we census too few
2// competitors ... look at how systems are compared at a SOTA level -- speed, functionality, features, APIs").
3// Beyond the toy nx_swcompare_matrix (4 competitors, Yes/No symbol-presence): reads knowledge/compare/<domain>.sota
4// @title / @sub / @cols <c1>|..|<cM> (M competitors, Nishi is column 0, variable M)
5// @cat <category> (groups the axes that follow -- Speed, Quantization, API, ...)
6// <axis>|<kind>|<v0>|<v1>|..|<v(M-1)>|<note> (M cell values, one per column; kind=num|g)
7// kind=num -> the cell value is shown verbatim (a measured number / range / unit -- quantitative)
8// kind=g -> the value is a grade token: B=Best n=No Y=Yes ~=Partial (badged)
9// Honest by construction: cells are researcher-sourced / measured (note carries the source); Nishi (col 0) shows its
10// REAL number (e.g. 1.5 tok/s), NOT a presence tick. Modes: no-arg = console + liar-kill gate; html; json.
11// NOTE: no '#'/'!' in string literals (nx_cc trap) -> rgb() + wc(fd,33). license_tier: ORIGINAL expect_exit: 0
12import "nx_syscalls.nx"
13const K_MAGIC_5381: i64 = 5381
14const K_MAGIC_262144: i64 = 262144
15
16// PROVENANCE HASH (2026-08-07) -- identical contract to nx_swcompare_matrix, kept in step ON PURPOSE:
17// a consumer must not have to know WHICH generator produced a page in order to ask whether it is
18// current. The page declares a content hash of the source it was generated FROM, so staleness is
19// decidable without clocks. mtimes lie across copies (this tree has TWO knowledge/compare dirs) and
20// clocks lie across machines; content does not. djb2 masked to 48 bits -- this detects DRIFT, not
21// tampering, needs no crypto in a generator that has none, and catches the same-size edit that a
22// byte-count comparison is structurally blind to.
23import "nx_swcompare_lib.nx"
24func swc_src_hash(b: *u8, n: i64) -> i64 {
25 var h: i64 = K_MAGIC_5381
26 var i: i64 = 0
27 while i < n { h = h * 33 + (b[i] as i64); i = i + 1 }
28 if h < 0 { h = 0 - h }
29 return h & 0xFFFFFFFFFFFF
30}
31// substring search -- needed by the EVIDENCE test below.
32func swc_has(h: *u8, needle: *u8) -> i64 {
33 var m: i64 = 0
34 while needle[m] != (0 as u8) { m = m + 1 }
35 if m == 0 { return 1 }
36 var i: i64 = 0
37 while h[i] != (0 as u8) {
38 var j: i64 = 0
39 var ok: i64 = 1
40 while j < m {
41 if ok == 1 { if h[i+j] != needle[j] { ok = 0 } }
42 j = j + 1
43 }
44 if ok == 1 { return 1 }
45 i = i + 1
46 }
47 return 0
48}
49// DOES A CLAIM CARRY ITS PROOF? (2026-08-14 -- the ruler note every climb version has carried
50// since v10: "evolve the sota gate to evidence-counted Bests BEFORE the climb crosses No>=Best".)
51// The old honesty proxy was arithmetic: Nishi-No had to outnumber Nishi-Best. That is a crude
52// stand-in and it FAILS IN THE DIRECTION OF PUNISHING REAL EXCELLENCE -- a domain that genuinely
53// leads on twenty gate-proven axes was refused publication for leading, while a domain could pass
54// the check with a page full of UNBACKED Bests as long as it also admitted enough absences.
55// The honest predicate was never the count. It is whether each Best CITES SOMETHING THAT COULD
56// BE CHECKED: a gate, a dated measurement, a proof, a witness, a named artifact. So the liar-kill
57// now asks that of every Best cell and refuses only the UNEVIDENCED ones -- strictly stronger
58// where it matters (an unbacked Best can no longer hide behind a long No column) and no longer
59// capping how good the estate is allowed to be.
60// CASE-INSENSITIVE CONTAINS (2026-08-14). See swc_note_has_evidence for why this exists.
61func swc_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c }
62func swc_has_ci(hay: *u8, needle_lc: *u8) -> i64 {
63 var nl: i64 = 0
64 while needle_lc[nl] != (0 as u8) { nl = nl + 1 }
65 if nl == 0 { return 1 }
66 var i: i64 = 0
67 while hay[i] != (0 as u8) {
68 var k: i64 = 0
69 var ok: i64 = 1
70 while k < nl {
71 let hc: i64 = swc_lc(hay[i + k] as i64)
72 if hc == 0 { ok = 0; k = nl } else {
73 if hc != (needle_lc[k] as i64) { ok = 0; k = nl } else { k = k + 1 }
74 }
75 }
76 if ok == 1 { return 1 }
77 i = i + 1
78 }
79 return 0
80}
81
82func swc_note_has_evidence(note: *u8) -> i64 {
83 // ONE TOKEN PER CONCEPT, MATCHED CASE-INSENSITIVELY. This list used to carry hand-written casing
84 // variants -- gate/Gate, measured/MEASURED, proven/PROVEN -- and the coverage was INCONSISTENT, so
85 // the ruler's verdict depended on how an author had capitalised a word.
86 // MEASURED COST, twice in one day: smallos.sota's device-registry row says "Proven on a real e1000
87 // ... the negative control MISMATCHes on real silicon" -- grade-1 evidence on third-party hardware --
88 // and was refused as UNEVIDENCED because the list held proven and PROVEN but not Proven. Earlier the
89 // same day "WITNESSED on real OVMF" was refused for the same reason, and I patched THAT by adding
90 // two more casing variants, which is playing whack-a-mole with a class instead of closing it.
91 // -- A RULER WHOSE VERDICT TURNS ON CAPITALISATION TEACHES AUTHORS TO WRITE FOR THE CHECKER.
92 // Case-folding the comparison removes the whole class and shortens the list at the same time.
93 if swc_has_ci(note, "gate" as *u8) == 1 { return 1 }
94 if swc_has_ci(note, "measured" as *u8) == 1 { return 1 }
95 if swc_has_ci(note, "proven" as *u8) == 1 { return 1 }
96 if swc_has_ci(note, "witness" as *u8) == 1 { return 1 }
97 // Dates carry no case, so they stay on the exact matcher.
98 if swc_has(note, "2026-" as *u8) == 1 { return 1 }
99 if swc_has(note, "2025-" as *u8) == 1 { return 1 }
100 return 0
101}
102// ---- REFERENCES (2026-08-18): the citations rung PORTED from nx_swcompare_matrix (refs_pass, shipped 2026-08-17)
103// so the sota-class domains render the same research-paper References section as the matrix domains.
104// knowledge/compare/<dom>.refs rows:
105// ref|<key>|<citation prose>|<url>|<library mirror or ->|<content pin or ->|<accessed or ->|<evidence class>|<grounds>
106// A domain without a .refs file emits BYTE-IDENTICALLY (absent file = no-op by construction). Inline [@key]
107// marks in axis notes render as keyed cites (wnote); no pre-existing note carries that token.
108// SOURCE OF TRUTH for this block is nx_swcompare_matrix.nx (rp_*/refs_pass) -- keep the two in step; the pair
109// of generators already carries duplicated helpers (w/wc/kv_s/splitpipe/...), and this block joins that
110// same pattern rather than adding a third shape. The gate nx_compare_refs_gate measures the DATA either way.
111// PUBLISH-THEN-LINK: knowledge/library has NO public route, so each cited mirror is copied into the domain's
112// own docroot (refs/<basename>, atomic tmp+rename via sys_read_file which sizes from the file) and linked
113// THERE. Fail-safe direction: a mirror it cannot read or fully write renders as plain text -- never a dead link.
114// The References preamble is the ONE thing this generator and nx_swcompare_matrix did not share in rp_html
115// (h2 class + the phrase naming the notes). It is a per-generator DATUM now, so the row-emit body is
116// byte-identical across both and nx_oo_extract can move it to the shared lib.
117const RP_HDR: *u8 = "<h2 class='ghead' id='refs'>References</h2>\n<div class='meth'><b>Beyond a link list.</b> Every reference below resolves twice — the publisher's copy and, where banked, the estate's own <b>non-rottable library mirror</b> with a <b>content pin</b> — and carries its <b>evidence class</b> plus the exact claim on this page it grounds. Keyed marks like <span class='cite'>[key]</span> in the axis notes jump here. A dash means honestly absent, never assumed.</div>\n<ol class='refs'>\n" as *u8
118// rp_html lives in nx_swcompare_lib.nx since 2026-08-23 (one copy; header passed as RP_HDR).
119// ---- MEASURED BINDINGS (2026-09-01): THE HAND GRADE CAN NAME THE SYMBOL ITS CLAIM RESTS ON ----
120// WHY. A sota page is hand-graded, so it rots the moment an organ ships: lang.sota still said "no LSP,
121// formatter, incremental builds or stepping debugger" a week after all four landed, and the banked record shows
122// a seat hand-correcting three of its cells on 2026-08-23 only for the same class to recur by 2026-09-01. The
123// matrix beside it never rotted, because a matrix cell is MEASURED against a symbol on disk on every publish.
124// A HAND-GRADED CELL THAT NOBODY RE-MEASURES IS A CLAIM WITH AN EXPIRY DATE NOBODY RECORDED.
125// THE GRAMMAR, strictly additive: a grade row may carry ONE extra field immediately before its note, spelled
126// `=<symbol>` (the organ is then owned by the sibling .matrix row that carries that symbol -- ONE owner of organ
127// paths, never a second copy) or `=<organ-path>:<symbol>` (self-contained, for a sota domain with no matrix).
128// A row without that field is untouched; the note stays the LAST field exactly as before.
129// THE MEASUREMENT is the ONE symbol ruler (nx_symdecl_lib sd_present -- the same function the matrix page, the
130// watch plane and the ranker use), so a sota cell and a matrix cell about the same symbol cannot disagree.
131// THE DRIFT CLASSES, each named on the page, in api.json and on the census line:
132// CONSISTENT the grade and the measurement agree (present with Best/Yes/Part, or absent with No)
133// STALE-UNDER grade No, symbol PRESENT -- the page under-reports; published WITH the badge (an under-claim
134// is not a lie) and named by the gate until the grade is raised
135// UNBACKED grade Best/Yes/Part, symbol ABSENT -- an over-claim; REFUSES to publish, the liar-kill class
136// UNRESOLVED the binding names a symbol no matrix row carries (or a path with no colon and no matrix)
137// UNREADABLE the bound organ cannot be read -- I could not look is not it is absent
138// unbacked > 0 refuses; the other four announce and count. A page with zero bindings is byte-identical.
139const BD_DRIFT_NONE: i64 = 0
140const BD_DRIFT_CONSISTENT: i64 = 1
141const BD_DRIFT_STALE_UNDER: i64 = 2
142const BD_DRIFT_UNBACKED: i64 = 3
143const BD_DRIFT_UNRESOLVED: i64 = 4
144const BD_DRIFT_UNREADABLE: i64 = 5
145const BD_MEAS_UNRESOLVED: i64 = 0 - 2
146func bd_drift_name(d: i64) -> *u8 {
147 if d == BD_DRIFT_CONSISTENT { return "CONSISTENT" as *u8 }
148 if d == BD_DRIFT_STALE_UNDER { return "STALE-UNDER" as *u8 }
149 if d == BD_DRIFT_UNBACKED { return "UNBACKED" as *u8 }
150 if d == BD_DRIFT_UNRESOLVED { return "UNRESOLVED" as *u8 }
151 if d == BD_DRIFT_UNREADABLE { return "UNREADABLE" as *u8 }
152 return "UNBOUND" as *u8
153}
154func bd_drift_class(d: i64) -> *u8 {
155 if d == BD_DRIFT_CONSISTENT { return "me" as *u8 }
156 if d == BD_DRIFT_STALE_UNDER { return "pa" as *u8 }
157 if d == BD_DRIFT_UNBACKED { return "dr" as *u8 }
158 return "ab" as *u8
159}
160func bd_meas_name(m: i64) -> *u8 {
161 if m == 1 { return "PRESENT" as *u8 }
162 if m == 0 { return "ABSENT" as *u8 }
163 if m == BD_MEAS_UNRESOLVED { return "UNRESOLVED" as *u8 }
164 return "UNREADABLE" as *u8
165}
166// grade badge (td) for kind=g cells. nc=1 -> Nishi column tint.
167func g_badge(fd: i64, v: *u8, nc: i64) -> i64 {
168 var cls: *u8 = "n" as *u8; var lab: *u8 = "No" as *u8
169 if v[0] == (66 as u8) { cls = "ex" as *u8; lab = "Best" as *u8 } // B
170 if v[0] == (89 as u8) { cls = "y" as *u8; lab = "Yes" as *u8 } // Y
171 if v[0] == (126 as u8) { cls = "p" as *u8; lab = "Part" as *u8 } // ~
172 w(fd, "<td class='b " as *u8); if nc == 1 { w(fd, "nc " as *u8) } w(fd, cls); w(fd, "'>" as *u8); w(fd, lab); w(fd, "</td>" as *u8)
173 return 0
174}
175
176func main(argc: i64, argv: *i64) -> i64 {
177 if argc < 2 { w(1, "usage: nx_swcompare_sota <domain> [html|json]\n" as *u8); sys_exit(1); return 1 }
178 let domain: *u8 = argv[1] as *u8
179 let cap: i64 = K_MAGIC_262144
180 let buf: *u8 = sys_mmap(cap)
181 let path: *u8 = sys_mmap(512)
182 var o: i64 = scopy(path, 0, "knowledge/compare/" as *u8); o = scopy(path, o, domain); o = scopy(path, o, ".sota" as *u8); path[o] = 0 as u8
183 let n: i64 = c_read(path, buf, cap)
184 if n <= 0 { w(1, "SOTA FILE MISSING\n" as *u8); sys_exit(1); return 1 }
185 // HASH BEFORE THE PARSER TOUCHES IT -- the row loop does `buf[e] = 0` to terminate each line
186 // and splitpipe NULs each field, so at JSON-emit time buf is NOT the file. Hashing it there
187 // published a value no consumer could reproduce from disk; nx_comparestale duly called all 46
188 // pages stale minutes after they were generated from those exact sources.
189 // A COMPARATOR AND A WRITER THAT DISAGREE ON CANONICAL FORM NEVER CONVERGE.
190 let src_hash: i64 = swc_src_hash(buf, n)
191 // AND DECLARE WHICH FILE THAT WAS -- see the matching note in nx_swcompare_matrix.nx.
192 let src_base: *u8 = sys_mmap(256)
193 var sbo: i64 = scopy(src_base, 0, domain); sbo = scopy(src_base, sbo, ".sota" as *u8); src_base[sbo] = 0 as u8
194 // the citations register beside the .sota: its OWN buffer, because buf holds the parsed rows (NUL-split, pointed into) until emit.
195 let refspath: *u8 = sys_mmap(512)
196 var rpo: i64 = scopy(refspath, 0, "knowledge/compare/" as *u8); rpo = scopy(refspath, rpo, domain); rpo = scopy(refspath, rpo, ".refs" as *u8); refspath[rpo] = 0 as u8
197 let rbuf: *u8 = sys_mmap(cap)
198
199 let MAXR: i64 = 96; let MAXF: i64 = 24
200 let cf: *i64 = sys_mmap(MAXF * 8) as *i64 // competitor column names
201 let rf: *i64 = sys_mmap(MAXR * MAXF * 8) as *i64 // per-row fields (label,kind,v0..,note)
202 let rcat: *i64 = sys_mmap(MAXR * 8) as *i64 // category name ptr per row
203 let rnf: *i64 = sys_mmap(MAXR * 8) as *i64 // field count per row
204 let rbind: *i64 = sys_mmap(MAXR * 8) as *i64 // measured binding text per row (0 = unbound)
205 let rmeas: *i64 = sys_mmap(MAXR * 8) as *i64 // 1 present, 0 absent, -1 unreadable, -2 unresolved
206 let rdrift: *i64 = sys_mmap(MAXR * 8) as *i64 // BD_DRIFT_*
207 let rrule: *i64 = sys_mmap(MAXR * 8) as *i64 // the symbol rule the ruler applied
208 let rorgan: *i64 = sys_mmap(MAXR * 8) as *i64 // resolved organ path per bound row
209 let rsym: *i64 = sys_mmap(MAXR * 8) as *i64 // resolved symbol per bound row
210 let fld: *i64 = sys_mmap(MAXF * 8) as *i64
211 var ncol: i64 = 0
212 var title: *u8 = "Comparison" as *u8
213 var sub: *u8 = 0 as *u8
214 var verdict: *u8 = 0 as *u8
215 var curcat: *u8 = "General" as *u8
216 var rown: i64 = 0
217
218 var p: i64 = 0
219 while p < n {
220 var e: i64 = p
221 while e < n { if buf[e] == (10 as u8) { break } e = e + 1 }
222 buf[e] = 0 as u8
223 let line: *u8 = (buf as i64 + p) as *u8
224 p = e + 1
225 if line[0] == (0 as u8) { } else { if line[0] == (35 as u8) { } else {
226 if line[0] == (64 as u8) {
227 if starts(line, "@title " as *u8) == 1 { title = (line as i64 + 7) as *u8 } else {
228 if starts(line, "@sub " as *u8) == 1 { sub = (line as i64 + 5) as *u8 } else {
229 if starts(line, "@verdict " as *u8) == 1 { verdict = (line as i64 + 9) as *u8 } else {
230 if starts(line, "@cols " as *u8) == 1 { ncol = splitpipe((line as i64 + 6) as *u8, cf, MAXF) } else {
231 if starts(line, "@cat " as *u8) == 1 { curcat = (line as i64 + 5) as *u8 } } } } }
232 } else {
233 let cnt: i64 = splitpipe(line, fld, MAXF)
234 if cnt >= (3 + ncol) { if rown < MAXR {
235 var k: i64 = 0
236 while k < cnt { rf[rown*MAXF + k] = fld[k]; k = k + 1 }
237 rnf[rown] = cnt; rcat[rown] = curcat as i64
238 rbind[rown] = 0
239 if cnt >= (4 + ncol) { let bf: *u8 = fld[2 + ncol] as *u8; if bf[0] == (61 as u8) { rbind[rown] = (bf as i64) + 1 } }
240 rown = rown + 1
241 } }
242 } } }
243 }
244
245 // ---- measure every binding ONCE, before the tally, so every emitter reads the same answer ----
246 var b_bound: i64 = 0; var b_consistent: i64 = 0; var b_stale: i64 = 0; var b_unbacked: i64 = 0; var b_unresolved: i64 = 0; var b_unreadable: i64 = 0
247 let mxpath: *u8 = sys_mmap(512)
248 var mxo: i64 = scopy(mxpath, 0, "knowledge/compare/" as *u8); mxo = scopy(mxpath, mxo, domain); mxo = scopy(mxpath, mxo, ".matrix" as *u8); mxpath[mxo] = 0 as u8
249 let mxl: *i64 = sys_mmap(16) as *i64
250 var mxb: *u8 = 0 as *u8
251 var mxn: i64 = 0
252 var mxtried: i64 = 0
253 let ospan: *i64 = sys_mmap(16) as *i64
254 let rl2: *i64 = sys_mmap(16) as *i64
255 var br0: i64 = 0
256 while br0 < rown {
257 rmeas[br0] = BD_MEAS_UNRESOLVED; rdrift[br0] = BD_DRIFT_NONE; rrule[br0] = 0
258 rorgan[br0] = ("" as *u8) as i64; rsym[br0] = ("" as *u8) as i64
259 if rbind[br0] != 0 {
260 b_bound = b_bound + 1
261 let bind: *u8 = rbind[br0] as *u8
262 var organ: *u8 = 0 as *u8
263 var sym: *u8 = bind
264 var ci: i64 = 0
265 while bind[ci] != (0 as u8) { if bind[ci] == (58 as u8) { break } ci = ci + 1 }
266 if bind[ci] == (58 as u8) { bind[ci] = 0 as u8; organ = bind; sym = (bind as i64 + ci + 1) as *u8 } else {
267 if mxtried == 0 { mxtried = 1; mxb = sys_read_file(mxpath, mxl); if (mxb as i64) != 0 { mxn = mxl[0] } }
268 if (mxb as i64) != 0 { if ml_find_matrix_organ(mxb, mxn, sym, 0, sd_slen(sym), ospan) == 1 {
269 let oc: *u8 = sys_mmap(ospan[1] + 8)
270 ml_span_cstr(mxb, ospan[0], ospan[1], oc, ospan[1] + 8)
271 organ = oc
272 } }
273 }
274 rsym[br0] = sym as i64
275 if (organ as i64) == 0 { b_unresolved = b_unresolved + 1; rdrift[br0] = BD_DRIFT_UNRESOLVED } else {
276 rorgan[br0] = organ as i64
277 let m: i64 = sd_present(organ, sym, rl2)
278 rmeas[br0] = m; rrule[br0] = rl2[0]
279 let g: *u8 = rf[br0*MAXF + 2] as *u8
280 var claims: i64 = 0
281 if g[0] == (66 as u8) { claims = 1 }
282 if g[0] == (89 as u8) { claims = 1 }
283 if g[0] == (126 as u8) { claims = 1 }
284 if m < 0 { b_unreadable = b_unreadable + 1; rdrift[br0] = BD_DRIFT_UNREADABLE } else {
285 if m == 1 { if claims == 1 { b_consistent = b_consistent + 1; rdrift[br0] = BD_DRIFT_CONSISTENT } else { b_stale = b_stale + 1; rdrift[br0] = BD_DRIFT_STALE_UNDER } }
286 else { if claims == 1 { b_unbacked = b_unbacked + 1; rdrift[br0] = BD_DRIFT_UNBACKED } else { b_consistent = b_consistent + 1; rdrift[br0] = BD_DRIFT_CONSISTENT } }
287 }
288 }
289 }
290 br0 = br0 + 1
291 }
292
293 // RIVAL-CLAIM PROVENANCE (2026-09-05, review RV9 second leg): the classifier the matrix page uses, over this dialect's
294 // letter grades -- rival cells are the grade columns after Nishi's (fld 3 .. 1+ncol), the note is the row's last field
295 var rv_rows: i64 = 0; var rv_cited: i64 = 0; var rv_uncited: i64 = 0
296 var rvr: i64 = 0
297 while rvr < rown {
298 let rvc0: i64 = rv_class_grades(rf[rvr*MAXF + rnf[rvr] - 1] as *u8, rf, rvr, MAXF, 3, ncol - 1)
299 if rvc0 != RV_NONE { rv_rows = rv_rows + 1 }
300 if rvc0 == RV_CITED { rv_cited = rv_cited + 1 }
301 if rvc0 == RV_UNCITED { rv_uncited = rv_uncited + 1 }
302 rvr = rvr + 1
303 }
304
305 // tally: over the GRADE axes, Nishi standing (col 0): best / behind. numeric axes counted separately.
306 var g_axes: i64 = 0; var nishi_best: i64 = 0; var nishi_no: i64 = 0; var num_axes: i64 = 0
307 var best_unevidenced: i64 = 0
308 var r: i64 = 0
309 while r < rown {
310 let kind: *u8 = rf[r*MAXF + 1] as *u8
311 if streq(kind, "num" as *u8) == 1 { num_axes = num_axes + 1 } else {
312 g_axes = g_axes + 1
313 let nv: *u8 = rf[r*MAXF + 2] as *u8
314 if nv[0] == (66 as u8) {
315 nishi_best = nishi_best + 1
316 // A Best must CITE something checkable. The note is the last field of the row.
317 let nnote: *u8 = rf[r*MAXF + (rnf[r]-1)] as *u8
318 if swc_note_has_evidence(nnote) == 0 { best_unevidenced = best_unevidenced + 1 }
319 }
320 if nv[0] == (110 as u8) { nishi_no = nishi_no + 1 }
321 }
322 r = r + 1
323 }
324
325 var html: i64 = 0; var jsonm: i64 = 0
326 if argc >= 3 { if streq(argv[2] as *u8, "html" as *u8) == 1 { html = 1 } }
327 if argc >= 3 { if streq(argv[2] as *u8, "json" as *u8) == 1 { jsonm = 1 } }
328
329 if jsonm == 1 {
330 wc(1, 123)
331 kv_n(1, "v" as *u8, 1); wc(1, 44); kv_s(1, "api" as *u8, "nishi-compare" as *u8); wc(1, 44)
332 kv_s(1, "domain" as *u8, domain); wc(1, 44); kv_s(1, "kind" as *u8, "sota" as *u8); wc(1, 44)
333 kv_s(1, "title" as *u8, title); wc(1, 44)
334 wq(1); w(1, "columns" as *u8); wq(1); wc(1, 58); wc(1, 91)
335 var cj: i64 = 0
336 while cj < ncol { if cj > 0 { wc(1, 44) } wq(1); wj(1, cf[cj] as *u8); wq(1); cj = cj + 1 }
337 wc(1, 93); wc(1, 44)
338 wq(1); w(1, "axes" as *u8); wq(1); wc(1, 58); wc(1, 91)
339 var rj: i64 = 0
340 while rj < rown {
341 if rj > 0 { wc(1, 44) }
342 wc(1, 123)
343 kv_s(1, "category" as *u8, rcat[rj] as *u8); wc(1, 44)
344 kv_s(1, "label" as *u8, rf[rj*MAXF + 0] as *u8); wc(1, 44)
345 kv_s(1, "kind" as *u8, rf[rj*MAXF + 1] as *u8); wc(1, 44)
346 wq(1); w(1, "cells" as *u8); wq(1); wc(1, 58); wc(1, 91)
347 var ci: i64 = 0
348 while ci < ncol { if ci > 0 { wc(1, 44) } wq(1); wj(1, rf[rj*MAXF + 2 + ci] as *u8); wq(1); ci = ci + 1 }
349 wc(1, 93); wc(1, 44)
350 kv_s(1, "note" as *u8, rf[rj*MAXF + (rnf[rj]-1)] as *u8)
351 if rbind[rj] != 0 {
352 wc(1, 44); kv_s(1, "bind_organ" as *u8, rorgan[rj] as *u8); wc(1, 44); kv_s(1, "bind_symbol" as *u8, rsym[rj] as *u8)
353 wc(1, 44); kv_s(1, "measured" as *u8, bd_meas_name(rmeas[rj])); wc(1, 44); kv_s(1, "rule" as *u8, sd_rule_name(rrule[rj]))
354 wc(1, 44); kv_s(1, "drift" as *u8, bd_drift_name(rdrift[rj]))
355 }
356 wc(1, 125)
357 rj = rj + 1
358 }
359 wc(1, 93); wc(1, 44)
360 wq(1); w(1, "summary" as *u8); wq(1); wc(1, 58); wc(1, 123)
361 kv_n(1, "competitors" as *u8, ncol - 1); wc(1, 44); kv_n(1, "axes" as *u8, rown); wc(1, 44)
362 kv_n(1, "quantitative_axes" as *u8, num_axes); wc(1, 44); kv_n(1, "nishi_best" as *u8, nishi_best); wc(1, 44); kv_n(1, "nishi_absent" as *u8, nishi_no)
363 wc(1, 44); kv_n(1, "bound" as *u8, b_bound); wc(1, 44); kv_n(1, "consistent" as *u8, b_consistent); wc(1, 44); kv_n(1, "stale_under" as *u8, b_stale)
364 wc(1, 44); kv_n(1, "unbacked" as *u8, b_unbacked); wc(1, 44); kv_n(1, "unresolved" as *u8, b_unresolved); wc(1, 44); kv_n(1, "unreadable" as *u8, b_unreadable)
365 wc(1, 44); kv_n(1, "rival_rows" as *u8, rv_rows); wc(1, 44); kv_n(1, "rival_cited" as *u8, rv_cited); wc(1, 44); kv_n(1, "rival_uncited" as *u8, rv_uncited)
366 wc(1, 125); wc(1, 44)
367 kv_n(1, "generated_unix" as *u8, sys_now_realtime_sec()); wc(1, 44)
368 kv_s(1, "source_file" as *u8, src_base); wc(1, 44); kv_n(1, "source_hash" as *u8, src_hash); wc(1, 44)
369 kv_s(1, "measurement" as *u8, "quantitative axes = measured/published numbers (Nishi col measured, competitors researcher-sourced READMEs/blogs); grade axes B=Best Y=Yes ~=Part n=No; every axis carries a note/source. Per-domain honest verdict = the @verdict directive in each <domain>.sota; Nishi leads on sovereignty + bit-exact determinism; sub-SOTA axes are filed frontier rungs with owners (never 'by design'), deviations only as measured exceed bets." as *u8)
370 wc(1, 44); wq(1); w(1, "ppp" as *u8); wq(1); wc(1, 58); ppp_pass(domain, 1, 2)
371 refs_pass(refspath, rbuf, cap, 2, domain, RP_HDR)
372 // THE EVIDENCE PROFILE, MACHINE-READABLE (F1208). ONE renderer in nx_swcompare_lib, both
373 // generators call it, so a sota board and a matrix board publish the SAME evidence dialect read
374 // from the SAME stamp by the SAME reader. It abstains explicitly on a v1 stamp.
375 // EMITTED HERE, BEFORE watch, AND THAT ORDER IS LOAD-BEARING. hub_wcount in nx_swcompare_hub
376 // scans from the watch key TO THE END OF THE DOCUMENT counting status tokens, and says so in
377 // its own comment: watch is the LAST key the sota generator emits, written down there because
378 // it is an assumption a later-added key would break. This object carries an evidence_status
379 // field (renamed from status for exactly this reason), and emitting it after watch would still
380 // have falsified that stated invariant. Keeping it before watch leaves the invariant TRUE
381 // rather than quietly relying on a rename to make the breach harmless.
382 evj_pass(domain)
383 // MEASURED HEAD-TO-HEAD RECEIPT (2026-09-01): before watch, which must stay the LAST key (hub_wcount)
384 bench_pass(domain, 1, 2)
385 // FOREIGN ASSETS (sovereignty SV13, 2026-09-16): <dom>.assets rides in api.json through the one reader; before watch, which stays the LAST key
386 assets_pass(domain, 1, 2)
387 // MINED INTELLIGENCE (intelmine IM3): <dom>.proposed rides in api.json through the one reader; absent file = no key
388 prop_pass(domain, 1, 2)
389 // THE DISCOVERED FIELD (fieldwatch FW1, 2026-09-05): <dom>.field rides in api.json through the one reader; absent file = no key. No @cols on a sota page, so no column-coverage arithmetic here.
390 field_pass(domain, 1, 2, 0 as *i64, 0)
391 // GAUGE HEARTBEATS (codeeffectiveness CE9, 2026-09-06): <dom>.gauge rides in api.json through the one ruler; a stale gauge carries no value key
392 gauge_pass(domain, 1, 2)
393 gaps_pass(domain, 1, 2)
394 // WATCH CONTRACTS AS DATA (2026-08-23, lane L): when a .matrix sits beside the .sota, its symbol
395 // rows ride in api.json with their MEASURED status (the one ruler, nx_symdecl_lib) -- additive,
396 // and byte-identical for every sota domain that has no .matrix.
397 let wmpath: *u8 = sys_mmap(512)
398 var wmo: i64 = scopy(wmpath, 0, "knowledge/compare/" as *u8)
399 wmo = scopy(wmpath, wmo, domain); wmo = scopy(wmpath, wmo, ".matrix" as *u8); wmpath[wmo] = 0 as u8
400 let wmfd: i64 = sys_openat_rd(wmpath)
401 if wmfd >= 0 { sys_close(wmfd); wc(1, 44); wq(1); w(1, "watch" as *u8); wq(1); wc(1, 58); watch_pass(wmpath, 1, 2) }
402 wc(1, 125); wc(1, 10)
403 sys_exit(0); return 0
404 }
405
406 if html == 1 {
407 w(1, "<" as *u8); wc(1, 33); w(1, "DOCTYPE html>\n<html lang='en'><head><meta charset='utf-8'><meta name='viewport' content='width=device-width, initial-scale=1'>\n" as *u8)
408 sc_feed_link(1)
409 w(1, "<title>Nishi vs the Field -- " as *u8); w(1, title); w(1, " (SOTA)</title>\n<style>\n" as *u8)
410 // PALETTE CONSOLIDATED 2026-08-27. This line was a SECOND design SSOT: eleven hardcoded rgb()
411 // literals defining the same token names nx_swcompare_matrix already takes from nx_brand_tokens
412 // through sc_theme_pass. Two palettes for one house design drift the moment either side is
413 // touched, and nothing compares them -- the duplicate-ruler defect living in the emitted CSS.
414 // IT WAS ALSO DARK-ONLY: a bare :root with no prefers-color-scheme block, so every sota page
415 // ignored the viewer's theme by construction.
416 // NOTHING IS LOST AND NOTHING WAS CHOSEN BY TASTE. sota's four status colours were moved into the
417 // brand SSOT as the DARK rows of ok/part/absent/exceed, and compute+office's light equivalents
418 // became the LIGHT rows -- so each page keeps the exact colour it renders today in the theme it
419 // actually renders in, and gains the other theme. That also dissolves the one genuine conflict:
420 // --n is a muted grey here and an alarm red there, which is not a disagreement but two themes.
421 // sc_theme_pass is fail-closed (it exits rather than emit a zero, truncated or theme-blind
422 // palette), so adopting it cannot silently ship a page with no colours.
423 sc_theme_pass(1)
424 // LAYOUT COMES FROM THE ONE EMITTER (2026-08-31). This line used to hardcode max-width:980px
425 // and a second clamp() straight over --nx-layout-gutter, so every sota page DEFINED both layout
426 // tokens in :root and READ NEITHER -- and rendered as a single narrow column down the middle of
427 // any wide display. sc_layout_pass emits the page shell, the responsive .caps grid and the card
428 // container query from the same SSOT tokens sc_theme_pass already published above.
429 sc_layout_pass(1)
430 w(1, ".eyebrow{letter-spacing:.14em;text-transform:uppercase;font-size:.72rem;color:var(--mut);margin:22px 0 6px}.eyebrow b{color:var(--ac);font-weight:600}h1{font-size:clamp(1.7rem,4vw,2.3rem);line-height:1.15;margin:0 0 8px;color:var(--fg);text-wrap:balance}.sub{color:var(--mut);font-size:clamp(.93rem,2vw,1.02rem);margin:0 0 8px;max-width:74ch}.crumb{font-size:.82rem;margin:14px 0 2px;color:var(--mut)}a{color:var(--ac)}\n" as *u8)
431 w(1, ".meth{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px 18px;margin:16px 0;font-size:.88rem;color:var(--mut)}.meth b{color:var(--fg)}\n" as *u8)
432 w(1, ".legend{display:flex;gap:12px;flex-wrap:wrap;font-size:.78rem;color:var(--mut);margin:12px 0 2px;align-items:center}.legend .k{display:inline-flex;gap:6px;align-items:center}\n" as *u8)
433 w(1, ".dot{display:inline-block;width:13px;height:13px;border-radius:4px;background:rgb(52,62,88)}.dot.ex{background:var(--ex)}.dot.y{background:var(--y)}.dot.p{background:var(--p)}.dot.n{background:rgb(52,62,88)}\n" as *u8)
434 w(1, ".ghead{letter-spacing:.13em;text-transform:uppercase;font-size:.72rem;color:var(--ac);margin:28px 0 2px;font-weight:650;border-bottom:1px solid var(--line);padding-bottom:6px}\n" as *u8)
435 // .cap's GRID, BOX and BORDER now come from sc_layout_pass -- it is a card in a responsive
436 // auto-fill grid, so a wide display shows several capabilities side by side instead of one
437 // column. Two defects left with the old rule: the fixed 240px second track (which forced the
438 // single-column stack), and border-bottom:rgba(41,51,78,.55) -- a DARK-ONLY literal that the
439 // palette consolidation missed, near-invisible on the light theme. The shared card uses
440 // var(--line) and is correct in both. What stays here is TYPE only; cap-note's measure is now
441 // --nx-layout-measure so prose keeps a sane line length however wide the canvas gets.
442 w(1, ".cap-name{font-weight:600;color:var(--fg);font-size:.98rem;line-height:1.35;text-wrap:balance}.cap-note{color:var(--mut);font-size:.86rem;margin:3px 0 0;line-height:1.55}\n" as *u8)
443 w(1, ".fieldnums{color:var(--mut);font-size:.78rem;margin:8px 0 0;font-family:ui-monospace,Consolas,monospace;line-height:1.9}.fn{margin-right:14px;white-space:nowrap}.fn b{color:rgb(180,192,214);font-weight:600}\n" as *u8)
444 // .capside AND .rw's alignment are owned by sc_layout_pass: a wrapped ROW of chips while the
445 // card is narrow, a right-aligned COLUMN once the card is wide enough to seat the rail. They are
446 // deliberately NOT re-declared here -- an identical-specificity rule later in the same sheet
447 // beats the @container block above it, so re-stating them would silently kill the reflow while
448 // looking harmless. Only the chip TYPE belongs to this page.
449 w(1, ".st{font-size:.68rem;letter-spacing:.08em;text-transform:uppercase;font-weight:650;padding:4px 10px;border-radius:8px;display:inline-block;white-space:nowrap}.st.me{color:var(--y);background:rgba(121,224,167,0.1);border:1px solid rgba(121,224,167,0.35)}.st.ex{color:var(--ex);background:rgba(255,209,122,0.1);border:1px solid rgba(255,209,122,0.35)}.st.pa{color:var(--p);background:rgba(255,166,120,0.1);border:1px solid rgba(255,166,120,0.3)}.st.ab{color:var(--mut);background:rgba(150,162,186,0.08);border:1px solid rgba(150,162,186,0.25)}\n" as *u8)
450 w(1, ".bind{font-size:.76rem;color:var(--mut);margin:6px 0 0;font-family:ui-monospace,Consolas,monospace;line-height:1.5}.bind code{font-family:inherit;background:var(--soft);padding:1px 5px;border-radius:4px;color:var(--fg)}.bind.me b{color:var(--y)}.bind.pa b{color:var(--p)}.bind.dr b{color:var(--nx-color-absent)}.bind.ab b{color:var(--mut)}\n" as *u8)
451 w(1, ".nnum{font-size:1.35rem;font-weight:650;font-variant-numeric:tabular-nums;color:var(--fg)}.nl{font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;color:var(--mut)}.rw{display:flex;gap:4px;flex-wrap:wrap}\n" as *u8)
452 w(1, ".tally{margin:18px 0;font-size:.9rem}.badge{display:inline-block;padding:4px 12px;border-radius:999px;background:var(--panel);border:1px solid var(--line);margin-right:6px;font-size:.82rem;color:var(--mut)}.verdict{background:var(--panel);border:1px solid var(--line);border-left:4px solid var(--ac);padding:13px 18px;border-radius:0 12px 12px 0;margin:16px 0;font-size:.92rem;color:var(--mut)}.verdict b{color:var(--fg)}.foot{margin-top:26px;color:var(--mut);font-size:.76rem;border-top:1px solid var(--line);padding-top:12px;font-family:ui-monospace,Consolas,monospace}\n" as *u8)
453 w(1, ".refs{margin:6px 0 0;padding-left:0;list-style:none}.refs li{border-bottom:1px solid var(--line);padding:10px 0;font-size:13px;line-height:1.6;max-width:86ch}.rkey{font-family:ui-monospace,Consolas,monospace;font-size:11.5px;color:var(--ac);margin-right:6px}.rlinks{color:var(--mut);font-size:12px}.rlinks code{font-family:ui-monospace,Consolas,monospace;font-size:11px;background:var(--soft);padding:1px 5px;border-radius:4px;color:var(--fg)}.rgrade{font-size:10px;text-transform:uppercase;letter-spacing:.06em;border:1px solid var(--line);border-radius:4px;padding:1px 6px;color:var(--mut);white-space:nowrap}.rg{display:block;font-size:12px;color:var(--n);margin-top:3px}.cite{font-family:ui-monospace,Consolas,monospace;font-size:11px;text-decoration:none}\n" as *u8)
454 // THE 760px BREAKPOINT IS GONE ON PURPOSE. It was a THIRD ladder beside the estate's one
455 // 860/640 pair (nx_swcompare_lib SC_BP_MD/SC_BP_SM) -- a duplicate ruler wearing a constant,
456 // which nothing downstream could tell apart from the real ladder. It is also no longer the
457 // right SHAPE: the card now reflows on ITS OWN width via @container nxcap, so it stacks
458 // correctly inside a narrow column on a wide monitor, which a viewport media query cannot see.
459 // Leaving it would have been worse than redundant -- an identical-specificity rule later in the
460 // sheet, it would have overridden the container query and pinned every card to one column.
461 // THE PRINT SHEET GOES LAST (datavis DV7, 2026-09-15): order is its specificity -- see sc_print_css in nx_swcompare_lib
462 sc_print_css(1)
463 w(1, "</style></head><body>\n<main>\n" as *u8)
464 w(1, "<p class='crumb'><a href='/'>Nishi Family</a> › <a href='/compare'>Compare</a> › " as *u8); w(1, title); w(1, "</p>\n" as *u8)
465 w(1, "<p class='eyebrow'><b>Nishi Compare</b> · full-field SOTA · measured, not asserted</p>\n" as *u8)
466 w(1, "<h1>" as *u8); w(1, title); w(1, "</h1>\n<p class='sub'>Nishi vs the full field — every axis measured or researcher-sourced, grouped by category; each strip shows the whole field at a glance.</p>\n" as *u8)
467 if (sub as i64) != 0 { w(1, "<p class='sub' style='font-size:.9rem'>" as *u8); w(1, sub); w(1, "</p>\n" as *u8) }
468 w(1, "<div class='meth'><b>How this is scored.</b> This is a state-of-the-art comparison across the FULL competitor field: <b>quantitative</b> axes carry measured / published numbers (Nishi’s column is our own measurement, competitors are researcher-sourced), <b>grade</b> axes use Best / Yes / Part / No. Every axis carries a source note. No single vanity ‘coverage’ score — the honest picture is per-axis. Where Nishi is under SOTA, that is <b>filed work with an owner, never ‘by design’</b> (operator law: less-than-SOTA is never design) — every sub-SOTA axis maps to a frontier rung; the only legitimate divergence from the field is a <b>measured exceed bet</b> that carries its number (e.g. no-float determinism). The climb is the plan.</div>\n" as *u8)
469 w(1, "<div class='legend'><span class='k'>field, strip order:</span>" as *u8)
470 var hc: i64 = 1
471 while hc < ncol {
472 let lcn: *u8 = cf[hc] as *u8
473 w(1, "<span class='k'><span class='dot'></span>" as *u8); w(1, lcn); w(1, "</span>" as *u8)
474 hc = hc + 1
475 }
476 w(1, "<span class='k'>·</span><span class='k'><span class='dot ex'></span>Best</span><span class='k'><span class='dot y'></span>Yes</span><span class='k'><span class='dot p'></span>Part</span><span class='k'><span class='dot n'></span>No</span></div>\n" as *u8)
477 if b_bound > 0 {
478 w(1, "<div class='meth'><b>Measured bindings.</b> " as *u8); wn(1, b_bound); w(1, " of the Nishi grades on this page are bound to an organ and a symbol and re-measured on every publish by the one symbol ruler the matrix page, the ranker and the hive plane use. A grade of No over a symbol the organ carries reads <b>STALE-UNDER</b> (the page under-reports until the grade is raised); a grade of Yes, Best or Part over a symbol the organ does not carry reads <b>UNBACKED</b> and refuses to publish. consistent=" as *u8); wn(1, b_consistent); w(1, " stale_under=" as *u8); wn(1, b_stale); w(1, " unbacked=" as *u8); wn(1, b_unbacked); w(1, " unresolved=" as *u8); wn(1, b_unresolved); w(1, " unreadable=" as *u8); wn(1, b_unreadable); w(1, " (partition sums to bound).</div>\n" as *u8)
479 }
480 w(1, "<div class='caps'>\n" as *u8)
481 var lastcat: *u8 = 0 as *u8
482 var rr: i64 = 0
483 while rr < rown {
484 let cat: *u8 = rcat[rr] as *u8
485 var newcat: i64 = 0
486 if (lastcat as i64) == 0 { newcat = 1 } else { if streq(cat, lastcat) == 0 { newcat = 1 } }
487 if newcat == 1 { w(1, "<h2 class='ghead'>" as *u8); w(1, cat); w(1, "</h2>\n" as *u8); lastcat = cat }
488 let kind: *u8 = rf[rr*MAXF + 1] as *u8
489 let isnum: i64 = streq(kind, "num" as *u8)
490 w(1, "<div class='cap'><div class='capmain'><div class='cap-name'>" as *u8); w(1, rf[rr*MAXF + 0] as *u8)
491 w(1, "</div><p class='cap-note'>" as *u8); wnote(1, rf[rr*MAXF + (rnf[rr]-1)] as *u8); w(1, "</p>" as *u8)
492 if rbind[rr] != 0 {
493 w(1, "<p class='bind " as *u8); w(1, bd_drift_class(rdrift[rr])); w(1, "'>bound to <code>" as *u8); w(1, rorgan[rr] as *u8); w(1, ":" as *u8); w(1, rsym[rr] as *u8)
494 w(1, "</code> · measured " as *u8); w(1, bd_meas_name(rmeas[rr]))
495 if rrule[rr] > 0 { w(1, " (" as *u8); w(1, sd_rule_name(rrule[rr])); w(1, ")" as *u8) }
496 w(1, " · <b>" as *u8); w(1, bd_drift_name(rdrift[rr])); w(1, "</b>" as *u8)
497 if rdrift[rr] == BD_DRIFT_STALE_UNDER { w(1, " — the hand grade says No while the organ carries the symbol: this cell under-reports and stays flagged until the grade is raised" as *u8) }
498 if rdrift[rr] == BD_DRIFT_UNBACKED { w(1, " — the hand grade claims the capability while its organ does not carry the symbol: an unbacked claim" as *u8) }
499 w(1, "</p>" as *u8)
500 }
501 if isnum == 1 {
502 w(1, "<p class='fieldnums'>" as *u8)
503 var vc: i64 = 1
504 while vc < ncol {
505 let fcn: *u8 = cf[vc] as *u8
506 w(1, "<span class='fn'><b>" as *u8); w(1, fcn); w(1, "</b> " as *u8); w(1, rf[rr*MAXF + 2 + vc] as *u8); w(1, "</span>" as *u8)
507 vc = vc + 1
508 }
509 w(1, "</p>" as *u8)
510 }
511 w(1, "</div><div class='capside'>" as *u8)
512 if isnum == 1 {
513 w(1, "<div class='nnum'>" as *u8); w(1, rf[rr*MAXF + 2] as *u8); w(1, "</div><div class='nl'>Nishi, measured</div>" as *u8)
514 } else {
515 let nv: *u8 = rf[rr*MAXF + 2] as *u8
516 if nv[0] == (66 as u8) { w(1, "<span class='st ex'>BEST</span>" as *u8) } else {
517 if nv[0] == (89 as u8) { w(1, "<span class='st me'>YES</span>" as *u8) } else {
518 if nv[0] == (126 as u8) { w(1, "<span class='st pa'>PART</span>" as *u8) } else {
519 w(1, "<span class='st ab'>NO</span>" as *u8) } } }
520 w(1, "<div class='rw'>" as *u8)
521 var vc2: i64 = 1
522 while vc2 < ncol {
523 let cv: *u8 = rf[rr*MAXF + 2 + vc2] as *u8
524 let dcn: *u8 = cf[vc2] as *u8
525 w(1, "<span class='dot" as *u8)
526 if cv[0] == (66 as u8) { w(1, " ex" as *u8) } else { if cv[0] == (89 as u8) { w(1, " y" as *u8) } else { if cv[0] == (126 as u8) { w(1, " p" as *u8) } else { w(1, " n" as *u8) } } }
527 w(1, "' title='" as *u8); w(1, dcn); w(1, ": " as *u8)
528 if cv[0] == (66 as u8) { w(1, "Best" as *u8) } else { if cv[0] == (89 as u8) { w(1, "Yes" as *u8) } else { if cv[0] == (126 as u8) { w(1, "Part" as *u8) } else { w(1, "No" as *u8) } } }
529 w(1, "'></span>" as *u8)
530 vc2 = vc2 + 1
531 }
532 w(1, "</div>" as *u8)
533 }
534 w(1, "</div></div>\n" as *u8)
535 rr = rr + 1
536 }
537 w(1, "</div>\n" as *u8)
538 w(1, "<div class='tally'><span class='badge'>" as *u8); wn(1, ncol - 1); w(1, " competitors</span><span class='badge'>" as *u8); wn(1, rown); w(1, " axes</span><span class='badge'>" as *u8); wn(1, num_axes); w(1, " quantitative</span><span class='badge'>Nishi Best on " as *u8); wn(1, nishi_best); w(1, "</span>" as *u8)
539 if b_bound > 0 { w(1, "<span class='badge'>bound " as *u8); wn(1, b_bound); w(1, " · stale-under " as *u8); wn(1, b_stale); w(1, " · unbacked " as *u8); wn(1, b_unbacked); w(1, "</span>" as *u8) }
540 // RIVAL-CLAIM PROVENANCE (review RV9): the same three numbers the matrix page prints, in this page's badge row
541 if rv_rows > 0 { w(1, "<span class='badge'>rival marks " as *u8); wn(1, rv_rows); w(1, " · cited " as *u8); wn(1, rv_cited); w(1, " · uncited " as *u8); wn(1, rv_uncited); w(1, "</span>" as *u8) }
542 w(1, "</div>\n" as *u8)
543 if (verdict as i64) != 0 { w(1, "<div class='verdict'>" as *u8); wnote(1, verdict); w(1, "</div>\n" as *u8) } else {
544 w(1, "<div class='verdict'><b>Honest verdict.</b> Measured across the full field. Where Nishi is under SOTA, that is <b>filed work with an owner, never ‘by design’</b> (operator law: less-than-SOTA is never design) — every gap maps to a frontier rung, the climb is the plan (this domain-agnostic fallback shows only when a domain's .sota has no @verdict). Its genuine, unique wins are structural — the <b>whole stack is ours bits-up (own compiler, zero PyTorch / CUDA / BLAS)</b>, decode is <b>bit-exact deterministic</b>, and it has <b>trained a model without float</b> — measured exceed bets no engine in the field makes.</div>\n" as *u8)
545 }
546 // MEASURED HEAD-TO-HEAD RECEIPT (2026-09-01): rendered by the base for both generators; absent file = no section
547 bench_pass(domain, 1, 1)
548 // FOREIGN ASSETS (sovereignty SV13, 2026-09-16): <dom>.assets rendered by the base for both generators; absent file = no section
549 assets_pass(domain, 1, 1)
550 // MINED INTELLIGENCE (intelmine IM3, 2026-09-05): <dom>.proposed rows from nx_intelmine_propose, rendered by the base for both generators; absent file = no section
551 prop_pass(domain, 1, 1)
552 // THE DISCOVERED FIELD (fieldwatch FW1, 2026-09-05): <dom>.field rendered by the base for both generators; absent file = no section
553 field_pass(domain, 1, 1, 0 as *i64, 0)
554 // GAUGE HEARTBEATS (codeeffectiveness CE9, 2026-09-06): <dom>.gauge rendered by the base for both generators; a stale gauge reads STALE, never zero; absent file = no section
555 gauge_pass(domain, 1, 1)
556 gaps_pass(domain, 1, 1)
557 // the paper ends with its references; a domain without a .refs file emits byte-identically here
558 ppp_pass(domain, 1, 1)
559 refs_pass(refspath, rbuf, cap, 1, domain, RP_HDR)
560 w(1, "<p class='foot'>Generated by nx_swcompare_sota from knowledge/compare/" as *u8); w(1, domain); w(1, ".sota — quantitative axes measured/sourced; researcher-fed (nx_swcompare_research). Zero JS, zero trackers.</p>\n" as *u8)
561 // rung DG5 (2026-08-22) -- RENDER THE DOMAIN'S .plan. Until this call existed, a sota-kind domain
562 // could have its .plan admitted as data and then NEVER DRAWN: proven with full coverage
563 // (matches=0, files=11, corpus_complete=1). That is why the tool plane's own computed build order
564 // was invisible on its own page and nx_compare_rank looked like it had nothing to say there.
565 // plan_pass lives in nx_swcompare_lib.nx so BOTH generators render ONE dialect -- a second copy
566 // here would have drifted on the first row kind either side added.
567 // The file is RE-READ per phase because splitpipe NUL-terminates IN PLACE and would eat a second pass.
568 // AN ABSENT .plan IS A BYTE-IDENTICAL EMIT: plan_pass returns 0 without writing anything, so every
569 // sota domain that has no plan is untouched by construction and this ships without fleet-wide risk.
570 let planpath: *u8 = sys_mmap(512)
571 var plo: i64 = scopy(planpath, 0, "knowledge/compare/" as *u8)
572 plo = scopy(planpath, plo, domain); plo = scopy(planpath, plo, ".plan" as *u8); planpath[plo] = 0 as u8
573 let pbuf: *u8 = sys_mmap(cap)
574 plan_pass(planpath, pbuf, cap, 1)
575 plan_pass(planpath, pbuf, cap, 2)
576 plan_pass(planpath, pbuf, cap, 3)
577 // WATCH CONTRACTS, MEASURED (2026-08-23, lane L). A sota page used to render ONLY the hand-graded
578 // .sota cells, so a watch symbol landing in <dom>.matrix changed the ranker and the hive plane
579 // and NOT the page (measured on lang: LN2 landed, the page republished byte-identical). The
580 // section below is re-measured on every publish by the same ruler the ranker uses; an absent
581 // .matrix emits nothing, so every sota domain without one is byte-identical by construction.
582 let wmpath: *u8 = sys_mmap(512)
583 var wmo: i64 = scopy(wmpath, 0, "knowledge/compare/" as *u8)
584 wmo = scopy(wmpath, wmo, domain); wmo = scopy(wmpath, wmo, ".matrix" as *u8); wmpath[wmo] = 0 as u8
585 watch_pass(wmpath, 1, 1)
586 w(1, "</main></body></html>\n" as *u8)
587 sys_exit(0); return 0
588 }
589
590 w(1, "=== NX-SWCOMPARE-SOTA domain=" as *u8); w(1, domain); w(1, " ===\n" as *u8)
591 w(1, " title=" as *u8); w(1, title); w(1, " competitors=" as *u8); wn(1, ncol - 1); w(1, " (+Nishi) axes=" as *u8); wn(1, rown); w(1, " quantitative=" as *u8); wn(1, num_axes); w(1, "\n" as *u8)
592 w(1, " grade-axes=" as *u8); wn(1, g_axes); w(1, " Nishi-Best=" as *u8); wn(1, nishi_best); w(1, " Nishi-No=" as *u8); wn(1, nishi_no); w(1, "\n" as *u8)
593 var liar_cols: i64 = 0
594 if ncol >= 8 { liar_cols = 1 }
595 var liar_rows: i64 = 0
596 if rown >= 20 { liar_rows = 1 }
597 var liar_num: i64 = 0
598 if num_axes >= 3 { liar_num = 1 }
599 // EVIDENCE-COUNTED BESTS replace the No>=Best arithmetic (2026-08-14). See the note on
600 // swc_note_has_evidence: the old proxy refused a domain for LEADING and let unbacked Bests
601 // through behind a long No column. The verdict now turns on whether every Best cites
602 // something checkable. Both numbers are printed so the change is auditable and so a domain
603 // can see exactly which way it is failing.
604 var liar_honest: i64 = 0
605 if best_unevidenced == 0 { liar_honest = 1 }
606 w(1, " LIAR-KILL: cols>=8=" as *u8); wn(1, liar_cols); w(1, " rows>=20=" as *u8); wn(1, liar_rows); w(1, " quantitative>=3=" as *u8); wn(1, liar_num); w(1, " honest(every Best cites evidence)=" as *u8); wn(1, liar_honest); w(1, "\n" as *u8)
607 w(1, " BESTS: total=" as *u8); wn(1, nishi_best); w(1, " unevidenced=" as *u8); wn(1, best_unevidenced); w(1, " absents=" as *u8); wn(1, nishi_no); w(1, " (an unevidenced Best is the liar; the count of wins is not)\n" as *u8)
608 // NAME EVERY OFFENDER (2026-08-14). This gate COUNTED unevidenced Bests and refused the whole domain
609 // on that total without ever saying WHICH row was unbacked -- so the only remedy available to a reader
610 // was a hand search through every Best cell in the file. On the day this predicate tightened, FOUR
611 // domains (llm, foodscience, water, devguardrails) stopped publishing behind exactly that bare count,
612 // and the surface served their previous pages while the gate said only how many liars there were.
613 // -- A COUNT WITHOUT A WORKLIST IS NOT ACTIONABLE.
614 // A deliberate SECOND PASS: the tally above stays a pure count, and this runs only on the census path
615 // (the json and html emitters return long before here), so it can never contaminate an emitted artifact.
616 if best_unevidenced > 0 {
617 w(1, " UNEVIDENCED-BEST ROWS -- cite a gate, a dated measurement, a proof or a witness, or lower the grade:\n" as *u8)
618 var ur: i64 = 0
619 while ur < rown {
620 let ukind: *u8 = rf[ur*MAXF + 1] as *u8
621 if streq(ukind, "num" as *u8) == 1 { } else {
622 let unv: *u8 = rf[ur*MAXF + 2] as *u8
623 if unv[0] == (66 as u8) {
624 let unote: *u8 = rf[ur*MAXF + (rnf[ur]-1)] as *u8
625 if swc_note_has_evidence(unote) == 0 {
626 w(1, " - " as *u8); w(1, rf[ur*MAXF + 0] as *u8); w(1, "\n" as *u8)
627 }
628 }
629 }
630 ur = ur + 1
631 }
632 }
633 w(1, " BIND: bound=" as *u8); wn(1, b_bound); w(1, " consistent=" as *u8); wn(1, b_consistent); w(1, " stale_under=" as *u8); wn(1, b_stale); w(1, " unbacked=" as *u8); wn(1, b_unbacked); w(1, " unresolved=" as *u8); wn(1, b_unresolved); w(1, " unreadable=" as *u8); wn(1, b_unreadable); w(1, " (partition sums to bound; UNBACKED refuses, the rest publish with the badge and the gate names them)\n" as *u8)
634 var bo2: i64 = 0
635 while bo2 < rown {
636 if rbind[bo2] != 0 { if rdrift[bo2] != BD_DRIFT_CONSISTENT {
637 w(1, " - " as *u8); w(1, rf[bo2*MAXF + 0] as *u8); w(1, " [" as *u8); w(1, bd_drift_name(rdrift[bo2])); w(1, "] organ=" as *u8); w(1, rorgan[bo2] as *u8); w(1, " sym=" as *u8); w(1, rsym[bo2] as *u8); w(1, " measured=" as *u8); w(1, bd_meas_name(rmeas[bo2])); w(1, "\n" as *u8)
638 } }
639 bo2 = bo2 + 1
640 }
641 var liar_bound: i64 = 1
642 if b_unbacked > 0 { liar_bound = 0 }
643 let ok: i64 = liar_cols & liar_rows & liar_num & liar_honest & liar_bound
644 w(1, "NX-SWCOMPARE-SOTA domain=" as *u8); w(1, domain); w(1, " verdict=" as *u8)
645 if ok == 1 { w(1, "MEASURED-HONEST (SOTA-scale, liar-killed)\n" as *u8); sys_exit(0); return 0 }
646 w(1, "RED (too few competitors/axes, an unevidenced Best, or an UNBACKED bound grade -- see BIND above)\n" as *u8); sys_exit(1); return 1
647}