code wiki / _hdl_build / nx_fec_state_gate.nx
nx_fec_state_gate.nx
buildroot/runtime/_hdl_build/nx_fec_state_gate.nx
about
nx_fec_state_gate.nx -- proves + MEASURES sovereign ZERO-RTT loss recovery for the multiplayer
state/event stream (composes nx_fec_xor). At 150ms+ mobile RTT you cannot afford a retransmit
round-trip; FEC parity recovers lost packets immediately at the receiver. Protects keyframes +
critical events (captures/edits); the position stream is already covered by interp/extrapolate.
1) FULL recovery: a block of state packets with scattered + mixed (2x1) loss recovers byte-EXACT,
zero retransmit (fec_decode_2d returns 0 missing) -- measured overhead %
2) adaptive: fec_scheme_for_loss(0)=NONE, (2%)=ROW, (8%)=2D (redundancy sized to measured loss)
3) HONEST LIMIT (neg): a 2x2 erasure square is unrecoverable -> decode returns >0 (NOT a fake
recovery) and does NOT corrupt the surviving packets
4) anti-tautology: a recovered packet byte-MATCHES its original (real reconstruction, not "present")
Built nx_cc_sovereign -> nxasm_x86 (no gcc, no .sh). license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_emit_lib.nxnx_fec_xor.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
| none |
functions
| 16 | func pkt_eq(a: *u8, b: *u8, S: i64) -> i64 { var i: i64=0; while i<S { if a[i]!=b[i] { return 0 } i=i+1 } return 1 } |
| 18 | func fill_src(src: *u8, K: i64, S: i64) -> i64 |
| 23 | func set_all(a: *i64, n: i64, v: i64) -> i64 { var i: i64=0; while i<n { a[i]=v; i=i+1 } return 0 } called by 1: main |
| 24 | func erase(src: *u8, present: *i64, i: i64, S: i64) -> i64 { present[i]=0; fec_zero(fec_pkt(src, i, S), S); return 0 } |
| 25 | func all_match(src: *u8, orig: *u8, K: i64, S: i64) -> i64 |
| 29 | func main() -> i64 |