code wiki / (root) / nx_printer_exceed.nx

nx_printer_exceed.nx

buildroot/runtime/nx_printer_exceed.nx

20898 B405 linesdepth 2pulls 6 transitivereach 2 importersview sourcekind librarytopic printer
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_ipp_codec.nx nx_printer_health.nx nx_ipp_submit.nx nx_printer_conform.nx nx_printer_exceed.nx nx_census_report.nx nx_printer_exceed_gate.nx

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

33const K_MAGIC_2048: i64 = 2048
34const K_MAGIC_2024: i64 = 2024
35const K_MAGIC_47176: i64 = 47176

functions

40func nx_obs_head(buf: *u8, pstate: i64, accepting: i64) -> i64
51func nx_obs_case1(buf: *u8) -> i64
59func nx_obs_case2(buf: *u8) -> i64
69func nx_obs_case3(buf: *u8) -> i64
78func nx_obs_case4(buf: *u8) -> i64
86func nx_obs_cases() -> i64 { return 4 } // # responses in the corpus
called by 1: main
87func nx_obs_ground_total() -> i64 { return 8 } // reasons ENCODED into the corpus (1+3+2+2) -- the oracle
called by 2: mainmain
88func nx_obs_baseline_total() -> i64 { return 4 } // documented vendor: exactly ONE headline per response
called by 2: mainmain
91func nx_obs_ours_total() -> i64
112func nx_obs_beats(ours_total: i64, ground_total: i64, base_total: i64) -> i64
called by 2: mainmain
121func nx_sec_adv1(buf: *u8) -> i64
127func nx_sec_adv2(buf: *u8) -> i64
141func nx_sec_adv3(buf: *u8) -> i64
151func nx_sec_adv4(buf: *u8) -> i64
159func nx_sec_adv5(buf: *u8) -> i64
173func nx_sec_adv_count() -> i64 { return 5 }
called by 2: mainmain
174func nx_sec_baseline_unsafe() -> i64 { return 1 } // documented CVE-K_MAGIC_2024-K_MAGIC_47176 RCE class (cited reference)
called by 2: mainmain
177func nx_sec_is_unsafe(verdict: i64) -> i64
183func nx_sec_ours_unsafe() -> i64
205func nx_sec_beats(ours_unsafe: i64, base_unsafe: i64) -> i64
called by 2: mainmain
213func nx_sec_naive_verdict(buf: *u8, n: i64) -> i64
called by 1: nx_sec_naive_unsafe
217func nx_sec_naive_unsafe() -> i64
240func nx_waste_req_carries_duplex() -> i64
247func nx_waste_default_carries_duplex() -> i64
called by 1: main calls 2: sys_mmapnx_ipp_set_contains
254func nx_sheets_two_sided(pages: i64) -> i64 { return (pages + 1) / 2 }
255func nx_sheets_one_sided(pages: i64) -> i64 { return pages }
257func nx_waste_jobs() -> i64 { return 5 } // realistic job-size corpus: 1, 2, 3, 10, 20 pages
258func nx_waste_ours_sheets() -> i64
called by 2: mainmain calls 1: nx_sheets_two_sided
261func nx_waste_vendor_sheets() -> i64
called by 2: mainmain calls 1: nx_sheets_one_sided
266func nx_waste_beats(realized: i64, ours_sheets: i64, vendor_sheets: i64) -> i64
called by 2: mainmain
280func nx_vnd_total() -> i64 { return 4 }
called by 2: mainmain
283func nx_vnd_build(buf: *u8, idx: i64, out_expect: *i64) -> i64
331func nx_vnd_ours_handled() -> i64
351func nx_vnd_locked_handled() -> i64
366func nx_vnd_beats(ours_handled: i64, locked_handled: i64, total: i64) -> i64
called by 2: mainmain
379func nx_conf_baseline_surfaced() -> i64 { return 0 } // documented: the vendor UI does NO conformance auditing
called by 2: mainmain
383func nx_conf_ours_surfaced() -> i64
401func nx_conf_beats(ours_surfaced: i64, baseline_surfaced: i64) -> i64
called by 2: mainmain