nx_cvf_index.nx source
↩ module page · 258 lines · 13684 B
1// nx_cvf_index.nx -- THE CVF LIBRARY TAB COMPILER (operator 2026-08-13: "a tab in /library to
2// see all these papers with proper organization"). Compiles the library's research-papers page
3// FROM THE FETCHED LISTING ARTIFACTS (knowledge/fetched/rf_*.raw, saved by nx_research_fetch):
4// parses CVF open-access day listings (ptitle rows -> abstract href + title; the adjacent
5// paper.pdf href), tags each paper into a program FAMILY by title keywords (worlds/procgen,
6// gaussian-splatting, beings/avatars, motion, meshing, general), and emits ONE organized page:
7// coverage banner (what is ingested vs pending -- no silent caps), per-family counts, then
8// per-conference sections. Data-driven: knowledge/cvf_listings.conf rows `label<TAB>rf-path`
9// (trailing newline required, # comments) -- adding a conference is a conf edit + a fetch,
10// never a code edit. FAIL-LOUD: unreadable manifest/file or a file yielding ZERO rows REFUSES
11// naming it (a listing that parses to nothing is a broken parse, not an empty conference).
12// nx_cvf_index <listings.conf> <out.html>
13// exit: 0 ok | 1 io | 2 usage | 3 refuse (named). license_tier: ORIGINAL. No hw writes (Rule 26).
14import "nx_syscalls.nx"
15
16const CV_FCAP: i64 = 4194304
17const CV_OCAP: i64 = 8388608
18const CV_MAXF: i64 = 64
19
20func cv_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
21func cv_puts(s: *u8) -> i64 { sys_write(1, s, cv_len(s)); return 0 }
22func cv_num(v: i64) -> i64 {
23 if v == 0 { sys_write(1, "0" as *u8, 1); return 0 }
24 var m: i64 = v
25 if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m }
26 let t: *u8 = sys_mmap(32)
27 var k: i64 = 0
28 while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }
29 let o: *u8 = sys_mmap(32)
30 var i: i64 = 0
31 while i < k { o[i] = t[k - 1 - i]; i = i + 1 }
32 sys_write(1, o, k)
33 return 0
34}
35func cv_app(dst: *u8, off: i64, s: *u8) -> i64 {
36 var i: i64 = 0
37 var o: i64 = off
38 while s[i] != (0 as u8) { dst[o] = s[i]; o = o + 1; i = i + 1 }
39 return o
40}
41func cv_appn(dst: *u8, off: i64, src: *u8, a: i64, b: i64) -> i64 {
42 var o: i64 = off
43 var i: i64 = a
44 while i < b { dst[o] = src[i]; o = o + 1; i = i + 1 }
45 return o
46}
47func cv_appnum(dst: *u8, off: i64, v: i64) -> i64 {
48 var o: i64 = off
49 if v == 0 { dst[o] = 48 as u8; return o + 1 }
50 var m: i64 = v
51 let t: *u8 = sys_mmap(32)
52 var k: i64 = 0
53 while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }
54 while k > 0 { k = k - 1; dst[o] = t[k]; o = o + 1 }
55 return o
56}
57// substring find in src[a..b), returns start index or -1
58func cv_find(src: *u8, a: i64, b: i64, pat: *u8) -> i64 {
59 let pl: i64 = cv_len(pat)
60 if pl == 0 { return 0 - 1 }
61 var i: i64 = a
62 while i + pl <= b {
63 var j: i64 = 0
64 var hit: i64 = 1
65 while j < pl { if src[i + j] != pat[j] { hit = 0; j = pl } else { j = j + 1 } }
66 if hit == 1 { return i }
67 i = i + 1
68 }
69 return 0 - 1
70}
71func cv_read(path: *u8, buf: *u8, cap: i64) -> i64 {
72 let fd: i64 = sys_openat_rd(path)
73 if fd < 0 { return 0 - 1 }
74 var n: i64 = 0
75 var go: i64 = 1
76 while go == 1 {
77 let base: i64 = buf as i64
78 let r: i64 = sys_read(fd, (base + n) as *u8, cap - n)
79 if r <= 0 { go = 0 } else { n = n + r }
80 if n >= cap { go = 0 }
81 }
82 sys_close(fd)
83 return n
84}
85// family of a title in src[a..b): 0 worlds 1 gsplat 2 beings 3 motion 4 meshing 5 general
86func cv_family(src: *u8, a: i64, b: i64) -> i64 {
87 if cv_find(src, a, b, "Procedural" as *u8) >= 0 { return 0 }
88 if cv_find(src, a, b, "Terrain" as *u8) >= 0 { return 0 }
89 if cv_find(src, a, b, "Scene Generation" as *u8) >= 0 { return 0 }
90 if cv_find(src, a, b, "Scene Synthesis" as *u8) >= 0 { return 0 }
91 if cv_find(src, a, b, "Layout" as *u8) >= 0 { return 0 }
92 if cv_find(src, a, b, "Indoor" as *u8) >= 0 { return 0 }
93 if cv_find(src, a, b, "City" as *u8) >= 0 { return 0 }
94 if cv_find(src, a, b, "World" as *u8) >= 0 { return 0 }
95 if cv_find(src, a, b, "Splatting" as *u8) >= 0 { return 1 }
96 if cv_find(src, a, b, "Gaussian" as *u8) >= 0 { return 1 }
97 if cv_find(src, a, b, "NeRF" as *u8) >= 0 { return 1 }
98 if cv_find(src, a, b, "Radiance" as *u8) >= 0 { return 1 }
99 if cv_find(src, a, b, "Avatar" as *u8) >= 0 { return 2 }
100 if cv_find(src, a, b, "Human" as *u8) >= 0 { return 2 }
101 if cv_find(src, a, b, "SMPL" as *u8) >= 0 { return 2 }
102 if cv_find(src, a, b, "Garment" as *u8) >= 0 { return 2 }
103 if cv_find(src, a, b, "Face" as *u8) >= 0 { return 2 }
104 if cv_find(src, a, b, "Body" as *u8) >= 0 { return 2 }
105 if cv_find(src, a, b, "Motion" as *u8) >= 0 { return 3 }
106 if cv_find(src, a, b, "Dance" as *u8) >= 0 { return 3 }
107 if cv_find(src, a, b, "Retarget" as *u8) >= 0 { return 3 }
108 if cv_find(src, a, b, "Animation" as *u8) >= 0 { return 3 }
109 if cv_find(src, a, b, "Mesh" as *u8) >= 0 { return 4 }
110 if cv_find(src, a, b, "Surface Reconstruction" as *u8) >= 0 { return 4 }
111 return 5
112}
113func cv_famname(f: i64) -> *u8 {
114 if f == 0 { return "worlds" as *u8 }
115 if f == 1 { return "gsplat" as *u8 }
116 if f == 2 { return "beings" as *u8 }
117 if f == 3 { return "motion" as *u8 }
118 if f == 4 { return "meshing" as *u8 }
119 return "general" as *u8
120}
121
122func main(argc: i64, argv: *i64) -> i64 {
123 if argc < 3 { cv_puts("usage: nx_cvf_index <listings.conf> <out.html>\n" as *u8); sys_exit(2); return 2 }
124 let mlp: *i64 = sys_mmap(16) as *i64
125 let mf: *u8 = sys_read_file(argv[1] as *u8, mlp)
126 if (mf as i64) == 0 { cv_puts("CVF-INDEX REFUSE: cannot read listings conf\n" as *u8); sys_exit(3); return 3 }
127 let mn: i64 = mlp[0]
128 let labs: *i64 = sys_mmap(CV_MAXF*8) as *i64
129 let labe: *i64 = sys_mmap(CV_MAXF*8) as *i64
130 let pths: *i64 = sys_mmap(CV_MAXF*8) as *i64
131 let pthe: *i64 = sys_mmap(CV_MAXF*8) as *i64
132 var nf: i64 = 0
133 var mi: i64 = 0
134 while mi < mn {
135 var le: i64 = mi
136 var sc: i64 = 1
137 while sc == 1 { if le >= mn { sc = 0 } else { if mf[le] == (10 as u8) { sc = 0 } else { le = le + 1 } } }
138 if le > mi { if mf[mi] != (35 as u8) {
139 let tb: i64 = cv_find(mf, mi, le, "\t" as *u8)
140 if tb > mi { if nf < CV_MAXF {
141 labs[nf] = mi
142 labe[nf] = tb
143 pths[nf] = tb + 1
144 pthe[nf] = le
145 nf = nf + 1
146 } }
147 } }
148 mi = le + 1
149 }
150 if nf == 0 { cv_puts("CVF-INDEX REFUSE: manifest has no rows\n" as *u8); sys_exit(3); return 3 }
151 let fb: *u8 = sys_mmap(CV_FCAP)
152 let out: *u8 = sys_mmap(CV_OCAP)
153 let secs: *u8 = sys_mmap(CV_OCAP)
154 let fam: *i64 = sys_mmap(8*8) as *i64
155 var fi9: i64 = 0
156 while fi9 < 6 { fam[fi9] = 0; fi9 = fi9 + 1 }
157 var so: i64 = 0
158 var total: i64 = 0
159 var f: i64 = 0
160 while f < nf {
161 let pbuf: *u8 = sys_mmap(512)
162 var pn: i64 = cv_appn(pbuf, 0, mf, pths[f], pthe[f])
163 pbuf[pn] = 0 as u8
164 let n: i64 = cv_read(pbuf, fb, CV_FCAP)
165 if n <= 0 { cv_puts("CVF-INDEX REFUSE: cannot read listing " as *u8); cv_puts(pbuf); cv_puts("\n" as *u8); sys_exit(3); return 3 }
166 so = cv_app(secs, so, "<h2>" as *u8)
167 so = cv_appn(secs, so, mf, labs[f], labe[f])
168 so = cv_app(secs, so, "</h2>\n<table><tr><th>family</th><th>paper</th><th>links</th></tr>\n" as *u8)
169 var rows: i64 = 0
170 var p: i64 = 0
171 var run: i64 = 1
172 while run == 1 {
173 let dt: i64 = cv_find(fb, p, n, "class=\"ptitle\"" as *u8)
174 if dt < 0 { run = 0 } else {
175 let ha: i64 = cv_find(fb, dt, n, "href=\"" as *u8)
176 if ha < 0 { run = 0 } else {
177 let hs: i64 = ha + 6
178 let he: i64 = cv_find(fb, hs, n, "\"" as *u8)
179 let ts: i64 = cv_find(fb, he, n, ">" as *u8) + 1
180 let te: i64 = cv_find(fb, ts, n, "</a>" as *u8)
181 if te < 0 { run = 0 } else {
182 let pa: i64 = cv_find(fb, te, n, "paper.pdf\">pdf" as *u8)
183 var ps: i64 = 0 - 1
184 var pe: i64 = 0 - 1
185 if pa >= 0 {
186 var back: i64 = pa
187 var g2: i64 = 1
188 while g2 == 1 { if back <= te { g2 = 0 } else { if fb[back] == (34 as u8) { g2 = 0 } else { back = back - 1 } } }
189 var hb: i64 = back
190 g2 = 1
191 while g2 == 1 { if hb <= te { g2 = 0 } else { if fb[hb-1] == (34 as u8) { g2 = 0 } else { hb = hb - 1 } } }
192 ps = hb
193 pe = pa + 9
194 }
195 let fm: i64 = cv_family(fb, ts, te)
196 fam[fm] = fam[fm] + 1
197 so = cv_app(secs, so, "<tr><td class=f" as *u8)
198 so = cv_appnum(secs, so, fm)
199 so = cv_app(secs, so, ">" as *u8)
200 so = cv_app(secs, so, cv_famname(fm))
201 so = cv_app(secs, so, "</td><td><a href=\"https://openaccess.thecvf.com" as *u8)
202 so = cv_appn(secs, so, fb, hs, he)
203 so = cv_app(secs, so, "\">" as *u8)
204 so = cv_appn(secs, so, fb, ts, te)
205 so = cv_app(secs, so, "</a></td><td>" as *u8)
206 if ps >= 0 {
207 so = cv_app(secs, so, "<a href=\"https://openaccess.thecvf.com" as *u8)
208 so = cv_appn(secs, so, fb, ps, pe)
209 so = cv_app(secs, so, "\">pdf</a>" as *u8)
210 }
211 so = cv_app(secs, so, "</td></tr>\n" as *u8)
212 rows = rows + 1
213 p = te
214 }
215 }
216 }
217 }
218 so = cv_app(secs, so, "</table>\n" as *u8)
219 if rows == 0 { cv_puts("CVF-INDEX REFUSE: zero rows parsed from " as *u8); cv_puts(pbuf); cv_puts(" (broken parse, not an empty conference)\n" as *u8); sys_exit(3); return 3 }
220 cv_puts("CVF-INDEX file=" as *u8); cv_puts(pbuf)
221 cv_puts(" rows=" as *u8); cv_num(rows); cv_puts("\n" as *u8)
222 total = total + rows
223 f = f + 1
224 }
225 var o: i64 = 0
226 o = cv_app(out, o, "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>Research Papers - CVF Open Access - Nishi Library</title>\n<style>body{margin:0;background:#0b0e16;color:#e8ecf6;font:15px/1.6 system-ui,sans-serif}.wrap{max-width:1100px;margin:0 auto;padding:26px 18px 80px}a{color:#c9a0ff;text-decoration:none}a:hover{text-decoration:underline}h1{font-size:26px;margin:0 0 6px}h2{font-size:13px;letter-spacing:.12em;text-transform:uppercase;color:#c9a0ff;margin:28px 0 10px;border-bottom:1px solid #222c44;padding-bottom:6px}.note{color:#8a97ad;font-size:.88rem;max-width:90ch}table{border-collapse:collapse;width:100%;font-size:.86rem}td,th{border:1px solid #222c44;padding:5px 9px;text-align:left;vertical-align:top}th{color:#c9a0ff;background:#10141f}.st{display:inline-block;background:#141a26;border:1px solid #26304a;border-radius:10px;padding:8px 14px;margin:4px 6px 4px 0}.st b{font-size:19px;display:block}.f0{color:#7fd7a0}.f1{color:#8fc7ff}.f2{color:#e6a5c0}.f3{color:#e6c07b}.f4{color:#b9b1dc}.f5{color:#8a97ad}</style></head><body><div class=\"wrap\">\n<p class=\"note\"><a href=\"/library\">Nishi Library</a> › Research Papers</p>\n<h1>Research Papers — CVF Open Access</h1>\n<p class=\"note\">Compiled by <code>nx_cvf_index</code> from fetched CVF open-access listings. Each paper links to its open-access abstract page and PDF at the Computer Vision Foundation (copyright the authors/CVF). Families are title-keyword tags serving the <a href=\"/world/procgen\">procgen program</a>: worlds/procgen · gaussian-splatting · beings/avatars · motion · meshing. COVERAGE IS STATED, NEVER SILENT: only the proceedings listed below are ingested so far; the remaining CVF proceedings (2013-2026, ~30k papers) land via the standing fetch + crawl lanes and appear here as their listings are banked.</p>\n" as *u8)
227 o = cv_app(out, o, "<div>" as *u8)
228 var f2: i64 = 0
229 while f2 < 6 {
230 o = cv_app(out, o, "<span class=\"st f" as *u8)
231 o = cv_appnum(out, o, f2)
232 o = cv_app(out, o, "\"><b>" as *u8)
233 o = cv_appnum(out, o, fam[f2])
234 o = cv_app(out, o, "</b>" as *u8)
235 o = cv_app(out, o, cv_famname(f2))
236 o = cv_app(out, o, "</span>" as *u8)
237 f2 = f2 + 1
238 }
239 o = cv_app(out, o, "<span class=\"st\"><b>" as *u8)
240 o = cv_appnum(out, o, total)
241 o = cv_app(out, o, "</b>total papers</span></div>\n" as *u8)
242 o = cv_appn(out, o, secs, 0, so)
243 o = cv_app(out, o, "</div></body></html>\n" as *u8)
244 let fd: i64 = sys_openat_wr(argv[2] as *u8, 0x1a4)
245 if fd < 0 { cv_puts("CVF-INDEX REFUSE: cannot open out\n" as *u8); sys_exit(1); return 1 }
246 sys_write(fd, out, o)
247 sys_close(fd)
248 cv_puts("CVF-INDEX-OK files=" as *u8); cv_num(nf)
249 cv_puts(" papers=" as *u8); cv_num(total)
250 cv_puts(" worlds=" as *u8); cv_num(fam[0])
251 cv_puts(" gsplat=" as *u8); cv_num(fam[1])
252 cv_puts(" beings=" as *u8); cv_num(fam[2])
253 cv_puts(" motion=" as *u8); cv_num(fam[3])
254 cv_puts(" meshing=" as *u8); cv_num(fam[4])
255 cv_puts(" general=" as *u8); cv_num(fam[5])
256 cv_puts(" out_bytes=" as *u8); cv_num(o); cv_puts("\n" as *u8)
257 return 0
258}