Skip to content

validate_queries.sql: MS MARCO query 1267 fails only on concurrent-build path (rank-5 doc missing from top-10) #363

Description

@tjgreen42

Surfaced by the hardened benchmark validation watchdog in #360 on the concurrent-INSERT MS MARCO path. Distinct from #361 (different query, different failure mode).

Symptom

Validate MS MARCO concurrent results reports:

 query_id | docs_match | scores_match | missing_docs | extra_docs | max_abs_diff | details
----------+------------+--------------+--------------+------------+--------------+-----------------------------------
     1267 | f          | t            |            1 |          1 |     0.000003 | Missing: 1956260; Extra: 3906882

Key facts

  • Query 1267: 3 ways a log can move when bucking on side hill (token bucket 5)
  • Failure is on concurrent-INSERT path only. The single-txn COPY path validates this query cleanly.
  • Doc 1956260 is rank 5 in ground truth (gt score 20.297, well above the rank-10 cutoff of 18.786). Not a rank-10 tie-break: it's solidly in the top-10 in GT but absent from the concurrent-build index's top-10.
  • Overlapping docs (those in both index and GT top-10) match scores within 0.000003 — so the BM25 scoring formula is correct for what the index returns.
  • The widened tie-break tolerance (0.01) in PR fix: sort posting list when spilling memtable (root-cause MS MARCO bucket-8 hang) #360 (dd466229) caught and forgave one of the two tied-cluster pairs (2205571 / 3906879); this remaining pair is the genuine non-tie discrepancy.

Hypotheses

  1. Real concurrent-insert correctness issue. Despite the segment-sort fix (PR fix: sort posting list when spilling memtable (root-cause MS MARCO bucket-8 hang) #360) making bm25_check_segment_consistency return 0 inconsistencies, there may be another concurrent-path-specific bug — e.g., a tokenization race during tp_aminsert, a stale total_docs / avg_doc_len field, or BMW pruning incorrectly excluding doc 1956260.
  2. Row never inserted. pgbench draws from insert_seq; if a transaction failed silently (constraint violation, etc.) doc 1956260 might be missing from msmarco_passages entirely. The index would correctly exclude it. Easy to diagnose: SELECT count(*) FROM msmarco_passages WHERE passage_id = 1956260 in the failing CI environment.
  3. Stale ground truth. ground_truth_pg17.tsv was generated at some earlier index state; if doc 1956260's heap row has changed (or its tokenization differs in a corner case the GT precompute didn't model), GT might disagree with the current index even on a correctly-built version.

Repro & diagnosis

Diagnostic queries to run in a failing CI environment:

-- Was the doc actually inserted?
SELECT count(*) FROM msmarco_passages WHERE passage_id = 1956260;

-- What does the index return for the query?
SELECT passage_id,
       passage_text <@> to_bm25query('3 ways a log can move when bucking on side hill', 'msmarco_bm25_idx') AS neg_score
FROM msmarco_passages
ORDER BY passage_text <@> to_bm25query('3 ways a log can move when bucking on side hill', 'msmarco_bm25_idx')
LIMIT 20;

-- Standalone score for doc 1956260
SELECT passage_id, passage_text <@> to_bm25query('3 ways a log can move when bucking on side hill', 'msmarco_bm25_idx') AS neg_score
FROM msmarco_passages WHERE passage_id = 1956260;

-- Verify consistency check still passes
SELECT bm25_check_segment_consistency('msmarco_bm25_idx');  -- (function removed in #360 but can be restored from git)

Temporary mitigation

PR #360 allowlists query 1267 in validate_queries.sql so the watchdog can still catch new regressions without permanently red CI on this one query. Remove the allowlist entry once root cause is fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions