code wiki / _hdl_build / nx_look_compose_gate.nx
nx_look_compose_gate.nx
buildroot/runtime/_hdl_build/nx_look_compose_gate.nx
about
nx_look_compose_gate.nx -- pixel-truth gate for the sovereign LOOK composer (2026-07-29).
Builds three tiny synthetic panes IN MEMORY, writes them as BMPs, runs the real composer twice
(full strip + 2x crop), reads the composites back and asserts:
T1 full strip: pane0==src, pane1==a, pane2==b pixel-for-pixel; gutters + row-pad are WHITE
T2 crop+2x: every 2x2 output block == its source pixel (nearest, no resampling opinions)
T3 (negative) dim-mismatched inputs are REFUSED (nonzero rc), output absent
The composer is forked as a real process (the gate tests the SHIPPED path, not a code copy).
license: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 11 | const GW2: i64 = 16 |
| 12 | const GH2: i64 = 8 |
| 13 | const GUT: i64 = 4 |
| 14 | const HDRB: i64 = 1078 |
functions
| 16 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 17 | func gn(v: i64) -> i64 |
| 21 | func wr32le(b: *u8, off: i64, v: i64) -> i64 called by 1: bmp_write |
| 24 | func wr16le(b: *u8, off: i64, v: i64) -> i64 called by 1: bmp_write |
| 26 | func rd32le(b: *u8, off: i64) -> i64 called by 1: bmp_read |
| 29 | func bmp_write(path: *u8, luma: *u8, w: i64, h: i64) -> i64 |
| 52 | func bmp_read(path: *u8, wh: *i64) -> *u8 |
| 66 | func run_composer(a1: *u8, a2: *u8, a3: *u8, a4: *u8, cx: i64, cy: i64, cw: i64, ch: i64) -> i64 |
| 100 | func main() -> i64 |