code wiki / (root) / nx_vp8_gate.nx

nx_vp8_gate.nx

buildroot/runtime/nx_vp8_gate.nx

8202 B187 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic vp8
docsdependenciesstructsconstsfunctions

about

nx_vp8_gate.nx -- proves the VP8 boolean decoder and keyframe header. T2 is the one that validates the whole entropy engine without needing an encoder: at probability 128 the split lands exactly at the midpoint, so the coder degenerates to reading the stream MSB-first. Decoding 128 prob-128 bits must therefore reproduce the raw bits of the input bytes EXACTLY. Any error in the shift, the carry or the 8-bit byte refill breaks it on the first refill boundary. T3 asserts the RANGE INVARIANT after every single decode: 128 <= range <= 255. A renormalisation loop that under- or over-shifts returns plausible bits for a while and then diverges, so checking the invariant per call catches it at the first bit rather than the thousandth. T6 pins the mandatory start code. Without it a corrupt or non-VP8 payload decodes as a frame with dimensions read out of arbitrary bytes. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_vp8.nx nx_vp8_gate.nx

imports: nx_syscalls.nxnx_vp8.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nx_vp8_bool_init sys_mmap ↻ nx_vp8_at nx_vp8_at ↻ nx_vp8_bool_bit nx_vp8_bool_get nx_vp8_at ↻ nx_vp8_bool_get ↻ nx_vp8_bool_literal nx_vp8_bool_bit ↻ nx_vp8_bool_signed nx_vp8_bool_literal ↻ nx_vp8_bool_bit ↻ nx_vp8_bool_maybe_signed nx_vp8_bool_bit ↻ nx_vp8_bool_signed ↻ nx_vp8_frame_write nx_vp8_frame_parse nx_vp8_at ↻ g_puts sys_write sys_exit g_putn sys_mmap ↻ g_puts ↻ sys_write ↻

structs

none

consts

none

functions

22func g_puts(s: *u8) -> i64
called by 2: g_putnmain calls 1: sys_write
29func g_putn(v: i64) -> i64
called by 1: main calls 3: sys_mmapg_putssys_write
43func main() -> i64