code wiki / _hdl_build / nx_fabric_fec.nx

nx_fabric_fec.nx

buildroot/runtime/_hdl_build/nx_fabric_fec.nx

6120 B135 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind tooltopic fabric
docsdependenciesstructsconstsfunctions

about

nx_fabric_fec.nx -- R3 of the SkyHammer fabric exceed ladder: built-in RESILIENCY. (knowledge/research/2026-06-23-skyhammer-fabric-sclass-exceed-benchmark.md, ladder R3.) SkyHammer sells "built-in resiliency" IN SILICON. On a LOSSY link with RTT the honest software exceed is PROACTIVE FEC: a retransmit (ARQ) costs a full round-trip PER loss round (= a stall), whereas Reed-Solomon parity already in flight RECONSTRUCTS the lost shard with ZERO added round-trips. This rung MEASURES that vs ARQ on the SAME data-shard loss pattern, and (NC3) PROVES every recovery is byte-exact -- not just "counted". FOUNDED ON (composes, does not reinvent -- rule #15): nx_room_fec.nx -- the proven sovereign GF(256) systematic Reed-Solomon MDS erasure code (gf_init / fec_build_G / fec_encode / fec_decode / fec_data_eq; its own gate recovers ALL C(7,3) patterns + tamper-breaks). R3 adds only the lossy-link + ARQ-vs-FEC latency model. Importing it transitively splices nx_syscalls (single import; no double-import). Integer-only, deterministic (LCG loss, reproducible). expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_room_fec.nx nx_fabric_fec.nx nx_fabric_fec_gate.nx

imports: nx_room_fec.nx

imported by: nx_fabric_fec_gate.nx

structs

25struct FecMetrics

consts

18const FB_MAGIC_1103515245: i64 = 1103515245
19const FB_MAGIC_12345: i64 = 12345
20const FB_MAGIC_2654435761: i64 = 2654435761
22const FB_ARQ: i64 = 0 // baseline: data-only, retransmit lost shards (RTT per loss round)
23const FB_FEC: i64 = 1 // R3: k data + m parity; reconstruct <=m losses with no retransmit

functions

34func fb_lcg(st: *i64) -> i64 { st[0] = (st[0] * FB_MAGIC_1103515245 + FB_MAGIC_12345) & 0x7fffffff; return st[0] }
called by 1: fb_lost
35func fb_lost(st: *i64, p_permille: i64) -> i64 { if (fb_lcg(st) % 1000) < p_permille { return 1 } return 0 }
called by 2: fb_arq_roundsfec_run calls 1: fb_lcg
38func fb_arq_rounds(st: *i64, count: i64, p_permille: i64, sent: *i64) -> i64
called by 1: fec_run calls 1: fb_lost
53func fec_run(mode: i64, NBLOCKS: i64, k: i64, m: i64, S: i64, RTT: i64, p_permille: i64, base_seed: i64, mo: *FecMetrics) -> i64
135func main() -> i64 { return 0 }