code wiki / _hdl_build / nx_room_fec_relay.nx

nx_room_fec_relay.nx

buildroot/runtime/_hdl_build/nx_room_fec_relay.nx

8452 B154 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tooltopic room
docsdependenciesstructsconstsfunctions

about

nx_room_fec_relay.nx -- R1: FEC wired THROUGH the real sovereign relay. Composes the live relay core (nx_room_relay: rr_init/rr_post/rr_find/arena) with the proven frame-FEC wire protocol (nx_room_fec_wire). Each frame is sharded into k data + m parity DATAGRAMS; each shard is posted to the relay under its own (room, peer*16+shard_idx) key; the receiver collects whatever survived and reconstructs the WHOLE frame byte-exact from any k shards. WHY THIS IS THE REAL WIRE-IN (not another sim): it exercises the ACTUAL relay primitives (rr_post stores each shard in the shared arena; rr_find locates survivors) -- the same code nx_vroom_daemon runs live. The honest motivation: the live room speaks HTTP/TCP, which HEAD-OF-LINE STALLS on intercontinental loss exactly like ARQ (TCP retransmits) -- a FEC datagram path delivers the frame with ZERO retransmit. This gate proves the integrated path. SCOPE: proves daemon-side FEC transport end-to-end. The browser-client recovery shim + the vd_stream wire-format change + DEPLOY to live :8446 = the operator-gated last mile. main() is the SELF-VALIDATING GATE. Evidence -> knowledge/status/room_fec_relay.log. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_room_relay.nx nx_room_fec_wire.nx nx_room_fec_relay.nx

imports: nx_syscalls.nxnx_room_relay.nxnx_room_fec_wire.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 gf_init fec_build_G gf_inv fwire_encode fec_encode gf_mul rr_init frr_send rr_post rr_find rr_alloc frr_collect rr_find ↻ fwire_decode fec_decode sys_mmap ↻ gf_solve gf_inv ↻ gf_mul ↻ frame_eq rr_find ↻ rw sys_write rwn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close sys_exit

structs

none

consts

21const FRR_LOG: *u8 = "knowledge/status/room_fec_relay.log"

functions

23func rw(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
24func rwn(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
27func frr_send(st: *i64, arena: *u8, room: i64, basepeer: i64, blockid: i64, shards: *i64, n: i64, S: i64, drop: *i64, shardbuf: *u8) -> i64
called by 1: main calls 1: rr_post
42func frr_collect(st: *i64, arena: *u8, room: i64, basepeer: i64, n: i64, S: i64, present: *i64, collected: *i64) -> i64
called by 1: main calls 1: rr_find
58func main() -> i64