code wiki / _hdl_build / nx_reader_tcb_exceed.nx

nx_reader_tcb_exceed.nx

buildroot/runtime/_hdl_build/nx_reader_tcb_exceed.nx

14462 B193 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic reader
docsdependenciesstructsconstsfunctions

about

nx_reader_tcb_exceed.nx -- READER-EXCEEDS-CALIBRE-WEB measured TCB panel (Reader-arc RUNG 4, the architectural / exceed-by-unification axis the operator chose). AUTHOR=ORGAN, NO-WAVE, NO-OVERCLAIM (mirrors nx_driver_exceed.nx X-DRV-W3): COMPUTES every panel value from REAL artifacts -- never asserted -- and is HONEST about what is NOT apples-to-apples measurable. Nishi's sovereign reader (nx_media_server + the hand-written reader.html/cbx.html) is compared head-to-head with Calibre-Web on the axes a flat artifact can be MEASURED on: - single-auditable-server-binary : stat the RUNNING server ELF (/tmp/nx_media_server.sov.elf) and PROVE static linkage by parsing its program headers for the absence of PT_INTERP (=3). A static no-interpreter binary is the WHOLE server. Calibre-Web is a Python/Flask app (PROVEN here: its captured response sets an itsdangerous-signed `session=eyJ...` Flask cookie) -- an interpreter + framework stack, not a single auditable binary. => WIN minimal-auditable-server-TCB. - client-side-3rd-party-deps : count external resource pulls in the REAL pages. Nishi reader.html + cbx.html pull ZERO (no "://", no <script src>, no <link> -- everything is hand-written inline). Calibre-Web's captured login page pulls N bundled /static/{js,css}/libs/ (Bootstrap, jQuery, underscore, ...). => WIN dependency-free client. - format-unification : ONE engine emits BOTH a reflowable model (book.json) AND a fixed-layout model (cbx.json) -- both present, measured. (A Nishi capability, recorded; not asserted against CW.) - memory / throughput / latency / CW-image-size : NOT apples-to-apples measurable (server RSS is a WSL2 /proc artifact; CW content is auth-gated; loopback-vs-LAN; no NAS host access). => OPEN, NOT CLAIMED (the no-overclaim discipline; an authenticated same-host perf bench is a separate rung). Authors knowledge/registry/reader_tcb_exceed_panel.tsv + logs RDREXCEED -> reader_tcb_exceed.log. Sovereign (syscalls only, no gcc/python/.sh). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_seg_store.nx nx_reader_tcb_exceed.nx

imports: nx_syscalls.nxnx_seg_store.nx

imported by: nobody (leaf or entry point)

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

main rt_p sys_write sys_mmap rt_read sys_openat_rd sys_read sys_close sys_openat_append rt_fp sys_write ↻ sys_close ↻ sys_exit rt_u32 rt_u16 rt_count rt_has rt_count ↻ ss_begin ss_begin_cap sys_mmap ↻ rt_cat rt_catn sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn sys_mmap ↻ sys_write ↻ ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻ ss_catn ↻

structs

none

consts

27const RT_MAGIC_65536: i64 = 65536
28const RT_MAGIC_16777216: i64 = 16777216
29const RT_MAGIC_1048576: i64 = 1048576
30const RT_MAGIC_262144: i64 = 262144
31const RT_MAGIC_8192: i64 = 8192
32const RT_MAGIC_2048: i64 = 2048
34const RT_NISHI_HTML: *u8 = "knowledge/staging/media/reader.html"
35const RT_NISHI_CBX: *u8 = "knowledge/staging/media/cbx.html"
36const RT_NISHI_ELF: *u8 = "/tmp/nx_media_server.sov.elf"
37const RT_CW_FP: *u8 = "knowledge/status/calibre_web_fingerprint.html"
38const RT_CW_HDR: *u8 = "knowledge/status/calibre_web_fingerprint.headers.txt"
39const RT_BOOKJSON: *u8 = "knowledge/staging/media/reader/dissolution_wotsq_b1/book.json"
40const RT_CBXJSON: *u8 = "knowledge/staging/media/reader/dragonlance_vol1/cbx.json"
41const RT_PANEL: *u8 = "knowledge/registry/reader_tcb_exceed_panel.tsv"
42const RT_LOG: *u8 = "knowledge/status/reader_tcb_exceed.log"
43const RT_PREFIX: *u8 = "knowledge/store/rtcb-" // the measured-exceed panel in the sovereign seg-store (NO tsv)

functions

45func rt_p(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
46func rt_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ dst[off+i]=s[i]; i=i+1 } return off+i }
called by 1: main
47func rt_catn(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var o: i64=off; var q: i64=k-1; while q>=0{dst[o]=t[q];o=o+1;q=q-1} return o }
called by 1: main calls 1: sys_mmap
48func rt_seg_next() -> i64 { let segs: *i64 = sys_mmap(8*260) as *i64; let n: i64 = ss_manifest(RT_PREFIX, segs); if n<0 { return 1 } return 1+n }
called by 1: main calls 2: sys_mmapss_manifest
49func rt_fp(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 }
called by 1: main calls 1: sys_write
50func rt_fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
53func rt_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
64func rt_count(buf: *u8, n: i64, pat: *u8, pl: i64) -> i64
called by 2: rt_hasmain
75func rt_has(buf: *u8, n: i64, pat: *u8, pl: i64) -> i64 { if rt_count(buf,n,pat,pl) > 0 { return 1 } return 0 }
called by 1: main calls 1: rt_count
78func rt_u16(b: *u8, o: i64) -> i64 { return (b[o] as i64) + (b[o+1] as i64)*256 }
called by 1: main
79func rt_u32(b: *u8, o: i64) -> i64 { return (b[o] as i64) + (b[o+1] as i64)*256 + (b[o+2] as i64)*RT_MAGIC_65536 + (b[o+3] as i64)*RT_MAGIC_16777216 }
called by 1: main
81func main() -> i64