code wiki / _hdl_build / _race6_team_author.nx

_race6_team_author.nx source

↩ module page · 55 lines · 2506 B

1// _race6_team_author.nx -- the BUILDER authoring the race-6 PNG lane from EMITTERS ONLY. 2// Race-6a uses the COVERED shapes as-is: emit8 v2 locator (two MAGIC4 rows + TAILREST = the 3// 8-byte PNG magic) + emit7 v2 WIRE_TLV (4/4 length-first BE -- NO trailing-CRC concept yet) 4// + emit9 v2 lane (locator + W= scalar). Whatever rows this lane loses against the Adversary's 5// grammar-staged PNG suite NAMES the emitter gap (grow-to-match, fourth instrumentation). 6// license_tier: ORIGINAL 7import "nx_pattern_emit7.nx" 8import "nx_pattern_emit8.nx" 9import "nx_pattern_emit9.nx" 10import "nx_syscalls.nx" 11 12func r6a_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 13 14func main() -> i64 { 15 // locator: MAGIC4(89504e47) MAGIC4(0d0a1a0a) TAILREST 16 let kinds: *i64 = sys_mmap(64) as *i64 17 let widths: *i64 = sys_mmap(64) as *i64 18 kinds[0] = 4; widths[0] = 0x89504e47 19 kinds[1] = 4; widths[1] = 0x0d0a1a0a 20 kinds[2] = 5; widths[2] = 0 21 let h: i64 = pe8_author_struct_walk2("_pe_pnghdr" as *u8, 22 "runtime/_hdl_build/_pe_pnghdr.nx" as *u8, 23 "runtime/_hdl_build/_pe_pnghdr_test.nx" as *u8, 24 kinds, widths, 3) 25 26 // core (COVERED v2): length-first 4/4 big-endian, no pad -- and NO trail concept 27 let spec: *i64 = sys_mmap(64) as *i64 28 spec[0] = 4; spec[1] = 4; spec[2] = 0; spec[3] = 0; spec[4] = 0 29 let a: i64 = pe7_author_wire_tlv2("_pe_png" as *u8, 30 "runtime/_hdl_build/_pe_png.nx" as *u8, 31 "runtime/_hdl_build/_pe_png_test.nx" as *u8, 32 spec) 33 34 // lane: census keys + locator + raw W= scalar (u32 BE at byte 16) as DATA 35 let types: *i64 = sys_mmap(64) as *i64 36 let labels: *i64 = sys_mmap(64) as *i64 37 types[0] = 0x49484452; labels[0] = "IHDR=" as *u8 as i64 38 types[1] = 0x49444154; labels[1] = "IDAT=" as *u8 as i64 39 types[2] = 0x49454e44; labels[2] = "IEND=" as *u8 as i64 40 let ext: *i64 = sys_mmap(64) as *i64 41 ext[0] = "NCHK=" as *u8 as i64 42 ext[1] = "_pe_pnghdr" as *u8 as i64 43 ext[2] = "W=" as *u8 as i64 44 ext[3] = 16; ext[4] = 4; ext[5] = 0 45 let l: i64 = pe9_author_census_lane2("runtime/_hdl_build/_pe_lane_png.nx" as *u8, 46 "_pe_png" as *u8, types, labels, 3, ext) 47 48 if h == 1 { if a == 1 { if l == 1 { 49 r6a_w("TEAM AUTHORED race-6a lane: _pe_pnghdr + _pe_png (NO trail concept) + _pe_lane_png -- covered shapes only\n" as *u8) 50 sys_exit(0) 51 } } } 52 r6a_w("author FAILED (spec refused?)\n" as *u8) 53 sys_exit(1) 54 return 1 55}