code wiki / (root) / nx_shipfleet_lib.nx

nx_shipfleet_lib.nx

buildroot/runtime/nx_shipfleet_lib.nx

2933 B57 linesdepth 0pulls 0 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_shipfleet_lib.nx -- the PURE decision core for INTELLIGENT (adaptive-concurrency) shipping. Composes the estate's polite headroom budget (nx_resource_governor rg_worker_budget/rg_hw_budget) with an AIMD cap that responds to the DIRECT I/O-storm signal (nx_build_admit's exit code), so a fleet of ships runs as WIDE as the box allows RIGHT NOW and no wider: additive-increase +1 on progress, multiplicative-decrease (halve) on a storm refusal. This is TCP congestion control applied to build admission -- the field infers congestion from latency (minRTT/RTT gradient, Netflix concurrency-limits, Envoy adaptive_concurrency, ThomWright/congestion-limiter); OUR exceed is that the signal is MEASURED, not inferred -- nx_build_admit reads /proc D-state directly. Pure policy: host signals passed in, no syscalls, so the gate can bite-prove the whole state machine. license_tier: ORIGINAL

dependencies 0 imports · 2 importers

nx_shipfleet_lib.nx nx_ship_fleet.nx nx_ship_fleet_gate.nx

imports: none

imported by: nx_ship_fleet.nxnx_ship_fleet_gate.nx

structs

none

consts

11const SF_OK: i64 = 0 // progress this tick (a ship launched / the box granted) -> room to grow
12const SF_STORM: i64 = 1 // build admission refused (I/O storm / no headroom) -> back off hard
13const SF_HOLD: i64 = 2 // neither -> leave the cap where it is (only clamp to ceiling)

functions

18func sf_aimd_next(cap: i64, ceil: i64, event: i64) -> i64
called by 2: mainmain
42func sf_effective_width(rg_budget: i64, aimd_cap: i64, admit_grant: i64, serve_first: i64) -> i64
called by 2: mainmain
53func sf_launch_slots(width: i64, in_flight: i64) -> i64
called by 2: mainmain