code wiki / _hdl_build / nx_fec_state_gate.nx

nx_fec_state_gate.nx

buildroot/runtime/_hdl_build/nx_fec_state_gate.nx

5501 B88 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic fec
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_emit_lib.nx nx_fec_xor.nx nx_fec_state_gate.nx

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

main g_puts sys_write sys_mmap fill_src fec_pkt fec_encode_rows fec_pkt ↻ fec_zero fec_xor_into fec_encode_cols fec_pkt ↻ fec_zero ↻ fec_xor_into ↻ set_all erase fec_zero ↻ fec_pkt ↻ fec_decode_2d fec_pkt ↻ fec_zero ↻ fec_xor_into ↻ fec_overhead_pct g_pn sys_mmap ↻ sys_write ↻ all_match pkt_eq fec_pkt ↻ g_check g_puts ↻ pkt_eq ↻ fec_pkt ↻ fec_scheme_for_loss sys_exit

structs

none

consts

none

functions

16func 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 }
called by 2: all_matchmain
18func fill_src(src: *u8, K: i64, S: i64) -> i64
called by 1: main calls 1: fec_pkt
23func 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
24func erase(src: *u8, present: *i64, i: i64, S: i64) -> i64 { present[i]=0; fec_zero(fec_pkt(src, i, S), S); return 0 }
called by 1: main calls 2: fec_zerofec_pkt
25func all_match(src: *u8, orig: *u8, K: i64, S: i64) -> i64
called by 1: main calls 2: pkt_eqfec_pkt
29func main() -> i64