Repository navigation
msmarco-disk: add corpus-sweep-or, every passage fetched once per epoch (v8) - #404
Conversation
…ch (v8) rare-terms-or-wide fetches only the top 100 of its matches, a set that fit Redis Flex's RAM tier (~6.2M of 10M documents) after one epoch. corpus-sweep-or fetches EVERY passage of the corpus at least once per epoch, so a cache smaller than the corpus keeps missing on both engines. Cover: each passage's rarest eligible segment term of df SWEEP_DF = 1-100 (the rare-term pool and rare-terms-or-wide's postings; ties by term) is chosen; those terms' postings cover every passage holding such a term. A text cover alone cannot reach the corpus: on the 10M corpus df <= 100 covers 37.0% of the passages, df <= 200 39.4%, df <= 2,000 42.1%, any df 42.9% (eligible terms need zero ambiguous passages corpus-wide). Every other passage is added by docid (the docid-batch pool). Lines are [[terms], [docids], count]: an OR of the terms' field-scoped union and one docid tag union. Epoch e orders terms and docids by rank_key(seed, "corpus-sweep-or/epoch-<e>/term|docid", item) and packs them greedily (pack_sweep): an item joins the line while sum(df) + docids <= SWEEP_TOP = 200 and terms <= SWEEP_MAX_TERMS = 64. Distinct matches <= that sum, so the page of 200 fetches every match. Fixed top 200, HIGH_PRESSURE_FETCH, exact totals only; lines = per_family + RESERVED, epochs reshuffled (no line repeats). 10M corpus (per_family 1M): 1,860,417 terms (df sum 7,270,291) cover 3,704,836 passages, 6,295,123 docids the rest, 0 unreachable; an epoch is ~69,700 lines, mean count 194.6, ~27 terms + ~90 docids per line; the file is 1,000,065 lines (14.3 epochs, 4.4 GB). Generation 5.7 min, 5.2 GB peak RSS (v7: 5.5 GB). The manifest records coverage, chosen-term df distribution, epoch lengths and per-epoch count statistics. GENERATOR is vdb-msmarco-disk/v8; KEY_DOMAIN unchanged. The thirteen v7 family files are byte-identical (fixture pins, and the real 1M and 10M corpora compared against 5ba5429); v7 manifests are refused. The duration-mode single-pass identity pin moves with the generator name. Tests: rarest_term tie order, pack_sweep greedy bounds, synthetic epochs reach every passage with each unit once, an independent re-derivation of the fixture file (brute-force eligibility, Redis tokens, epochs), Redis / OpenSearch rendering, param and malformed-line checks, Redis-token count oracle, v8 pins. A sweep-gap fixture variant (30 passages without a rare term) exercises docid units; the integration disk suite uploads it and gains a corpus-sweep-or point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. What I checked: the cover's correctness and exact counts ( Worth fixing before merge
Optional / follow-up
Net: careful, well-pinned addition. The v7 byte-identity is backed by fixture pins and SHA comparisons on the real corpora, and the count oracle covers every line. Fix the epoch-0 reserve gap (or document it precisely) and the "one fixed epoch" wording before regenerating, and it looks ready. |
Docker Build ValidationPlatforms tested:
Tests performed:
|
msmarco-disk: add
corpus-sweep-or, every passage fetched at least once per epoch (v8)Why
rare-terms-or-widefetches only the top 100 of each query's matches. After one epoch, that set fit in Redis Flex's RAM tier (~6.2M of the 10M documents), so the run never reached flash.corpus-sweep-orfetches every passage of the corpus at least once per epoch, in a new seeded order each epoch. Any cache smaller than the corpus keeps missing, on both Redis Flex and OpenSearch.What
Cover. For each passage, pick its rarest eligible
segmentterm with df 1–100. This is therare-termpool with the sametext_match/ long-run / Redis-escape eligibility, and it reusesrare-terms-or-wide's postings. Ties go to the smaller term in byte order. The chosen terms' postings cover every passage that holds such a term.Docid complement. A text-only cover cannot reach the corpus. On the 10M corpus:
An eligible term must have zero ambiguous passages across the whole corpus, and almost no frequent term does. Every other passage is therefore added by its
docid, taken from thedocid-batchpool (safe, not a Redis tag piece, unique).Line format.
[[terms], [docids], count]is the OR of one field-scoped term union and one docid tag union:((@segment:(t1 | …)) | (@docid:{d1 | …}))bool.shouldof the terms'bool.shouldand a docidtermsfilter, at most 65 clauses.Packing. Epoch
eorders the terms and docids byrank_key(seed, "corpus-sweep-or/epoch-<e>/term|docid", item). It then packs them greedily: an item joins the current line whilesum(df) + docids ≤ SWEEP_TOP(200) and the line holds at mostSWEEP_MAX_TERMS(64) terms. A line's distinct matches are at most that sum, so the page of 200 fetches every match.Query settings.
topis fixed at 200,fetchis exactlytitle, segment, url, and onlytotal_hits: exactis accepted.File length. The file holds
per_family + 65lines, like the other families. Epochs are reshuffled, so no line repeats.Constants
SWEEP_DF = (1, 100): going above 100 adds little coverage (+2.4 points at 200), and a term must fit in a line.SWEEP_TOP = 200: twice the other high-pressure pages, which means more documents per query, and room for a df-100 term next to others.SWEEP_MAX_TERMS = 64: most terms have df 1, so without a cap a line could hold up to 200 term clauses. On the 10M corpus the cap is never reached (max 51 terms per line).Numbers (10M corpus,
--disk-queries-per-family 1000000, seed 1)The manifest records these numbers under
families.corpus-sweep-or.batch:coverage,terms,epoch_lines,epoch_lines_each,epoch_expected_count,epoch_fetched_passages,epoch_distinct_passages,terms_per_lineanddocids_per_line.Compatibility
GENERATORis nowvdb-msmarco-disk/v8;KEY_DOMAINis unchanged.Usage note
A duration-mode window must cover at least one epoch (~69,700 queries at 10M) to sweep the whole corpus. A shorter window keeps cycling through part of it.
Tests
rarest_termtie order.pack_sweepgreedy bounds and the term cap.corpus-sweep-orpoint. Its window must hold lines with docids, and the Redis and OpenSearch replies are checked against the oracle.cargo fmt --checkandcargo clippy --all-targets -- -D warnings: clean.opensearch_maintenancemock-socket tests. Those also fail on unmodified master on the test machine.integration_redis: 81 pass.integration_opensearch: 46 pass.Regenerate
On an existing v7 directory, the command reports
corpus-sweep-or.jsonlas missing and leaves the fresh generation in.msmarco-disk-v1.staging. Replace the old directory with it.🤖 Generated with Claude Code