code wiki / _hdl_build / nx_pattern_emit9.nx
nx_pattern_emit9.nx
buildroot/runtime/_hdl_build/nx_pattern_emit9.nx
about
nx_pattern_emit9.nx -- PATTERN EMITTER: IO_CONTRACT census lane (shape 14 -- race-1's second
named growth rung: the lane BOILERPLATE Claude still wrote by hand). Authors a complete race
lane program from a spec: read the staged input (/tmp/race_input.bin = the race contract),
call the team-authored WIRE_TLV core (<core>_count / <core>_find), print the census as
key=value lines -- count key first, then one labeled body-offset per watched type, with the
REFUSED branch (-2 fields) when the walk refuses. Spec = core module name + parallel
types[]/labels[] tables (the keys are DATA, rule 11). After this emitter the TEAM lane in an
autonomy race is 100% emitted source: walker core (emit7) + locate (emit8) + lane (emit9) --
Claude's remaining touch is the ASSIGNMENT itself. REFUSAL RAILS: ntypes outside 1..8 or an
empty label -> spec REFUSED. Extends emit chain ..emit7(WIRE_TLV)/emit8(STRUCT_WALK).
LAWS: struct-free, integer-only, flat ifs, no &&/||, <=6 args per func. license_tier: ORIGINAL
dependencies 1 imports · 5 importers
imports: nx_syscalls.nx
imported by: _race5_team_author.nx_race5_team_author2.nx_race6_team_author.nxnx_pattern_emit10_demo.nxnx_pattern_emit89_demo.nx
structs
| none |
consts
| none |
functions
| 14 | func p9_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd, s, n); return 0 } |
| 15 | func p9_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 17 | func p9_spec_ok(types: *i64, labels: *i64, ntypes: i64) -> i64 |
| 31 | func p9_emit_print(fd: i64, label: *u8, tail: *u8) -> i64 |
| 41 | func pe9_emit_census_lane(fd: i64, corename: *u8, types: *i64, labels: *i64, ntypes: i64, count_label: *u8) -> i64 |
| 77 | func pe9_author_census_lane(modpath: *u8, corename: *u8, types: *i64, labels: *i64, ntypes: i64, count_label: *u8) -> i64 |
| 93 | func p9_spec2_ok(types: *i64, labels: *i64, ntypes: i64, ext: *i64) -> i64 |
| 111 | func p9_emit_refused(fd: i64, labels: *i64, ntypes: i64, ext: *i64) -> i64 |
| 122 | func pe9_emit_census_lane2(fd: i64, corename: *u8, types: *i64, labels: *i64, ntypes: i64, ext: *i64) -> i64 |
| 177 | func pe9_author_census_lane2(modpath: *u8, corename: *u8, types: *i64, labels: *i64, ntypes: i64, ext: *i64) -> i64 |