code wiki / _hdl_build / nx_perf_video_register.nx
nx_perf_video_register.nx source
↩ module page · 42 lines · 3131 B
1// nx_perf_video_register.nx -- governed registration of the 2026-06-10
2// deliverables, evidence-first: re-RUNS the gates and registers only on
3// green (the role-health register pattern). license_tier: ORIGINAL
4import "nx_cap_register.nx"
5import "nx_syscalls.nx"
6
7const NLAY: i64 = 6
8
9func pv_run(path: *u8) -> i64 {
10 let pid: i64 = sys_fork()
11 if pid == 0 {
12 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4)
13 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) }
14 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0
15 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0
16 sys_execve(path, argv, envp); sys_exit(127)
17 }
18 let st: *i64 = sys_mmap(16) as *i64
19 sys_wait4(pid, st, 0)
20 return st[0]
21}
22func pv_ok(path: *u8) -> i64 { if pv_run(path) == 0 { return 1 } return 0 }
23
24func main() -> i64 {
25 // ENGINEER evidence: the perf-organs gate (8/8) + the signaling mesh
26 // gate (10/10 incl bit-exact binary media relay) both pass NOW.
27 var allok: i64 = 1
28 if pv_ok("/tmp/nx_perf_sentinel_gate.kg.elf" as *u8) == 0 { allok = 0 }
29 if pv_ok("/tmp/nx_signaling_v2_gate.kg.elf" as *u8) == 0 { allok = 0 }
30 cr_w(1, "ENGINEER: perf-organs + signaling-mesh gates all-pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8)
31 let eng: i64 = ig_engineer(1, 1, 1, allok)
32 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1)
33 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) }
34 if cr_can_register(4, 2, NLAY, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) }
35 let fd: i64 = sys_openat_append("/tmp/nishi_cap_registry.log" as *u8, 0x1a4)
36 cr_write_entry(fd, 236, 4, "CON PERF-ORGANS -- operator law 'slowness anywhere = total failure': nx_perf_sentinel (/proc tick-delta CPU truth, config budget table, governed log/escalate/kill; gate 8/8 on a REAL spinner; first live catches: 2x 100pct-CPU 5-6-DAY runaways on WSL + an 11h stuck gzip on the NAS) + nx_budget_run (time-budgeted step runner, kills + auto-files over-budget steps, exit 99; the 90-min silent assembler class is now impossible). Deployed both boxes. BOOTSTRAP-FLAGGED (kg lane); sovereign re-gate owed. Landmine 5 filed: frozen kg syscall table lacks kill/mkdirat rows -> runtime-computed x86 numbers are the portable form" as *u8, 2)
37 cr_write_entry(fd, 237, 4, "CON VIDEO-V2-PURE-NISHI -- nishifamily.com/video LIVE: N-party rooms over wss:443 (sites daemon TLS pump -> nx_signaling_v2 loopback relay, gate 10/10 incl bit-exact 12KB binary media frames; PUBLIC 2-client relay proof green), pure-Nishi media plane (operator: NO webrtc) = client-authored JPEG frames + LOSSLESS native-rate PCM audio (rate in-band, sample-exact), RTT-laddered for UA/BY links; circles w/ private auto-archive (byte-identical round-trips). Hosting keystones: chunked TLS send (gate 10/10, >16KB unblocked), hr_serve2 fallthrough (14/14), streaming upload. BOOTSTRAP-FLAGGED; sovereign re-gate owed on compiler-lane fix" as *u8, 2)
38 sys_close(fd)
39 cr_w(1, "CAPREG idx=236,237 REGISTERED (perf organs + video v2)\n" as *u8)
40 sys_exit(0)
41 return 0
42}