code wiki / _hdl_build / _codec_bench.nx

_codec_bench.nx

buildroot/runtime/_hdl_build/_codec_bench.nx

3013 B57 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind benchtopic codec
docsdependenciesstructsconstsfunctions

about

_codec_bench.nx -- SOVEREIGN SAME-CORPUS codec head-to-head (no-wave, no external tool, no fabricated numbers): our lossless frame codec (fc = MED spatial predictor + Rice) vs sovereign DEFLATE, on IDENTICAL frames. Two deflate baselines: raw (general compressor) and Sub-prefiltered (PNG-class = PNG applies per-row filters then deflate). Verdict per frame = fc size < PNG-class size. All three measured on the SAME bytes -> a real measured exceed, honest by construction.

dependencies 3 imports · 0 importers

nx_frame_codec.nx nx_deflate_fixed.nx nx_syscalls.nx _codec_bench.nx

imports: nx_frame_codec.nxnx_deflate_fixed.nxnx_syscalls.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 fc_gen_gradient bench_buf fc_encode fc_pred fc_med nv1l_best_k nv1l_cost_bits nv1_wr_u32 nv1l_rice_put nv1l_bit_put dfl_encode sys_mmap ↻ dfl_putbit dfl_match dfl_matchlen dfl_lensym dfl_putcode dfl_putbit ↻ dfl_putbits_lsb dfl_putbit ↻ dfl_distsym sub_filter bp sys_write bn sys_mmap ↻ sys_write ↻ fc_gen_checker fc_gen_edge fc_gen_extremes fc_gen_noise bp ↻ bn ↻ sys_exit

structs

none

consts

none

functions

9func bp(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 2: bench_bufmain calls 1: sys_write
10func bn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; let t: *u8=sys_mmap(28); if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 }
called by 2: bench_bufmain calls 2: sys_mmapsys_write
12func sub_filter(buf: *u8, w: i64, h: i64, res: *u8) -> i64
called by 1: bench_buf
26func bench_buf(label: *u8, buf: *u8, w: i64, h: i64, scratch: *u8, cap: i64) -> i64
41func main() -> i64