code wiki / (root) / nx_robot_step_gate.nx

nx_robot_step_gate.nx

buildroot/runtime/nx_robot_step_gate.nx

4934 B111 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic robot
docsdependenciesstructsconstsfunctions

about

nx_robot_step_gate.nx -- R-ROBO-1 GATE: multi-axis stepper step generation (the actuation primitive). Commands a synchronized 3-axis move (X=+20, Y=+8, Z=-5 steps), generates the pulse plan via nx_robot_step, and VERIFIES: each axis emits EXACTLY |delta| pulses, directions are correct, the final reconstructed position equals the target EXACTLY (integer, no drift), and the Bresenham invariant holds on every minor axis (max deviation == 0..nt, i.e. evenly distributed). NEGATIVE CONTROL: a deliberately front-loaded (non-Bresenham) sequence VIOLATES the invariant (deviation > nt), proving the evenness check has teeth. 100% sovereign, integer-only. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_robot_step.nx nx_robot_step_gate.nx

imports: nx_syscalls.nxnx_robot_step.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sw sys_write robot_step_plan sys_mmap ↻ sn sys_write ↻ sys_mmap ↻ check sw ↻ robot_step_count abs_i robot_step_max_dev sys_exit

structs

none

consts

none

functions

12func sw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: checkmain calls 1: sys_write
13func sn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
24func check(name: *u8, cond: i64, tot: *i64) -> i64
called by 1: main calls 1: sw
31func abs_i(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: main
33func main() -> i64