code wiki / _hdl_build / nx_rollback.nx

nx_rollback.nx

buildroot/runtime/_hdl_build/nx_rollback.nx

2056 B43 linesdepth 1pulls 1 transitivereach 2 importersview sourcekind librarytopic rollback
docsdependenciesstructsconstsfunctions

about

nx_rollback.nx -- N-R4: sovereign ROLLBACK netcode core (P2; the fighting/action-game standard). Predict remote inputs to advance now; when the REAL input arrives and differs, restore the last CONFIRMED snapshot and RE-SIMULATE forward with correct inputs -> the visible state converges to what it would have been with no error, hiding latency. Builds on the deterministic sim (nx_lockstep) so a resim is bit-exact. Pure integer. 100% sovereign. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_lockstep.nx nx_rollback.nx nx_rollback_exceed_gate.nx nx_rollback_gate.nx

imports: nx_lockstep.nx

imported by: nx_rollback_exceed_gate.nxnx_rollback_gate.nx

structs

none

consts

32const RBX_BELOW: i64 = 0
33const RBX_PARITY: i64 = 1
34const RBX_EXCEEDS: i64 = 2

functions

8func rb_copy(dst: *i64, src: *i64, n: i64) -> i64 { var i: i64=0; while i<n { dst[i]=src[i]; i=i+1 } return 0 }
called by 1: rb_resim
11func rb_advance(state: *i64, k: i64, inputs: *i64, from: i64, to: i64) -> i64
called by 3: rb_resimmainmain calls 1: ls_update
18func rb_mispredict(predicted: *i64, real: *i64, t: i64) -> i64
called by 1: main
25func rb_resim(out: *i64, snapshot: *i64, k: i64, real: *i64, confirmed_tick: i64, to: i64) -> i64
called by 2: mainmain calls 2: rb_copyrb_advance
37func rb_delay_latency(net_delay: i64) -> i64 { return net_delay }
called by 1: main
38func rb_rollback_latency() -> i64 { return 0 }
called by 1: main
39func rb_latency_verdict(delay_lat: i64, rb_lat: i64) -> i64
called by 1: main