code wiki / _hdl_build / _ale_grade_gate.nx

_ale_grade_gate.nx

buildroot/runtime/_hdl_build/_ale_grade_gate.nx

9931 B205 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic ale
docsdependenciesstructsconstsfunctions

about

_ale_grade_gate.nx -- the ALE-R1a gate: sovereign DETERMINISTIC grader-runner core. Diff-lane / no-mocks: runs the REAL sovereign grader nx_ale_grade.elf (built by nx_cc_sovereign->nxasm_x86_main, NO gcc) over REAL fixtures and asserts ALL of: (1) SCORE-EXACT -- artifact byte-identical to the reference grading-units -> 1000 (2) SCORE-ZERO -- wholly-wrong artifact (no unit matches) -> 0 (3) SCORE-PARTIAL -- subset match (2 of 4 units) -> strict (0,1000), == 500 = (2*1000)/4 data-driven (4) BOUNDED -- every emitted score lies in [0,1000] inclusive (all four runs) (5) DETERMINISTIC -- two consecutive runs on the SAME triple+artifact+reference emit the IDENTICAL score (6) NO-LEAKAGE -- grading art_exact against the reference STAGED INTO A DISTINCT PATH (staged_after/ref.txt, which the artifact phase never saw) emits the IDENTICAL 1000 as grading against ref.txt -> score is a pure function of (reference, artifact), independent of when/where the reference existed TAMPER -- a NON-DETERMINISTIC grader stub (clock-derived score) is REJECTED: two runs on the same inputs emit DIFFERENT scores (determinism BITES) The score is read back from a scratch FILE the grader writes (decimal 0..1000), dodging the 0..255 process-exit-code ceiling. The grader's purity (no clock/rand) IS the oracle -- a pure code-grader needs no external oracle, exactly as ALE-R0a established; the tamper fixture is the negative control. Evidence -> knowledge/status/ale_grade.log (ALEGRADEGATE row; the queue row's ||MARK= reads it). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _ale_grade_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main g_p sys_write g_run sys_fork sys_openat_wr sys_dup3 sys_mmap sys_execve sys_exit sys_wait4 g_read sys_openat_rd sys_read sys_close g_parse_int g_fn sys_mmap ↻ sys_write ↻ sys_openat_append g_fp sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_close ↻ sys_exit ↻

structs

none

consts

none

functions

22func g_p(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
23func g_fp(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 }
called by 1: main calls 1: sys_write
24func g_fn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m }; let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48; k = 1 }; while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }; var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 }; sys_write(fd, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
27func g_read(path: *u8, buf: *u8, cap: i64) -> i64
44func g_parse_int(buf: *u8, n: i64) -> i64
called by 1: g_run
59func g_run(elf: *u8, ref: *u8, art: *u8, out: *u8) -> i64
86func main() -> i64