code wiki / _hdl_build / nx_editor_canvas_gate.nx
nx_editor_canvas_gate.nx
buildroot/runtime/_hdl_build/nx_editor_canvas_gate.nx
about
nx_editor_canvas_gate.nx -- the editor engine: snap/align/distribute/nudge, the ORIGINAL one-deep
snapshot undo, and the OPERATION-STACK adoption that gives the canvas real multi-level undo, redo,
bit-exact replay and re-evaluation at depth.
PART A IS A REGRESSION GUARD AND IS DELIBERATELY UNCHANGED. T1..T6 are the six assertions this gate
already made, on the same fixtures with the same expected numbers, exercising ec_snap_all / ec_align /
ec_distribute_h / ec_nudge / ec_save / ec_undo through the ORIGINAL direct-call path. They are also the
POSITIVE CONTROL for part B: if adopting the stack had broken the engine underneath, or if the new
guards refused work they should allow, these six would go red.
PART B PROVES THE ADOPTION, and its anti-vacuity tooth is T11. A one-deep snapshot passes a single
undo -- T9 alone cannot tell the two designs apart. Only undo-undo-undo followed by redo-redo-redo
separates a log from a snapshot, because the snapshot holds exactly one state and has nothing to
return to on the second call. T17 is the second anti-vacuity tooth: it proves the canvas the caller
renders IS the stack's own memory rather than a copy kept in step by hand.
100% sovereign. No hardware writes (Rule 26). expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_editstack_lib.nxnx_editor_canvas.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
| 23 | func eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 } called by 1: main |
| 24 | func ne(a: i64, b: i64) -> i64 { if a != b { return 1 } return 0 } called by 1: main |
| 25 | func put(c: *i64, i: i64, x: i64, y: i64, w: i64, h: i64) -> i64 { c[i*5+0]=0; c[i*5+1]=x; c[i*5+2]=y; c[i*5+3]=w; c[i*5+4]=h; return 0 } called by 1: main |
| 26 | func pv(label: *u8, v: i64) -> i64 { gv_puts(label); gv_num(v); gv_puts("\n" as *u8); return 0 } |
| 27 | func streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 34 | func main() -> i64 |