code wiki / _hdl_build / nx_craft_style_gate.nx
nx_craft_style_gate.nx
buildroot/runtime/_hdl_build/nx_craft_style_gate.nx
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
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
structs
| none |
consts
| 23 | const CS_ARENA_SLACK: i64 = 4096 |
| 24 | const CS_SEED: i64 = 20260728 |
| 25 | const CS_IDENT_SHORE: i64 = 2 // the shore identity -- the operator review stage |
| 26 | const CS_TICKS: i64 = 2 // enough to settle the first frame. This gate judges the |
| 29 | const CS_Q: i64 = 4 // ray pixel size. NOT a quality choice and NOT tuned: every |
| 33 | const CS_HIST_BITS: i64 = 4 // colour bucket = top 4 bits per channel -> 4096 buckets. |
| 36 | const CS_HIST_N: i64 = 4096 |
| 37 | const CS_HIST_GS: i64 = 16 |
| 38 | const CS_HIST_RS: i64 = 256 |
| 39 | const CS_RGB24: i64 = 16777215 // the colour bits of a framebuffer word. The high bits carry |
| 42 | const CS_BAD_STYLE: i64 = 7 // an id the engine does not own -- the neg-control input |
| 43 | const CS_LUMA_R: i64 = 77 // Rec.601 luma in 1/256 units: 0.299/0.587/0.114 times 256 |
| 44 | const CS_LUMA_G: i64 = 150 |
| 45 | const CS_LUMA_B: i64 = 29 |
| 46 | const CS_LUMA_SH: i64 = 8 |
| 47 | const CS_PERMIL: i64 = 1000 |
| 48 | const CS_FNV_BASIS: i64 = 1469598103 |
| 49 | const CS_FNV_MUL: i64 = 31 |
| 50 | const CS_FNV_MOD: i64 = 1000000007 |
| 51 | const CS_TICK_MS: i64 = 16 |
functions
| 53 | func cs_luma(px: i64) -> i64 called by 1: cs_detail |
| 61 | func cs_hash(fb: *i64, n: i64) -> i64 called by 1: main |
| 67 | func cs_copy(dst: *i64, fb: *i64, n: i64) -> i64 called by 1: main |
| 72 | func cs_same(a: *i64, b: *i64, n: i64) -> i64 called by 1: main |
| 79 | func cs_distinct(fb: *i64, n: i64, hist: *i64) -> i64 called by 1: main |
| 99 | func cs_detail(fb: *i64, w: i64, h: i64) -> i64 |
| 119 | func cs_nonsky(fb: *i64, n: i64, sky: i64) -> i64 called by 1: main |
| 128 | func cs_render(base: i64) -> i64 called by 1: main |
| 140 | func main() -> i64 |