nx_printer_fw_sim_test.nx
buildroot/runtime/nx_printer_fw_sim_test.nx
about
nx_printer_fw_sim_test.nx -- the NEVER-BRICK gate (#26, brand-critical) for the firmware-flash simulator.
Proves MECHANICALLY (not by promise) that the A/B flash can never brick the virtual printer, by injecting
power loss at EVERY step x EVERY firmware quality and asserting the device ALWAYS boots something. A naive
in-place flash is the negative control: it CAN brick, so the gate is proven to DETECT bricking.
Unique exit codes:
1 EXHAUSTIVE: A/B flash never bricks (2 sig x 2 boots x 5 power-loss-steps = 20 scenarios)
2-5 specific outcomes (good->new active; mid-write->old; bad-sig->old rejected; bad-boot->rolled back)
10 NEGATIVE CONTROL: naive in-place flash CAN brick (single-bank, power loss mid-write)
11 and the SAFE A/B flash does NOT brick that same single-bank/power-loss case
expect_exit: 0 ; license_tier: ORIGINAL ; genealogy_id: project-printer-management-ipp-sclass-2026-06-20
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_printer_fw_sim.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
| none |
functions
| 15 | func t_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 18 | func scenario(st: *i64, sig: i64, boots: i64, step: i64) -> i64 |
| 26 | func main() -> i64 |