code wiki / _hdl_build / nx_swebv_grade.nx
nx_swebv_grade.nx
buildroot/runtime/_hdl_build/nx_swebv_grade.nx
about
nx_swebv_grade.nx -- F787 rung-3 (sovereign half): THE SWE-bench Verified GRADER, Nishi first
byte up (operator law 2026-07-20: "we only use python or other stuff as oracles, nishi from the
first byte up"). Python/pytest NEVER computes the score -- it is an ORACLE that writes one verdict
row per instance into the results plane; THIS organ owns the contract: denominator = the swebvinst-
index (500 public instances), numerator = resolved rows in swebvres-, UNGRADED COUNTS AS UNRESOLVED
(the leaderboard contract), score = resolved*100/denominator, published atomically to the evidence
layer. HONESTY BY CONSTRUCTION: zero oracle rows -> verdict=UNMEASURED (never a fabricated 0 or
omission); missing instance index -> verdict=RED fail-loud.
nx_swebv_grade [instprefix] [resprefix] [outpath]
defaults: knowledge/store/swebvinst- knowledge/store/swebvres- knowledge/status/swebv_grade.log
results row contract: instance_id<TAB>verdict(resolved|unresolved|error)<TAB>epoch<TAB>oracle-id
(maintained via nx_store_put with id=instance_id -> id-replace = dedup at the store layer)
expect_exit: 0 (GREEN|UNMEASURED) | 1 RED license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_store_seed_lib.nxnx_seg_store.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 18 | const SG_CAP: i64 = 1048576 |
| 19 | const SG_OCAP: i64 = 8192 |
| 20 | const SG_PATHCAP: i64 = 256 |
| 21 | const SG_TAB: i64 = 9 |
| 22 | const SG_NL: i64 = 10 |
| 23 | const SG_STDERR: i64 = 2 |
| 24 | const SG_MODE: i64 = 0x1a4 |
| 25 | const SG_D0: i64 = 48 |
| 26 | const SG_B10: i64 = 10 |
| 27 | const SG_NUMB: i64 = 24 |
| 28 | const SG_EXIT_RED: i64 = 1 |
| 29 | const SG_R1: i64 = 114 // 'r' of resolved |
| 30 | const SG_E1: i64 = 101 // 'e' of error |
functions
| 32 | func sg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: sg_werr |
| 33 | func sg_werr(s: *u8) -> i64 { sys_write(SG_STDERR, s, sg_slen(s)); return 0 } |
| 34 | func sg_cat(d: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 40 | func sg_catn(d: *u8, off: i64, v: i64) -> i64 |
| 53 | func sg_lines(buf: *u8, n: i64) -> i64 called by 1: main |
| 69 | func sg_verdicts(buf: *u8, n: i64) -> i64 called by 1: main |
| 94 | func main(argc: i64, argv: *i64) -> i64 |