code wiki / _hdl_build / nx_room_perf_register.nx
nx_room_perf_register.nx source
↩ module page · 48 lines · 4560 B
1// nx_room_perf_register.nx -- GOVERNED registration of the room perf arc:
2// the measuring organ (room perf gate) + the live-audio LPC/N-floor ship.
3// Engineer evidence = vc cross-gate elf built THIS invocation exits 0 (the
4// live perf/room gates run against the public stack via their own runners;
5// their durable logs are cited). license_tier: ORIGINAL
6import "nx_cap_register.nx"
7import "nx_capreg_librarian.nx"
8import "nx_syscalls.nx"
9
10func rpr_run(path: *u8) -> i64 {
11 let pid: i64 = sys_fork()
12 if pid == 0 {
13 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4)
14 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) }
15 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0
16 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0
17 sys_execve(path, argv, envp); sys_exit(127)
18 }
19 let st: *i64 = sys_mmap(16) as *i64
20 sys_wait4(pid, st, 0)
21 return st[0]
22}
23
24func main() -> i64 {
25 var allok: i64 = 1
26 if rpr_run("/tmp/vcg.elf" as *u8) != 0 { allok = 0 }
27 cr_w(1, "ENGINEER: vc cross-gate all-pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8)
28 let eng: i64 = ig_engineer(1, 1, 1, allok)
29 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1)
30 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) }
31 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) }
32 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8
33 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8
34
35 let idx1: i64 = cl_next_idx(lp, jp)
36 let ok1: i64 = cl_register_dual(lp, jp, idx1, 5,
37 2, "GEN ROOM-PERF-GATE (arc=NISHI-VIDEO; operator: 'we can all join but the performance was poor' -> slow is a bug -> a MEASURED re-runnable gate before any fix). nx_room_perf_gate = sovereign TLS clients on the PUBLIC stack measuring what users feel: P1 unloaded inter-client latency (same-process clocks = exact; p50 1.0-1.4ms), P2 loaded throughput via forked sender (120x8KB to 2 readers: 1.7-2.1MB/s delivered, loaded p50 latency 180-200ms = the QUEUEING users felt), P4 slow-reader stall probe. EVIDENCE-DRIVEN REFUTATION: the suspected v2 relay head-of-line wedge did NOT fire -- 400x8KB=3.2MB streamed past a DEAD peer and the live reader got 400/400 (kernel/loopback buffering absorbs family-scale slowness) -> NO daemon rewrite (rule: do not fix what is not measured). LOCALIZATION: single-TLS-stream blob probe (_tls_ceiling_probe) = 2.6MB/s both directions through the same daemon -> ceiling = sovereign scalar ChaCha20-Poly1305 TLS throughput on the NAS per stream (suite verified 0x1303 on the real path; the AES-256 reading was Synology nginx on LAN :443, wrong endpoint trap). Durable log knowledge/status/room_perf.log; runner bash _room_perf_run; fork-sender TLS-seq lesson: a forked sender STALES the parent session copy -> retire it, join fresh. NAMED next ceiling lever: scalar chacha20 optimization rung" as *u8)
38 if ok1 != 1 { cr_w(1, "DUAL-WRITE-1 FAILED\n" as *u8); sys_exit(1) }
39 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx1); cr_w(1, " REGISTERED -- room perf gate\n" as *u8)
40
41 let idx2: i64 = cl_next_idx(lp, jp)
42 let ok2: i64 = cl_register_dual(lp, jp, idx2, 5,
43 2, "GEN LIVE-AUDIO-LPC + N-AWARE-LADDER SHIPPED LIVE (arc=NISHI-VIDEO; the measured load-reduction levers from the perf gate). nx_video_client_wasm grew vc_lpc_encode/vc_lpc_decode (the NV1 L payload byte-for-byte, caller-scratch instead of mmap -- import-free wasm) + vc_ladder_floor (room-size rows 2->0 3->1 4->2 5plus->3 capping the fps ladder; fan-out cost grows with peers). Live mic audio now rides wire kind 0x4C = [u32 rate][L payload]: LOSSLESS ~547 permil of raw PCM (96->~52KB/s per sender), raw 0x41 kept for back-compat receive; decoder tamper-evident (-7). app.js stays LAST-MILE SHIM (mount+bridge only; backpressure window 256KB->64KB so video skips early and audio never queues deep; net label shows live audio ratio). GATES: nx_vc_gate 14/14 native incl LPC core-vs-authority BIT-EXACT both directions + same-payload-size; node artifact smoke 7/7 on the shipped wasm (15806B); deployed BYTE-IDENTICAL (bash _vc_ship, vault-CLI pw); post-deploy room_live_gate 10/10 + room_perf_gate 5/5 re-run GREEN. Residuals: browser 2-device E2E = operator test; sinc-in-core interp debt unchanged" as *u8)
44 if ok2 != 1 { cr_w(1, "DUAL-WRITE-2 FAILED\n" as *u8); sys_exit(1) }
45 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx2); cr_w(1, " REGISTERED -- live-audio LPC + N-floor\n" as *u8)
46 sys_exit(0)
47 return 0
48}