code wiki / _hdl_build / nx_vnsprite_gate.nx

nx_vnsprite_gate.nx

buildroot/runtime/_hdl_build/nx_vnsprite_gate.nx

18001 B409 linesdepth 4pulls 8 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 5 imports · 0 importers

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

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

main ep_anchor sys_openat_rd sys_close sys_chdir sys_mmap hw3 sys_write sys_mmap ↻ mk_body mk_expr vsp_clear vsp_compose sys_mmap ↻ vsp_blit hn3 sys_mmap ↻ sys_write ↻ vsp_blit ↻ fs_layers vsp_setg fs_scene fs_bg vsp_compose ↻ fill_rect vsp_fbck gs_save sys_mmap ↻ put64 gsc_put64 gs_cksum gsc_fold_bytes joinsuf slen sys_mmap ↻ sys_openat_wr sys_write ↻ sys_fsync sys_close ↻ sys_unlinkat

structs

none

consts

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

functions

33func hw3(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
34func hn3(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
45func mk_body(spr: *i64, sw: i64, sh: i64, key: i64, skin: i64, shirt: i64) -> i64
called by 1: main
65func mk_expr(spr: *i64, sw: i64, sh: i64, key: i64, ink: i64, mode: i64) -> i64
called by 1: main
82func fill_rect(fb: *i64, W: i64, H: i64, x0: i64, y0: i64, x1: i64, y1: i64, c: i64) -> i64
called by 1: fs_scene
100func fs_layers(lay: *i64) -> i64
called by 1: main
109func fs_bg(fb: *i64) -> i64
called by 2: fs_scenemain
123func fs_scene(fb: *i64, sprites: *i64, sprw: *i64, sprh: *i64, lay: *i64, key: i64) -> i64
called by 1: main calls 3: fs_bgvsp_composefill_rect
130func main() -> i64