code wiki / _hdl_build / nx_sudoku_wasm_gate.nx
nx_sudoku_wasm_gate.nx
buildroot/runtime/_hdl_build/nx_sudoku_wasm_gate.nx
about
nx_sudoku_wasm_gate.nx -- native proof of the sovereign sudoku browser game (base-relative, so the
SAME code this drives with base=an mmap'd buffer is the code that runs in the browser with base=0).
INHERITS THE VERDICT BASE CLASS (gv_ctr/gv_head/gv_check/gv_verdict) rather than hand-rolling one.
The first version of this gate counted its own teeth and called sys_exit itself; /api/build REFUSED
it at the door (nx_gatedry: CUSTOM-VERDICT, L009/D001) and was right to. A hand-rolled counter can
print "passed 22/20", and a gate that returns a bare 0 after printing RED silently blesses every
failure it finds, because the control plane derives GREEN from the EXIT CODE. Inheriting makes
declared == executed by construction.
WHAT THIS GATE EXISTS TO STOP. A game module can pass every logic test and still render nothing --
absent drawing code has no failure mode, so a blank framebuffer looks exactly like a working one to
a logic-only suite. So there are teeth on the PIXELS as well as the rules, each with a control:
* render must produce many distinct colours (a blank or single-colour frame FAILS)
* the frame must DIFFER from a poisoned buffer (proves render WROTE, rather than the buffer
happening to already hold something)
* a digit must actually be drawn: placing a value must change the pixels inside THAT cell, and an
empty cell must measure exactly 0 ink, which is what stops a saturating measure passing
* and the anti-vacuity twin -- placing a value on a GIVEN must change NOTHING, pixels included
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_gate_verdict.nxnx_sudoku_wasm.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
| none |
functions
| 25 | func distinct_colors(base: i64, cap: i64) -> i64 |
| 48 | func cell_ink(base: i64, idx: i64) -> i64 |
| 67 | func first_empty(base: i64) -> i64 |
| 72 | func first_given(base: i64) -> i64 |
| 78 | func main() -> i64 |