code wiki / _hdl_build / nx_vnsprite_gate.nx
nx_vnsprite_gate.nx
buildroot/runtime/_hdl_build/nx_vnsprite_gate.nx
about
nx_vnsprite_gate.nx -- liar-kill gate for the VN sprite compositor (gamebench bit 13).
T1 Z-ORDER is real: at an overlap the higher-z layer's pixel wins; swapping z swaps the winner.
T2 ALPHA + KEY are exact: a 50% blend lands on the exact integer mix per channel, and a key-color
pixel is fully transparent (background shows through untouched).
T3 CLIPPING cannot write out of bounds: blits hanging off every edge leave 8 canary cells intact.
T4 EXPRESSION SWAP IS VISIBLE: base+smile vs base+frown differ in >=20 pixels; recomposing the
same expression twice differs in 0 (visible AND deterministic -- the VN beat that matters).
T5 SCENE STATE ROUND-TRIPS: the layer table through gs_save -> ZEROED -> gs_load -> recompose is
frame-checksum identical (parts doctrine: everything persists through the save part).
T6 DETERMINISM: the full scene composed twice is checksum-identical.
T7 ANTI-VACUITY: the composed scene differs from the bare background in >=500 px with >=5
distinct sprite colors (a compositor that draws nothing cannot pass).
T8 SCENE ARTIFACT: a full VN frame (gradient bg + two characters + alpha textbox + name tag) is
written as a sovereign PNG to knowledge/nx_vnsprite_scene.png -- the board's evidence.
T9 GROUP EXCLUSIVITY (the Ren'Py layeredimage bar, researched 2026-07-29): smile and frown are
two attributes of ONE group; a single vsp_setg call swaps them with no manual bookkeeping,
and exactly one is ever composed (probed at pixel level both ways).
T10 DISSOLVE EXACT: the core VN transition -- t=0 equals frame A, t=256 equals frame B (full-frame
checksums), and the t=128 midpoint is the exact integer channel mix at a probed pixel.
license_tier: ORIGINAL expect_exit: 0
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_estate_path.nxnx_vnsprite.nxnx_gamesave.nxnx_png.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
| 26 | const VG_B: i64 = 65536 |
| 27 | const VG_CANARY: i64 = 12345678 |
| 28 | const VG_STAMP: i64 = 20260729 |
| 29 | const VG_SCHEMA: i64 = 78 |
| 30 | const VG_W: i64 = 640 |
| 31 | const VG_H: i64 = 360 |
functions
| 33 | func hw3(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 34 | func hn3(v: i64) -> i64 |
| 45 | func mk_body(spr: *i64, sw: i64, sh: i64, key: i64, skin: i64, shirt: i64) -> i64 called by 1: main |
| 65 | func mk_expr(spr: *i64, sw: i64, sh: i64, key: i64, ink: i64, mode: i64) -> i64 called by 1: main |
| 82 | func fill_rect(fb: *i64, W: i64, H: i64, x0: i64, y0: i64, x1: i64, y1: i64, c: i64) -> i64 called by 1: fs_scene |
| 100 | func fs_layers(lay: *i64) -> i64 called by 1: main |
| 109 | func fs_bg(fb: *i64) -> i64 |
| 123 | func fs_scene(fb: *i64, sprites: *i64, sprw: *i64, sprh: *i64, lay: *i64, key: i64) -> i64 |
| 130 | func main() -> i64 |