nx_torrent_capbench.nx
buildroot/runtime/nx_torrent_capbench.nx
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
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
structs
| none |
consts
| 32 | const CAP_ABSENT: i64 = 0 // capability not present / did-not-finish |
| 33 | const CAP_PRESENT: i64 = 1 // works, but worse than the baseline/incumbent |
| 34 | const CAP_PARITY: i64 = 2 // matches |
| 35 | const CAP_EXCEEDS: i64 = 3 // measurably beats |
| 36 | const CAP_PHYSOPT: i64 = 4 // provably optimal (cannot be beaten) |
functions
| 38 | func 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 } |
| 39 | func cb_putn(fd: i64, v: i64) -> i64 |
| 49 | func cap_name(fd: i64, g: i64) -> i64 |
| 61 | func cap_grade(ours: i64, ref: i64) -> i64 |
| 72 | func scen_build(sc: i64, peer_has: *i64, behavior: *i64, dim: *i64) -> i64 |
| 108 | func cb_run(peer_has: *i64, behavior: *i64, npeers: i64, n: i64, endgame: i64, threshold: i64, max_rounds: i64, out_trace: *i64) -> i64 |
| 115 | func run_scenario(sc: i64, label: *u8, peer_has: *i64, behavior: *i64, dim: *i64, res2: *i64, trace_eg: *i64) -> i64 |
| 130 | func main() -> i64 |