code wiki / (root) / nx_webp_alpha_gate.nx

nx_webp_alpha_gate.nx

buildroot/runtime/nx_webp_alpha_gate.nx

8842 B201 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic webp
docsdependenciesstructsconstsfunctions

about

nx_webp_alpha_gate.nx -- proves VP8X + ALPH by exact filter ROUND-TRIP. T3 runs all four filters over pseudo-random alpha planes at several shapes and requires the filtered-then-unfiltered plane to be byte-identical. A filter pair that disagrees anywhere -- including only at the edges -- fails. T4 pins the EDGE PREDICTION explicitly. Horizontal predicts the first column from ABOVE and vertical predicts the first row from the LEFT. Using the nominal direction at an edge reads outside the plane; substituting zero leaves the interior correct and both edges wrong, which reads as a subtle halo rather than a decode failure. The test uses a 1-pixel-wide and a 1-pixel-tall plane, where the whole image IS the edge case. T5 pins the gradient clamp ORDER: clamp(left + top - topleft) to 0..255, THEN add the residual modulo 256. It uses values that deliberately overshoot both ends, since that is the only place the orders differ. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_webp_alpha.nx nx_webp_alpha_gate.nx

imports: nx_syscalls.nxnx_webp_alpha.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_vp8x_write nx_wa_le24_w nx_vp8x_parse nx_wa_at nx_wa_le24 nx_wa_at ↻ nx_vp8x_has_alpha nx_alph_build_header nx_alph_parse_header nx_alph_filter nx_wa_at ↻ nx_wa_clamp255 nx_alph_unfilter nx_wa_at ↻ nx_wa_clamp255 ↻ 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