code wiki / _hdl_build / nx_fp_backfill.nx
nx_fp_backfill.nx
buildroot/runtime/_hdl_build/nx_fp_backfill.nx
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
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
structs
| none |
consts
| 29 | const FB_KEYCAP: i64 = 64 |
| 30 | const FB_VALCAP: i64 = 32 |
functions
| 32 | func 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 } |
| 33 | func fb_num(v: i64) -> i64 |
| 44 | func fb_atoi(s: *u8) -> i64 called by 1: main |
| 51 | func main(argc: i64, argv: *i64) -> i64 |