code wiki / _hdl_build / nx_fp_backfill.nx

nx_fp_backfill.nx

buildroot/runtime/_hdl_build/nx_fp_backfill.nx

8601 B157 linesdepth 6pulls 19 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_fp_backfill.nx -- BACKFILL THE fp: FINGERPRINT ROW OVER ALREADY-INGESTED DOCS. WHY: nx_web_crawl_step now persists fp:<cid> (the simhash it always computed and used to discard), so intra-host near-duplication -- the real doorway signature -- is a property of the index. But that is FORWARD-ONLY: every doc ingested before 2026-08-16 has no fp: row, so a duplication census would silently measure only the newest slice and report it as the corpus. This closes that gap. NO NETWORK. The text is already stored; this reads doc:<cid>, hashes it, writes fp:<cid>. A source that died years ago costs nothing here -- which is the whole argument for an entity corpus over a page index: capture once, and every later question is local. MEMORY SHAPE, STATED because the sibling's is different: nx_web_shard_compact was OOM-killed twice (bytes-in=1883885124, 2026-07-25) because it MATERIALISES a merged segment in RAM. This does not -- it holds one doc at a time and emits a ~20-byte row, so its bound is on RUNTIME, not memory. BOUNDED AND RESUMABLE, never a silent runaway: argv[1] max REQUIRED and must be > 0 -- refuse rather than default to unbounded argv[2] skip resume offset into the walk order (default 0) argv[3] commit literal "commit" to write; DEFAULT IS A DRY RUN that changes nothing PROGRESS IS PROVABLE: every run prints scanned/had_fp/written/capped. The sibling's range-fold note is the warning -- a bounded sweep with the wrong selection rule runs forever WITHOUT ADVANCING, so "did this converge" must be a number, not a feeling. capped=1 says the run stopped at max, i.e. the corpus is NOT yet fully covered and the next run needs skip=<scanned+skip>. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_corpus_ingest.nx nx_simhash.nx nx_itoa_lib.nx nx_fp_backfill.nx

imports: nx_corpus_ingest.nxnx_simhash.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main fb_puts fb_atoi dss_prefix ss_open ss_open2 ss_open3 sys_now_us sys_mmap nxa_die nxa_lock_take nxa_lock_give nxa_report_overrun sys_clock_gettime_mono sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ss_readall sys_munmap ss3_admit ss3_ann sys_mmap ↻ ss_cat ↻ ss_catn sys_write sys_munmap ↻ sys_now_us ↻ ss3_streq ss3_docs_size sys_mmap ↻ ss_cat ↻ sys_fstatat sys_munmap ↻ ss3_load_range ss_cat ↻ ss_loadfile sys_map_file ss_readall ↻

structs

none

consts

29const FB_KEYCAP: i64 = 64
30const FB_VALCAP: i64 = 32

functions

32func fb_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 2: fb_nummain
33func fb_num(v: i64) -> i64
called by 1: main calls 1: fb_puts
44func fb_atoi(s: *u8) -> i64
called by 1: main
51func main(argc: i64, argv: *i64) -> i64