code wiki / (root) / nx_fabric_fair_gate.nx

nx_fabric_fair_gate.nx

buildroot/runtime/nx_fabric_fair_gate.nx

10407 B225 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic fabric
docsdependenciesstructsconstsfunctions

about

nx_fabric_fair_gate.nx -- R2.5 of the SkyHammer fabric exceed ladder: MULTI-FLOW FAIRNESS, closing the disclosed single-flow caveat on R2 (nx_fabric_cc) / the L4S controller (nx_room_l4s). N flows with UNEQUAL starting windows share ONE bottleneck; the DCTCP/ECN controller must drive them to FAIR shares (Jain's index ~ 1) AND keep the queue bounded near the ECN setpoint. Load-bearing neg-control: with the reaction REMOVED (frozen windows), the initial imbalance PERSISTS -> unfair -> proves the controller (not the FIFO drain) is what creates fairness. Integer-only fixed-point (no float). Same discrete-event link shape as nx_fabric_cc, extended to N independent flows. expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_fabric_fair_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gp sys_write gn sys_mmap sys_write ↻ sys_mmap ↻ fair_run sys_mmap ↻ jain_x1000 show_flows gp ↻ gn ↻ chk gp ↻ sys_openat_append fw sys_write ↻ sys_write ↻ sys_close sys_exit

structs

none

consts

12const FAIR_DCTCP: i64 = 0 // ECN-adaptive (AI + proportional cut on marks)
13const FAIR_OPEN: i64 = 1 // reaction REMOVED: windows frozen at init -> imbalance persists
14const FSCALE: i64 = 1024

functions

18func fair_run(mode: i64, NF: i64, D: i64, RTT: i64, BUFCAP: i64, K: i64,
called by 1: main calls 1: sys_mmap
138func jain_x1000(d: *i64, NF: i64) -> i64
called by 1: main
147func gp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: chkshow_flowsmain calls 1: sys_write
148func fw(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
149func gn(v: i64) -> i64
called by 2: show_flowsmain calls 2: sys_mmapsys_write
159func chk(name: *u8, ok: i64) -> i64
called by 1: main calls 1: gp
163func show_flows(tag: *u8, d: *i64, NF: i64) -> i64
called by 1: main calls 2: gpgn
169func main() -> i64