nx_sclass_grader.nx source
↩ module page · 36 lines · 2061 B
1// nx_sclass_grader.nx -- HONEST grading of whether a capability is truly S-class EXCEED (operator).
2// This is the Critic applied to the "exceed" claim, and it is deliberately SKEPTICAL because the
3// team has overclaimed before (254 boolean wins -> honest 71; x*45 "exceed" -> a TIE once
4// triangulated vs clang). The bar for S is high and triangulated:
5// S_EXCEED : a VERIFIED head-to-head BEATS the BEST external alternative, AND was TRIANGULATED
6// (raced vs the actual best, not a strawman). beats-but-not-triangulated is DEMOTED to
7// parity (that is exactly how the x*45 overclaim died).
8// A_PARITY : verified, matches the best external.
9// B_BEHIND : verified, falls short of the best external.
10// P_PROCESS : no external head-to-head exists (internal/process/meta capability) -> cannot be S.
11// U_UNVERIFIED: claimed, not measured.
12// license_tier: ORIGINAL Refs: triangulation doctrine; the Critic.
13
14import "nx_syscalls.nx"
15
16const SG_U_UNVERIFIED: i64 = 0
17const SG_P_PROCESS: i64 = 1
18const SG_B_BEHIND: i64 = 2
19const SG_A_PARITY: i64 = 3
20const SG_S_EXCEED: i64 = 4
21
22// grade one capability. has_ext = is there an external best-in-class to race? verified = measured by
23// execution? beats = beat the best? triangulated = raced vs the ACTUAL best (not a strawman)?
24// matches = ties the best (when not beating).
25func sg_grade(has_ext: i64, verified: i64, beats: i64, triangulated: i64, matches: i64) -> i64 {
26 if has_ext == 0 { return SG_P_PROCESS } // no external race -> process, never S
27 if verified == 0 { return SG_U_UNVERIFIED }
28 if beats == 1 {
29 if triangulated == 1 { return SG_S_EXCEED }
30 return SG_A_PARITY // untriangulated "exceed" -> treat as parity (overclaim risk)
31 }
32 if matches == 1 { return SG_A_PARITY }
33 return SG_B_BEHIND
34}
35
36func sg_count(n: i64, grades: *i64, target: i64) -> i64 { var c: i64 = 0; var i: i64 = 0; while i < n { if grades[i] == target { c = c + 1 } i = i + 1 } return c }