code wiki / _hdl_build / nx_library_omni_census.nx
nx_library_omni_census.nx source
↩ module page · 81 lines · 8718 B
1// nx_library_omni_census.nx -- GROUNDED competitor census: our sovereign library/reader vs SOTA e-readers (operator
2// 2026-07-04: "not state of the art in loading, serving, hotkeys... i want an OMNI READER close to Kindle e-paper...
3// lots of our systems dont confirm if the media is USABLE (broken books/comics/table-headers, videos with no
4// thumbnail, movies with no scrub/chapters/dead-air/performance) -- flag this in research + roadmap").
5// SOTA grounded on repos fetched with our sovereign client (nx_ereader_sota_fetch): KOReader 27.5k, calibre 25k,
6// readest 22k (EPUB/MOBI/AZW3/FB2/CBZ/PDF+OPDS+sync+TTS+WebDAV), foliate 8.5k (typography), Kavita 11k (annotations/
7// ComicInfo/OPDS), Suwayomi 7k, Kotatsu 8.7k, LANraragi 3k (thumb/list/reader-overlay/OPDS), Stump/Mango (OPDS),
8// mokuro-reader (manga OCR overlay). OURS grounded by cx_have on the actual organ file (empty path = honest BEHIND).
9// 3-way BEHIND/PARITY/EXCEED; liar-kill = a claimed PARITY/EXCEED with no organ on disk flips to BEHIND (mechanical
10// honesty). Only STRUCTURAL+MEASURABLE exceeds. license_tier: ORIGINAL expect_exit: 0
11import "nx_syscalls.nx"
12
13const CX_BEHIND: i64 = 0
14const CX_PARITY: i64 = 1
15const CX_EXCEED: i64 = 2
16
17func cw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
18func cn(v: i64) -> i64 { let b: *u8=sys_mmap(24); var m: i64=v; if m<0{cw("-" as *u8);m=0-m} let t: *u8=sys_mmap(24); 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 i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
19func cx_have(path: *u8) -> i64 { if path[0]==(0 as u8) { return 0 } let fd: i64=sys_openat_rd(path); if fd<0 {return 0} sys_close(fd); return 1 }
20func cx_tier(t: i64) -> *u8 { if t==CX_EXCEED {return "EXCEED"} if t==CX_PARITY {return "PARITY"} return "BEHIND" }
21
22// st: [0]=behind [1]=parity [2]=exceed [3]=liarkill [4]=total
23func cx_ax(label: *u8, path: *u8, claimed: i64, note: *u8, st: *i64) -> i64 {
24 var tier: i64 = claimed
25 let have: i64 = cx_have(path)
26 var killed: i64 = 0
27 if claimed >= CX_PARITY { if have != 1 { tier = CX_BEHIND; killed = 1 } } // LIAR-KILL: no organ on disk -> cannot claim parity/exceed
28 cw(" ["); cw(cx_tier(tier)); cw("] "); cw(label); cw("\n "); cw(note)
29 if killed == 1 { cw(" <<LIAR-KILL: claimed but no organ on disk -> BEHIND>>"); st[3]=st[3]+1 }
30 cw("\n")
31 st[tier] = st[tier] + 1; st[4] = st[4] + 1
32 return 0
33}
34
35func main() -> i64 {
36 let st: *i64 = sys_mmap(64) as *i64
37 var i: i64=0; while i<8 { st[i]=0; i=i+1 }
38 cw("==== LIBRARY / OMNI-READER vs SOTA e-readers (grounded) ====\n" as *u8)
39
40 cw("\n-- OMNI-READER: formats + Kindle-class reading --\n" as *u8)
41 cx_ax("multi-format: EPUB + PDF + CBZ/comic + text" as *u8, "runtime/_hdl_build/_pdf_reflow_lib.nx" as *u8, CX_PARITY, "OURS: epub reader (reader_src.html) + PDF text-reflow + cbx comic. SOTA readest also MOBI/AZW3/FB2/DjVu. near-parity on the common set." as *u8, st)
42 cx_ax("Kindle e-paper typography: paginated columns, font/margin/leading/theme, hyphenation" as *u8, "" as *u8, CX_BEHIND, "OURS: continuous SCROLL only, no column pagination/typography engine. SOTA foliate/readest = the whole point (paginate.js-class). = north-star gap." as *u8, st)
43 cx_ax("e-ink/sepia/night modes + reduced-motion page turns" as *u8, "" as *u8, CX_BEHIND, "OURS: dark UI only. SOTA KOReader/readest = eink profiles, sepia, crossfade/none page-turn. BEHIND." as *u8, st)
44 cx_ax("page/scroll view modes + RTL/vertical (manga/webtoon)" as *u8, "runtime/_hdl_build/nx_reader_zoom_emit.nx" as *u8, CX_PARITY, "OURS: zoom guided-view + rtl flag + scroll reader. SOTA adds continuous-vertical webtoon + double-page spread. partial parity." as *u8, st)
45 cx_ax("reading-progress sync across devices (Whispersync-class)" as *u8, "runtime/_hdl_build/nx_reader_sync.nx" as *u8, CX_PARITY, "OURS: pos_<ukey>.json + auto_<ukey> per-user sync spine. matches readest/kavita device sync. PARITY." as *u8, st)
46 cx_ax("annotations / highlights / bookmarks" as *u8, "runtime/_hdl_build/nx_reader_zoom_emit.nx" as *u8, CX_PARITY, "OURS: per-page notes (api/ann) in the zoom reader. SOTA kavita/koreader = text-range highlights + export. partial parity." as *u8, st)
47 cx_ax("TTS read-aloud wired into the reader" as *u8, "" as *u8, CX_BEHIND, "OURS: nx_tts_* organs EXIST but are NOT wired to the reader UI. SOTA readest/koreader = built-in TTS. BEHIND (wire-up gap)." as *u8, st)
48 cx_ax("OPDS catalog feed (the e-reader interop standard)" as *u8, "" as *u8, CX_BEHIND, "OURS: none. SOTA UNIVERSAL (koreader/kavita/stump/mango/lanraragi/foliate all speak OPDS). biggest interop gap." as *u8, st)
49
50 cw("\n-- HOTKEYS / INPUT (operator named this) --\n" as *u8)
51 cx_ax("comprehensive reader hotkeys (+/- zoom, goto, home/end, fullscreen, help)" as *u8, "" as *u8, CX_BEHIND, "OURS zoom: only arrows/PageUpDn/f. plain: arrows/space/t/esc. MISSING +/- goto home/end fullscreen rtl-toggle help-overlay. BEHIND." as *u8, st)
52 cx_ax("library keyboard navigation (/ focus search, arrow grid, enter open, j/k)" as *u8, "" as *u8, CX_BEHIND, "OURS library SPA: ZERO keydown handlers. SOTA web readers = full keyboard nav. BEHIND." as *u8, st)
53
54 cw("\n-- LOADING / SERVING --\n" as *u8)
55 cx_ax("adjacent-page/tile PREFETCH + lookahead >1" as *u8, "" as *u8, CX_BEHIND, "OURS: only next-page PYRAMID gen (prep pg+1); no tile-byte prefetch, no lookahead, clearWorld wipes on every turn. BEHIND." as *u8, st)
56 cx_ax("HTTP Range/206 streaming for pages+tiles" as *u8, "" as *u8, CX_BEHIND, "OURS: 206 on /file ONLY; /api/book (tiles+pages, the high-volume path) is NON-ranged. SOTA streams ranges. BEHIND." as *u8, st)
57 cx_ax("ETag / If-None-Match / 304 conditional revalidation" as *u8, "" as *u8, CX_BEHIND, "OURS: NO ETag/Last-Modified anywhere. SOTA = 304 revalidation. BEHIND." as *u8, st)
58 cx_ax("compression (gzip/deflate) for text/JSON/HTML" as *u8, "" as *u8, CX_BEHIND, "OURS: none (we HAVE a DEFLATE codec elsewhere but it is not on the serve path). BEHIND." as *u8, st)
59 cx_ax("browser-cacheable images (max-age)" as *u8, "runtime/_hdl_build/nx_media_cover_lib.nx" as *u8, CX_PARITY, "OURS: max-age=86400 on /api/cover + /api/thumb. matches SOTA cover caching. PARITY (but tiles are no-store)." as *u8, st)
60
61 cw("\n-- MEDIA-USABILITY / LIVENESS PLANE (serving != working; OUR differentiator + the operator's pain) --\n" as *u8)
62 cx_ax("comic/image-book PER-PAGE decode verification (flag broken pages)" as *u8, "runtime/_hdl_build/nx_media_usable.nx" as *u8, CX_EXCEED, "OURS: nx_media_usable opens every page like the reader + proves it DECODES (nx_img_dims) -> ok/broken/verdict; proven on 5 live books. STRUCTURAL+MEASURABLE. SOTA readers assume-valid + fail silently. narrow but real EXCEED." as *u8, st)
63 cx_ax("EPUB/HTML structure + TABLE-render verification" as *u8, "" as *u8, CX_BEHIND, "OURS: none (operator has broken table-headers). the epub rung of the liveness plane. GAP." as *u8, st)
64 cx_ax("video THUMBNAIL presence + auto-generate on miss" as *u8, "" as *u8, CX_BEHIND, "OURS: none (operator sees videos with no thumbnail). GAP." as *u8, st)
65 cx_ax("movie liveness: duration + chapters + DEAD-AIR(silence) + performance(bitrate/res) readout" as *u8, "" as *u8, CX_BEHIND, "OURS: none (operator wants start/finish/chapters/dead-air/performance). the movie rung. GAP." as *u8, st)
66 cx_ax("library-wide media HEALTH sweep + UI broken-badge" as *u8, "" as *u8, CX_BEHIND, "OURS: nx_media_usable exists but is NOT wired into /api/list or the grid as a health badge yet. wire-up GAP." as *u8, st)
67
68 // ---- score ----
69 let tot: i64 = st[4]
70 var cov: i64 = 0; if tot > 0 { cov = (st[1]+st[2]) * 1000 / tot }
71 cw("\n==== SUMMARY ====\n" as *u8)
72 cw(" behind=" as *u8); cn(st[0]); cw(" parity=" as *u8); cn(st[1]); cw(" exceed=" as *u8); cn(st[2]); cw(" total=" as *u8); cn(tot); cw("\n" as *u8)
73 cw(" coverage=" as *u8); cn(cov); cw(" permille LIAR-KILL=" as *u8); cn(st[3]); cw("\n" as *u8)
74 cw(" HONEST READ: mostly BEHIND SOTA (as the operator said). the ONE real edge = the media-liveness plane\n" as *u8)
75 cw(" (decode-verify), which SOTA lacks -> lead there. TOP ROADMAP: 1) reader hotkeys+help 2) Kindle paginated\n" as *u8)
76 cw(" typography 3) OPDS 4) serving: ETag/304+range+gzip on /api/book 5) finish the liveness plane (epub-tables,\n" as *u8)
77 cw(" video-thumb, movie scrub/chapters/dead-air/perf) + wire health-badge into the grid.\n" as *u8)
78 // liar-kill must hold (no false parity/exceed survived)
79 if st[3] == 0 { sys_exit(0); return 0 }
80 sys_exit(1); return 1
81}