code wiki / _hdl_build / nx_cc_warc_ingest.nx

nx_cc_warc_ingest.nx

buildroot/runtime/_hdl_build/nx_cc_warc_ingest.nx

26892 B418 linesdepth 7pulls 19 transitivereach 0 importersview sourcekind tooltopic cc
docsdependenciesstructsconstsfunctions

about

nx_cc_warc_ingest.nx -- BULK Common Crawl ingester: a LOCAL .warc.gz file -> the dp-web-pub- web shard. SCALE rung over nx_cc_ingest (one network round-trip per record): here ONE pre-downloaded WARC file (~1GB, ~30-40k pages; each CC record = its own gzip member) is stream-walked member-by-member -> 'response' records -> HTTP 200 + text/html -> html->text -> quality filters -> ss_add doc:/url:/loc: rows + out: edges (same node identity as the crawler/serve, so every page feeds PageRank). BATCH+RESUME BY CONSTRUCTION: the deflate path allocates interior mappings it cannot free, so one process walks at most <maxmembers> members starting at the byte offset checkpointed in <localfile>.off, commits its segments, rewrites the checkpoint, exits. A driver loops invocations until DONE prints. (Also crash-safe: a killed batch never advances the checkpoint past committed work.) usage: nx_cc_warc_ingest <localfile> <cc-warc-path> [maxmembers] <cc-warc-path> = the crawl-data/... path the file came from; stored in loc: rows for the rot-fallback, byte-offset-exact, so a served result can re-range-fetch its record just like nx_cc_ingest's rows. exit 0 = batch clean (prints MORE nextoff=N or DONE, + verdict=PASS) ; nonzero = failure, checkpoint NOT advanced past the bad byte (surface corruption, never silently skip). license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_corpus_ingest.nx nx_gzip_wrap.nx nx_warc_reader.nx nx_outlink_harvest.nx nx_cc_warc_ingest.nx

imports: nx_corpus_ingest.nxnx_gzip_wrap.nxnx_warc_reader.nxnx_outlink_harvest.nx

imported by: nobody (leaf or entry point)

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

main cw_puts cw_atoin sys_fstatat cw_readoff sys_read cw_atoin ↻ cw_num sys_read ↻ dss_prefix ss_manifest_cap ss_manifest_file_cap sys_mmap ss_cat ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read ↻ sys_close ss_segid_ok ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ↻ ss_readall ↻ sys_munmap ss_cat ↻ ss_loadfile sys_map_file sys_openat_rd ↻ sys_lseek ↻ sys_close ↻ ss_readall ↻ ss_load_aux2 sys_mmap ↻ ss_cat ↻

structs

none

consts

19const CWI_MAGIC_1152: i64 = 1152
20const CWI_MAGIC_8192: i64 = 8192
21const CWI_MAGIC_1048576: i64 = 1048576
22const CWI_MAGIC_2048: i64 = 2048
23const CWI_MAGIC_2400: i64 = 2400
29const CWI_WINDOW: i64 = 134217728 // read window per batch (128MiB)
30const CWI_MAXMEM: i64 = 12000 // default members per batch
31const CWI_RECCAP: i64 = 33554432 // largest single inflated WARC record accepted: a <=2MB compressed
34const CWI_SEGCAP: i64 = 16777216 // 16MiB writer segments: serve cost grows with segment COUNT, so big
36const CWI_MINTEXT: i64 = 400 // min extracted BYTES: kills nav-chrome stubs + soft-404s at ingest
42const CWI_SCANSPAN: i64 = 4096 // classification window (bytes)
43const CWI_MINMASS: i64 = 150 // min weighted word-char count in the window
44const CWI_CJKW: i64 = 2 // CJK char weight in the mass sum
45const CWI_MAXURL: i64 = 1500 // == OLH_MAXURL policy: longer urls are tracker/junk, skip the page

functions

47func cw_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
48func cw_num(v: i64) -> i64
called by 1: main
57func cw_atoin(s: *u8, n: i64) -> i64
called by 2: cw_readoffmain
63func cw_cntsub(hay: *u8, n: i64, lit: *u8, litlen: i64) -> i64
called by 1: cw_hassub
73func cw_hassub(hay: *u8, n: i64, lit: *u8, litlen: i64) -> i64
called by 1: main calls 1: cw_cntsub
80func cw_scriptmass(t: *u8, n: i64, counts: *i64) -> i64
106func cw_lngkey(cid: i64, out: *u8) -> i64
called by 1: main
115func cw_lockey(cid: i64, out: *u8) -> i64
called by 1: main
123func cw_readoff(path: *u8) -> i64
called by 1: main calls 2: sys_readcw_atoin
133func cw_writeoff(path: *u8, v: i64) -> i64
called by 1: main calls 1: sys_openat_wr
147func main(argc: i64, argv: *i64) -> i64