code wiki / _hdl_build / nx_lpc_speed_bench.nx
nx_lpc_speed_bench.nx
buildroot/runtime/_hdl_build/nx_lpc_speed_bench.nx
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
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
structs
| none |
consts
| 11 | const LPB_MAGIC_1024: i64 = 1024 |
| 12 | const LPB_MAGIC_2026: i64 = 2026 |
| 13 | const LPB_MAGIC_2000: i64 = 2000 |
| 14 | const LPB_MAGIC_262144: i64 = 262144 |
| 15 | const LPB_MAGIC_20260702: i64 = 20260702 |
| 16 | const LPB_MAGIC_1103515245: i64 = 1103515245 |
| 17 | const LPB_MAGIC_12345: i64 = 12345 |
| 19 | const LPB_LOG: *u8 = "knowledge/status/lpc_speed.log" |
functions
| 21 | func 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 } |
| 22 | func 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 } |
| 24 | func main() -> i64 |