nx_paper_beat.nx
buildroot/runtime/nx_paper_beat.nx
about
nx_paper_beat.nx -- THE NATIVE-LIBRARY CONVERSION BEAT (operator 2026-08-13: no third-party
formats; papers native to Nishi from the first bit). Walks a fetched CVF listing, and for each
paper: fetch its ABSTRACT PAGE over our own TLS (rf_fetch_bank, ~6KB each) -> convert to NXPAP2
via the promoted nx_paper_native -> emit its reader view. BOUNDED and RESUMABLE by construction:
<limit> papers per run and a cursor file holding the next index, so a run is a paced slice, never
a hammer on the host (the resource-excellence law) and never a restart from zero.
Composes, never re-implements: the fetch is the researcher's proven lane, the conversion is the
promoted organ, this owns only the WALK + the CURSOR.
2026-08-14 -- FILE READS NO LONGER CARRY A CAP. This organ used to read the listing through its
own hand-rolled pb_read with a fixed 4 MiB ceiling, which silently short-read any bigger listing:
a caller could not tell a 4 MiB page from a 4 MiB-capped 9 MiB page, and CVPR 2026 day 3 came
back at EXACTLY 4,194,304 B for that reason. The estate's own sys_read_file has sized its buffer
from the file (lseek END) since 2026-07-15; this organ was hand-rolling a capped reader beside it.
Worse, the ONE constant was doing DOUBLE DUTY as a file-read ceiling and a network-buffer
reserve -- two unrelated quantities that can never be tuned together. File reads now compose
sys_read_file and cannot truncate; the only remaining bound is the network reserve below, which
is named for exactly what it is.
nx_paper_beat <listing.raw> <limit> <cursor-file> [name-prefix]
Announces converted/skipped/failed + the new cursor. exit 0 ok | 1 io | 2 usage | 3 refuse.
license_tier: ORIGINAL. No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_research_fetch_ext.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
| 26 | const PB_MAGIC_1024: i64 = 1024 |
| 32 | const PB_FETCH_RESERVE: i64 = 8388608 |
| 33 | const PB_NATIVE: *u8 = "/volume1/homes/elderwesto/nishihost/nx_paper_native.elf" |
functions
| 35 | func pb_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 36 | func pb_puts(s: *u8) -> i64 { sys_write(1, s, pb_len(s)); return 0 } |
| 37 | func pb_num(v: i64) -> i64 |
| 49 | func pb_app(d: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 55 | func pb_appn(d: *u8, off: i64, src: *u8, a: i64, b: i64) -> i64 |
| 61 | func pb_appnum(d: *u8, off: i64, v: i64) -> i64 calls 1: sys_mmap |
| 71 | func pb_find(src: *u8, a: i64, b: i64, pat: *u8) -> i64 |
| 84 | func pb_int(s: *u8, n: i64) -> i64 called by 1: main |
| 94 | func pb_run3(a1: *u8, a2: *u8, a3: *u8) -> i64 |
| 116 | func main(argc: i64, argv: *i64) -> i64 |