nx_torrent_bench.nx
buildroot/runtime/nx_torrent_bench.nx
about
nx_torrent_bench.nx -- the 1:1 torrent leaderboard, graded vs RESEARCH-VERIFIED incumbents.
module: nishi-core.torrent.bench
depends: nx_swarm_sim.nx (-> stream_picker -> piece_manager), nx_sha256.nx, nx_syscalls.nx
capability: CORE_COMPUTE
wired_status: FULLY_WIRED
Pitwall discipline (the plan's 1:1 mandate): grade each column S/A/B/C/D against the BEST
incumbent, label every cell MEASURED (we ran it) vs HANDED (incumbent value from a verified
primary source, NOT something we ran) vs PENDING (needs the live socket loop, named honestly).
We win, by construction + measured, on the columns no incumbent has: determinism/replay,
zero-egress-by-construction, reproducible adverse-swarm completion, deterministic streaming,
and a v2 (SHA-256) substrate rqbit still lacks. We do NOT claim throughput/memory wins -- those
are PENDING the live loop, and the research says clients cluster near link-bound anyway.
VERIFIED incumbent facts baked into the leaderboard text (sources, 2026-06 research pass):
- libtorrent defaults: connections_limit=200, connection_speed=30/s, utp_target_delay=100ms
[libtorrent.org/reference-Settings.html]
- CVE-2024-51774: qBittorrent ignored SSL cert validation ~14.5y, CVSS 8.1 HIGH, fixed 5.0.1
[nvd.nist.gov/vuln/detail/CVE-2024-51774]
- rqbit: hashing (SHA-1) is the #1 CPU cost; NO BitTorrent v2 yet (planned, issue #546)
[github.com/ikatson/rqbit, issues/546 2026-02-02]
- libtorrent 2.0 has v2 (SHA-256/merkle, 16KiB leaf) [blog.libtorrent.org 2020-09];
Transmission 4.0 reads v2/hybrid; concrete hashing MB/s is UNPUBLISHED for every client
- ckerr 2010: clients cluster 53-60min near link-bound, "client choice makes little difference"
[gist ckerr 89882362...]; no modern quantified cross-client study exists
- RFC 6817 LEDBAT one-way target 100ms; LEDBAT++ is an IRTF draft (not an RFC), no BT-client impl
dependencies 2 imports · 1 importers
imports: nx_swarm_sim.nxnx_sha256.nx
imported by: nx_torrent_bench_test.nx
structs
| none |
consts
| 32 | const TB_NA: i64 = 0 // not-yet-measured / not-applicable |
| 33 | const TB_D: i64 = 1 |
| 34 | const TB_C: i64 = 2 |
| 35 | const TB_B: i64 = 3 |
| 36 | const TB_A: i64 = 4 |
| 37 | const TB_S: i64 = 5 |
functions
| 39 | func _tb_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 } |
| 40 | func _tb_putn(fd: i64, v: i64) -> i64 called by 1: nx_tb_emit |
| 46 | func _tb_glet(fd: i64, code: i64) -> i64 |
| 56 | func nx_tb_grade_hib(ours: i64, incumbent: i64) -> i64 called by 1: main |
| 66 | func nx_tb_grade_lib(ours: i64, incumbent: i64) -> i64 |
| 78 | func nx_tb_determinism_pass(peer_has: *i64, behavior: *i64, npeers: i64, n: i64, |
| 94 | func nx_tb_v2_hash_ok() -> i64 |
| 105 | func nx_tb_emit(fd: i64, det_pass: i64, naive_res: i64, eg_res: i64, |