code wiki / (root) / nx_torrent_seedeval.nx

nx_torrent_seedeval.nx

buildroot/runtime/nx_torrent_seedeval.nx

9960 B121 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tooltopic torrent
docsdependenciesstructsconstsfunctions

about

nx_torrent_seedeval.nx -- SEEDER EVALUATION (operator: "are we too scarce, or ignoring what's out there, or other?"). The download worker already records `download.avail` = per-piece count of the CONNECTED peers that advertised each piece (built from their BITFIELD/HAVE). That IS the seeder data. This tool reads it (+ download.done = what we have, + download.npc = piece count) for a torrent and reports the swarm shape + a verdict: - SCARCE : the missing pieces have NO holder among the peers we reached -> need wider discovery / a web-seed (no complete seed in the reachable swarm; the usual "stuck at the last piece"). - IGNORING: the missing pieces DO have holders (av>0) yet we never completed them -> a connection / unchoke / picker issue, NOT scarcity (we are reaching seeders but not pulling from them). Read-only. argv[1] = the torrent's outdir (e.g. /volume1/ai/torrent/gallery/<id>). license_tier: ORIGINAL layer: diagnostics module: nishi-core.torrent.seedeval depends: nishi-core.syscalls, nishi-core.avail_map

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_avail_map.nx nx_bencode.nx nx_torrent_seedeval.nx

imports: nx_syscalls.nxnx_avail_map.nxnx_bencode.nx

imported by: nobody (leaf or entry point)

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

main se_puts sys_write sys_exit sys_mmap se_join se_read sys_openat_rd sys_read sys_close sys_write ↻ se_putn sys_mmap ↻ sys_write ↻ am_load am_open sys_read ↻ nx_bc_dict_get sys_mmap ↻ nx_bc_str _bc_is_digit _bc_bytes_eq nx_bc_skip _bc_is_digit ↻ nx_bc_int _bc_is_digit ↻ nx_bc_skip ↻

structs

none

consts

16const K_MAGIC_1024: i64 = 1024
17const K_MAGIC_4096: i64 = 4096
18const K_MAGIC_4095: i64 = 4095
19const K_MAGIC_262144: i64 = 262144
20const K_MAGIC_65536: i64 = 65536

functions

22func se_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
23func se_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
30func se_join(dir: *u8, suf: *u8, out: *u8) -> *u8
called by 1: main
33func se_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
40func main(argc: i64, argv: *i64) -> i64