code wiki / (root) / nx_torrent_capbench.nx

nx_torrent_capbench.nx

buildroot/runtime/nx_torrent_capbench.nx

12735 B186 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind benchtopic torrent
docsdependenciesstructsconstsfunctions

about

nx_torrent_capbench.nx -- MULTIVARIATE COMPETITIVE CAPABILITY BENCHMARK (S-class feature, B0-B2). module: nishi-core.torrent.capbench depends: nx_swarm_sim.nx (deterministic swarm model -> nx_ss_run; transitively nx_stream_picker, nx_piece_manager/nx_pm_rarest, nx_syscalls -- so this sits HARDWARE-UP on the proven sovereign substrate, like every other organ). capability: CAPABILITY_MEASUREMENT WHAT THIS IS (and why it's a first-class feature, not a one-off test): The way DeepMind measured agent capability with a SUITE of game environments (ALE/Atari, each probing a distinct skill) and a score normalized against a baseline, this is a suite of swarm SCENARIOS -- each probing a distinct piece-selection capability -- run against the system-under- test, scored on an ORGAN-COMPUTED maturity ladder vs the fastest known clients. It is built rung by rung, every rung gate-proved, so the ecosystem can SEE its own capabilities honestly. B0 deterministic measurement core : same scenario+strategy => bit-identical decision trace, so every measurement is REPLAYABLE (the property NO mainstream torrent client has -- they are clock/GC/scheduler driven). B1 multivariate matrix : SCENARIO x STRATEGY -> measured metric (rounds / DNF). B2 organ-computed maturity grade : ABSENT<PRESENT<PARITY<EXCEEDS<PHYS-OPT, COMPUTED from the measured numbers vs the baseline -- never self-asserted. (B3 incumbent-census wiring + B4 live wire-throughput = next rungs, honestly PENDING below.) HONESTY: the fastest clients (qBittorrent/libtorrent, rqbit, Transmission, aria2) all use rarest- first + endgame -- so NISHI matching that algorithm is PARITY by construction; the MEASURED win is endgame completing adverse/snub swarms where a no-endgame client DNFs; the EXCEEDS-all axis is determinism. Wire throughput is link-bound and NOT claimed here (PENDING-live).

dependencies 1 imports · 0 importers

nx_swarm_sim.nx nx_torrent_capbench.nx

imports: nx_swarm_sim.nx

imported by: nobody (leaf or entry point)

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

main cb_puts run_scenario scen_build cb_run nx_ss_run nx_ss_availability nx_ss_outstanding nx_sp_sequential nx_sp_stream_pick nx_pm_rarest nx_pm_rarest ↻ nx_sp_in_endgame nx_ss_any_honest_holder nx_ss_holder cb_puts ↻ cb_putn cap_name cb_puts ↻ cap_grade scen_build ↻ cb_run ↻ cb_putn ↻ cap_grade ↻

structs

none

consts

32const CAP_ABSENT: i64 = 0 // capability not present / did-not-finish
33const CAP_PRESENT: i64 = 1 // works, but worse than the baseline/incumbent
34const CAP_PARITY: i64 = 2 // matches
35const CAP_EXCEEDS: i64 = 3 // measurably beats
36const CAP_PHYSOPT: i64 = 4 // provably optimal (cannot be beaten)

functions

38func cb_puts(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 }
39func cb_putn(fd: i64, v: i64) -> i64
called by 2: run_scenariomain
49func cap_name(fd: i64, g: i64) -> i64
called by 1: run_scenario calls 1: cb_puts
61func cap_grade(ours: i64, ref: i64) -> i64
called by 2: run_scenariomain
72func scen_build(sc: i64, peer_has: *i64, behavior: *i64, dim: *i64) -> i64
called by 2: run_scenariomain
108func cb_run(peer_has: *i64, behavior: *i64, npeers: i64, n: i64, endgame: i64, threshold: i64, max_rounds: i64, out_trace: *i64) -> i64
called by 2: run_scenariomain calls 1: nx_ss_run
115func run_scenario(sc: i64, label: *u8, peer_has: *i64, behavior: *i64, dim: *i64, res2: *i64, trace_eg: *i64) -> i64
130func main() -> i64