code wiki / _hdl_build / nx_lpc_speed_bench.nx

nx_lpc_speed_bench.nx

buildroot/runtime/_hdl_build/nx_lpc_speed_bench.nx

6460 B118 linesdepth 7pulls 20 transitivereach 0 importersview sourcekind benchtopic lpc
docsdependenciesstructsconstsfunctions

about

nx_lpc_speed_bench.nx -- HARDWARE-RUNG measurement: how fast does the sovereign LPC audio codec (the EXACT vc_lpc_encode/decode the live room ships in nx_video_client.wasm) run on THIS CPU? (operator 2026-07-02: "hardware foundational rung each rung up"). Times REAL encode+decode of 21ms/1024-sample frames (the live framing after today's latency cut) with the monotonic clock, verifies BIT-EXACT roundtrip on every frame (lossless = the codec's contract), and reports the REALTIME FACTOR: how many concurrent 48kHz peers this CPU can encode+decode (the 8-peer room's compute headroom, measured not assumed). NEG-control: a tampered stream must NOT roundtrip. Log -> knowledge/status/lpc_speed.log (LPCBENCH ... verdict=). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_video_client_wasm.nx nx_lpc_speed_bench.nx

imports: nx_syscalls.nxnx_video_client_wasm.nx

imported by: nobody (leaf or entry point)

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

main bw sys_write sys_mmap sys_now_us sys_mmap ↻ sys_clock_gettime_mono vc_lpc_encode vc_wr_u32 vc_lpc_rd_i16 vc_lpc_residuals vc_lpc_cost_bits vc_lpc_rice_put vc_lpc_bit_put vc_lpc_decode vc_rd_u32 vc_lpc_rd_i16 ↻ vc_lpc_wr_i16 vc_lpc_rice_get vc_lpc_bit_get bwn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close

structs

none

consts

11const LPB_MAGIC_1024: i64 = 1024
12const LPB_MAGIC_2026: i64 = 2026
13const LPB_MAGIC_2000: i64 = 2000
14const LPB_MAGIC_262144: i64 = 262144
15const LPB_MAGIC_20260702: i64 = 20260702
16const LPB_MAGIC_1103515245: i64 = 1103515245
17const LPB_MAGIC_12345: i64 = 12345
19const LPB_LOG: *u8 = "knowledge/status/lpc_speed.log"

functions

21func bw(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main calls 1: sys_write
22func bwn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(fd,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;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{bb[i]=t[k-1-i];i=i+1} sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
24func main() -> i64