code wiki / _hdl_build / nx_sudoku_wasm_gate.nx

nx_sudoku_wasm_gate.nx

buildroot/runtime/_hdl_build/nx_sudoku_wasm_gate.nx

11305 B236 linesdepth 3pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic sudoku
docsdependenciesstructsconstsfunctions

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

nx_gate_verdict.nx nx_sudoku_wasm.nx nx_sudoku_wasm_gate.nx

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

main gv_head gv_puts sys_write 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 ↻ init_impl load_puzzle sc_gen sc_seed sc_put sc_clear sc_put ↻ sc_fill sc_get sc_fill ↻ sc_put ↻ sc_below sc_next sc_ok sc_get ↻ sc_copy sc_put ↻ sc_get ↻ sc_carve sc_put ↻

structs

none

consts

none

functions

25func distinct_colors(base: i64, cap: i64) -> i64
called by 1: main calls 2: wwhh
48func cell_ink(base: i64, idx: i64) -> i64
called by 1: main calls 1: ww
67func first_empty(base: i64) -> i64
called by 1: main calls 1: given
72func first_given(base: i64) -> i64
called by 1: main calls 1: given
78func main() -> i64