code wiki / _hdl_build / nx_craft_style_gate.nx

nx_craft_style_gate.nx

buildroot/runtime/_hdl_build/nx_craft_style_gate.nx

13497 B255 linesdepth 6pulls 33 transitivereach 0 importersview sourcekind gate/prooftopic craft
docsdependenciesstructsconstsfunctions

about

nx_craft_style_gate.nx -- THE REFEREE FOR "ART STYLE IS DATA" IN THE SERVED ENGINE (2026-09-01). SUBJECT: the P_STYLE spec word (idx 49) in nx_wasm_craft.nx and its wshade2 dispatch. WHAT IT PROVES, and the ORDER MATTERS: (1) the fixture REACHED the condition -- a real world was generated, a non-blank frame rendered, and the style the engine reports back is the style that was asked for -- BEFORE (2) any outcome about the frames is asserted. Asserting an outcome without first asserting the fixture reached the condition is how four fixtures in one day passed on cases the organ never examined. WHY THIS IS NOT A DUPLICATE RULER: _hdl_build/nx_world_style_gate.nx proves the SAME doctrine over nx_voxel_world -- a 320x240 library renderer with SEVEN importers, EVERY ONE OF THEM A GATE. Its subject is a renderer nothing ships. The subject HERE is the engine that renders nishifamily.com/world/*. The doctrine is the incumbent one; only the subject is new, and the three style ids are deliberately identical so the two cannot drift into two vocabularies for one idea. ANTI-VACUITY IS THE POINT: "the frames differ" is passed by ANY implementation that perturbs pixels, a broken one included. Two teeth here refuse that -- TOON must REDUCE tonal variety (that IS banding) and FLAT must REDUCE local high-frequency detail (that IS untexturing). A random perturbation raises both and dies on either. 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_style_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 ↻ sys_mmap ↻ cs_render cs_copy cs_nonsky cs_distinct cs_detail cs_luma gv_check gv_puts ↻ cs_same gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap cs_hash gv_verdict gv_note_bare_rate gv_bare_rate gv_at

structs

none

consts

23const CS_ARENA_SLACK: i64 = 4096
24const CS_SEED: i64 = 20260728
25const CS_IDENT_SHORE: i64 = 2 // the shore identity -- the operator review stage
26const CS_TICKS: i64 = 2 // enough to settle the first frame. This gate judges the
29const CS_Q: i64 = 4 // ray pixel size. NOT a quality choice and NOT tuned: every
33const CS_HIST_BITS: i64 = 4 // colour bucket = top 4 bits per channel -> 4096 buckets.
36const CS_HIST_N: i64 = 4096
37const CS_HIST_GS: i64 = 16
38const CS_HIST_RS: i64 = 256
39const CS_RGB24: i64 = 16777215 // the colour bits of a framebuffer word. The high bits carry
42const CS_BAD_STYLE: i64 = 7 // an id the engine does not own -- the neg-control input
43const CS_LUMA_R: i64 = 77 // Rec.601 luma in 1/256 units: 0.299/0.587/0.114 times 256
44const CS_LUMA_G: i64 = 150
45const CS_LUMA_B: i64 = 29
46const CS_LUMA_SH: i64 = 8
47const CS_PERMIL: i64 = 1000
48const CS_FNV_BASIS: i64 = 1469598103
49const CS_FNV_MUL: i64 = 31
50const CS_FNV_MOD: i64 = 1000000007
51const CS_TICK_MS: i64 = 16

functions

53func cs_luma(px: i64) -> i64
called by 1: cs_detail
61func cs_hash(fb: *i64, n: i64) -> i64
called by 1: main
67func cs_copy(dst: *i64, fb: *i64, n: i64) -> i64
called by 1: main
72func cs_same(a: *i64, b: *i64, n: i64) -> i64
called by 1: main
79func cs_distinct(fb: *i64, n: i64, hist: *i64) -> i64
called by 1: main
99func cs_detail(fb: *i64, w: i64, h: i64) -> i64
called by 1: main calls 1: cs_luma
119func cs_nonsky(fb: *i64, n: i64, sky: i64) -> i64
called by 1: main
128func cs_render(base: i64) -> i64
called by 1: main
140func main() -> i64