nx_printer_exceed.nx
buildroot/runtime/nx_printer_exceed.nx
about
nx_printer_exceed.nx -- MEASURED head-to-head bakeoffs that FEED the S-class census (nx_printer_census).
Per [[feedback-no-wave-measured-exceed]]: "MEASURED-EXCEEDS" must be a real number that beats a defensible
baseline -- NEVER self-scored. nx_census_report previously HAND-ASSERTED the (has_measure, beats_baseline)
flags for each axis; that is the integrity gap this organ closes. Here the flags are COMPUTED from real
measurements over real IPP byte corpora, and a negative control proves a silent/naive stack is REFUSED.
AXIS A anti-silent-failure (fault coverage):
Build realistic Get-Printer-Attributes responses (the live-Brother single-reason case + multi-fault
cases the vendor UI still collapses to ONE headline). Our stack must independently RECOVER (parse) the
number of printer-state-reasons present -- it is not told the answer -- and beat the vendor headline
(which surfaces exactly 1 condition per response, documented + live-observed: the panel said
"Replace Toner" while the IPP carried toner-low-warning + idle + accepting).
AXIS B security robustness (defensive parser):
Run an ADVERSARIAL corpus (truncated header, value-length overrun, name-length overrun, mid-attribute
truncation, oversized 1setOf value) through the real parser and COUNT unsafe outcomes. Unsafe = the
parser returned a confident status on malformed bytes (silent-accept), i.e. NOT the sealed UNKNOWN.
Ours = 0 by construction (bounds-checked, bounded loops, no shell-out path). Baseline = the DOCUMENTED
CVE-2024-47176 cups-browsed unauth RCE class (CVSS 9.9) -- a CITED reference yardstick, NOT run here
(running a 9.9 RCE would be reckless), exactly as git was a stated yardstick for the WMS exceed.
PURE measurement: builds byte buffers + runs the existing parser/health organs; only syscall is sys_mmap
for scratch. never-brick by construction. Sovereign: nx_cc -> nxasm, no gcc.
genealogy_id: project-printer-management-ipp-sclass-2026-06-20 ; [[feedback-author-by-organ-not-claude]]
license_tier: ORIGINAL
dependencies 5 imports · 2 importers
imports: nx_syscalls.nxnx_ipp_codec.nxnx_printer_health.nxnx_ipp_submit.nxnx_printer_conform.nx
imported by: nx_census_report.nxnx_printer_exceed_gate.nx
structs
| none |
consts
| 33 | const K_MAGIC_2048: i64 = 2048 |
| 34 | const K_MAGIC_2024: i64 = 2024 |
| 35 | const K_MAGIC_47176: i64 = 47176 |
functions
| 40 | func nx_obs_head(buf: *u8, pstate: i64, accepting: i64) -> i64 |
| 51 | func nx_obs_case1(buf: *u8) -> i64 |
| 59 | func nx_obs_case2(buf: *u8) -> i64 called by 1: nx_obs_ours_total calls 5: nx_obs_headnx_ipp_attrnx_ipp_strlennx_ipp_attr_addnx_ipp_end |
| 69 | func nx_obs_case3(buf: *u8) -> i64 called by 1: nx_obs_ours_total calls 5: nx_obs_headnx_ipp_attrnx_ipp_strlennx_ipp_attr_addnx_ipp_end |
| 78 | func nx_obs_case4(buf: *u8) -> i64 called by 1: nx_obs_ours_total calls 5: nx_obs_headnx_ipp_attrnx_ipp_strlennx_ipp_attr_addnx_ipp_end |
| 86 | func nx_obs_cases() -> i64 { return 4 } // # responses in the corpus called by 1: main |
| 87 | func nx_obs_ground_total() -> i64 { return 8 } // reasons ENCODED into the corpus (1+3+2+2) -- the oracle |
| 88 | func nx_obs_baseline_total() -> i64 { return 4 } // documented vendor: exactly ONE headline per response |
| 91 | func nx_obs_ours_total() -> i64 called by 2: mainmain calls 6: sys_mmapnx_obs_case1nx_printer_diagnosenx_obs_case2nx_obs_case3nx_obs_case4 |
| 112 | func nx_obs_beats(ours_total: i64, ground_total: i64, base_total: i64) -> i64 |
| 121 | func nx_sec_adv1(buf: *u8) -> i64 |
| 127 | func nx_sec_adv2(buf: *u8) -> i64 |
| 141 | func nx_sec_adv3(buf: *u8) -> i64 |
| 151 | func nx_sec_adv4(buf: *u8) -> i64 |
| 159 | func nx_sec_adv5(buf: *u8) -> i64 |
| 173 | func nx_sec_adv_count() -> i64 { return 5 } |
| 174 | func nx_sec_baseline_unsafe() -> i64 { return 1 } // documented CVE-K_MAGIC_2024-K_MAGIC_47176 RCE class (cited reference) |
| 177 | func nx_sec_is_unsafe(verdict: i64) -> i64 |
| 183 | func nx_sec_ours_unsafe() -> i64 called by 2: mainmain calls 8: sys_mmapnx_sec_adv1nx_sec_is_unsafenx_printer_diagnosenx_sec_adv2nx_sec_adv3+2 |
| 205 | func nx_sec_beats(ours_unsafe: i64, base_unsafe: i64) -> i64 |
| 213 | func nx_sec_naive_verdict(buf: *u8, n: i64) -> i64 called by 1: nx_sec_naive_unsafe |
| 217 | func nx_sec_naive_unsafe() -> i64 called by 1: main calls 8: sys_mmapnx_sec_adv1nx_sec_is_unsafenx_sec_naive_verdictnx_sec_adv2nx_sec_adv3+2 |
| 240 | func nx_waste_req_carries_duplex() -> i64 |
| 247 | func nx_waste_default_carries_duplex() -> i64 |
| 254 | func nx_sheets_two_sided(pages: i64) -> i64 { return (pages + 1) / 2 } called by 1: nx_waste_ours_sheets |
| 255 | func nx_sheets_one_sided(pages: i64) -> i64 { return pages } called by 1: nx_waste_vendor_sheets |
| 257 | func nx_waste_jobs() -> i64 { return 5 } // realistic job-size corpus: 1, 2, 3, 10, 20 pages |
| 258 | func nx_waste_ours_sheets() -> i64 |
| 261 | func nx_waste_vendor_sheets() -> i64 |
| 266 | func nx_waste_beats(realized: i64, ours_sheets: i64, vendor_sheets: i64) -> i64 |
| 280 | func nx_vnd_total() -> i64 { return 4 } |
| 283 | func nx_vnd_build(buf: *u8, idx: i64, out_expect: *i64) -> i64 |
| 331 | func nx_vnd_ours_handled() -> i64 |
| 351 | func nx_vnd_locked_handled() -> i64 |
| 366 | func nx_vnd_beats(ours_handled: i64, locked_handled: i64, total: i64) -> i64 |
| 379 | func nx_conf_baseline_surfaced() -> i64 { return 0 } // documented: the vendor UI does NO conformance auditing |
| 383 | func nx_conf_ours_surfaced() -> i64 called by 2: mainmain calls 10: sys_mmapnx_ipp_beginnx_ipp_groupnx_ipp_attr_intnx_ipp_attrnx_ipp_attr_add+4 |
| 401 | func nx_conf_beats(ours_surfaced: i64, baseline_surfaced: i64) -> i64 |