code wiki / (root) / nx_pcb_gerber_gate.nx

nx_pcb_gerber_gate.nx

buildroot/runtime/nx_pcb_gerber_gate.nx

7453 B179 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic pcb
docsdependenciesstructsconstsfunctions

about

nx_pcb_gerber_gate.nx -- R1 GATE of the Omniforge PCB/EDA leg (the "chips" near-term path). Builds a small real board (pads + traces), emits a Gerber RS-274X copper layer via nx_pcb_gerber, writes the real .gbr artifact, then VERIFIES by INDEPENDENTLY reconstructing the canonical ASCII for every element from the integer model and asserting EXACT presence in the emitted bytes -- a true integer round-trip proving um -> format-units -> ASCII is exact with zero float drift. Counts D01/D02/D03 to confirm element totals, checks format/unit/end headers, and a NEGATIVE CONTROL: a coordinate off by 1um must be ABSENT (so the round-trip check has teeth = liar-kill). 100% sovereign, integer-only. Mirrors the nx_cad_test idiom (imports nx_syscalls + the organ). license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_pcb_gerber.nx nx_pcb_gerber_gate.nx

imports: nx_syscalls.nxnx_pcb_gerber.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 gerber_emit sys_mmap ↻ g_puts g_apdef g_puts ↻ g_puti sys_mmap ↻ g_mm6 g_puti ↻ g_puts ↻ g_sel g_puts ↻ g_puti ↻ g_xyd g_puts ↻ g_puti ↻ sn sys_write ↻ sys_mmap ↻ sys_openat_wr sys_write ↻ sys_close check sw ↻ contains slen expect_xyd sys_mmap ↻ g_xyd ↻ count_occur slen ↻ sys_exit

structs

none

consts

none

functions

13func 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
14func sn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
25func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: containscount_occur
28func contains(hay: *u8, haylen: i64, needle: *u8) -> i64
called by 1: main calls 1: slen
45func count_occur(hay: *u8, haylen: i64, needle: *u8) -> i64
called by 1: main calls 1: slen
62func expect_xyd(nb: *u8, x_um: i64, y_um: i64, d: i64) -> i64
called by 1: main calls 2: sys_mmapg_xyd
70func check(name: *u8, cond: i64, tot: *i64) -> i64
called by 1: main calls 1: sw
77func main() -> i64