code wiki / _hdl_build / nx_craft_tile_gate.nx

nx_craft_tile_gate.nx

buildroot/runtime/_hdl_build/nx_craft_tile_gate.nx

14823 B276 linesdepth 6pulls 33 transitivereach 0 importersview sourcekind gate/prooftopic craft
docsdependenciesstructsconstsfunctions

about

nx_craft_tile_gate.nx -- GE30 REFEREE: the frame cut into row bands is BIT-IDENTICAL to the frame drawn by one thread, and a band writes NOTHING outside the rows it owns. WHY THIS SUBJECT NEEDS ITS OWN GATE. nx_wasm_craft_gate proves the WORLD (raycast ground truth, causal edits, determinism, the input edge contract) and nx_wasm_craft_vm_gate proves the SHIPPED WASM fits and paints inside the memory it declares. Neither can see the defect GE30 introduces: a frame assembled by N workers over ONE shared linear memory is correct only if the band pass writes disjoint pixels and reads no scratch its neighbour writes. The old renderer failed the second half by construction -- five wray outputs lived in ONE shared slot (O_ST 46-50), which is invisible with one thread and a race with two -- so the decomposition is the subject here. THE LOAD-BEARING TOOTH IS A FULL PIXEL COMPARE, NOT A DIGEST. Two fresh arenas, same seed, same camera: arena A drawn by render_impl (one thread, the shipped path), arena B drawn as N bands plus one overlay. Every word of the WRITTEN EXTENT must agree -- rw x rh, the compact buffer the one-pixel-per-ray law made the single owner of, never W*H, because a comparison over unwritten memory is a claim about uninitialised bytes. A tiling defect lives at BAND SEAMS, so the band counts include ones that do NOT divide the row count evenly, and a stride-sampling checksum is deliberately not used anywhere in this file. ANTI-VACUITY, STATED BECAUSE "IDENTICAL" IS THE EASIEST GREEN TO FAKE: two blank frames are also identical. So the gate first proves the frame is VARIED (many distinct colours) and that the overlay pass genuinely CHANGES pixels; only then does agreement mean anything. nx_craft_tile_gate license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_wasm_craft.nx nx_craft_tile_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_wasm_craft.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ ct_arena sys_mmap ↻ ct_distinct sys_mmap ↻ ct_extent ct_w sys_write ↻ ct_n gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_check gv_puts ↻ ct_identical ct_arena ↻ ct_banded ct_diff ct_extent ↻ ct_w ↻

structs

none

consts

29const CT_SEED: i64 = 20260728 // craft's shipped identity seed (wc_spec v0)
30const CT_SLACK: i64 = 4096 // arena slack, matching the sibling gates' allocation shape
31const CT_SENTINEL: i64 = 123456789 // a colour word the renderer never writes
32const CT_MIN_DISTINCT: i64 = 40 // the varied-frame floor the world gate already uses
33const CT_BUCKETS: i64 = 4096
34const CT_WARM: i64 = 12 // ticks before measuring: the camera settles onto the ground
35const CT_BANDS_A: i64 = 2
36const CT_BANDS_B: i64 = 3
37const CT_BANDS_C: i64 = 5
38const CT_BANDS_D: i64 = 7
39const CT_BANDS_E: i64 = 16

functions

41func ct_w(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: ct_identicalmain calls 1: sys_write
42func ct_n(v: i64) -> i64 { return gv_num(v) }
called by 2: ct_identicalmain calls 1: gv_num
44func ct_arena() -> i64
called by 2: ct_identicalmain calls 1: sys_mmap
54func ct_fill(base: i64, v: i64) -> i64
called by 1: main
60func ct_extent(base: i64) -> i64 { return wc_rw(base) * wc_rh(base) }
62func ct_diff(a: i64, b: i64) -> i64
called by 2: ct_identicalmain calls 1: ct_extent
72func ct_untouched(base: i64, v: i64) -> i64
called by 1: main calls 1: ct_extent
81func ct_untouched_past(base: i64, v: i64) -> i64
called by 1: main calls 1: ct_extent
90func ct_untouched_rows(base: i64, v: i64, y0: i64, y1: i64) -> i64
called by 1: main
102func ct_distinct(base: i64) -> i64
called by 1: main calls 2: sys_mmapct_extent
118func ct_banded(base: i64, nb: i64) -> i64
called by 2: ct_identicalmain
131func ct_identical(nb: i64, ctr: *i64, name: *u8) -> i64
142func main(argc: i64, argv: *i64) -> i64