code wiki / _hdl_build / nx_vnsprite_gate.nx

nx_vnsprite_gate.nx

buildroot/runtime/_hdl_build/nx_vnsprite_gate.nx

18470 B416 linesdepth 4pulls 9 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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 6 imports · 0 importers

nx_syscalls.nx nx_estate_path.nx nx_vnsprite.nx nx_gamesave.nx nx_png.nx nx_gate_verdict.nx nx_vnsprite_gate.nx

imports: nx_syscalls.nxnx_estate_path.nxnx_vnsprite.nxnx_gamesave.nxnx_png.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

structs

none

consts

27const VG_B: i64 = 65536
28const VG_CANARY: i64 = 12345678
29const VG_STAMP: i64 = 20260729
30const VG_SCHEMA: i64 = 78
31const VG_W: i64 = 640
32const VG_H: i64 = 360

functions

34func hw3(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
35func hn3(v: i64) -> i64
46func mk_body(spr: *i64, sw: i64, sh: i64, key: i64, skin: i64, shirt: i64) -> i64
66func mk_expr(spr: *i64, sw: i64, sh: i64, key: i64, ink: i64, mode: i64) -> i64
83func fill_rect(fb: *i64, W: i64, H: i64, x0: i64, y0: i64, x1: i64, y1: i64, c: i64) -> i64
101func fs_layers(lay: *i64) -> i64
110func fs_bg(fb: *i64) -> i64
124func fs_scene(fb: *i64, sprites: *i64, sprw: *i64, sprh: *i64, lay: *i64, key: i64) -> i64
131func main() -> i64