Repository navigation
test: range_pruning's twin is a port by name, and its unbounded arms can fail (#1341) - #1529
Conversation
…can fail (#1341) The twin was an independent port: its own fixture and names, and 28 of the shell's 31 arms had no counterpart (#1339 test_range_pruning.py:1). It is now the shell's fixture and checks by name, one check per test, with every reading through query_error() (2 -> 34 tests). Porting it showed that the shell's two unbounded-range oracle arms could not fail, for three reasons, each measured: - the fingerprint sums payload, which u_col and u_heap lacked, so both sides errored and check compared "" with "" (PG17: u_col=[] u_heap=[]); - an empty row in the same unit made the unit's minimum empty, and such a unit is never pruned; - the unbounded row went in by its own INSERT, into a row group of its own. With all three fixed, and check_text refusing an empty side, a writer that ignores unbounded ranges reddens both arms and 'present but empty' on each of 15-19, in both twins. Three ledger rows dated, census 3080 -> 3077. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OffgridwithJD
left a comment
There was a problem hiding this comment.
@jdatcmd Approving 9cf1e78d. A reviewer agent reproduced every claim on PG17 and PG18. On each mutant, the shell's FAIL lines and the twin's red set as shipped name the same checks.
| mutant | shell reds | twin reds |
|---|---|---|
| none | 0 (33/33) | 0 (34 passed) |
| yours: writer ignores an unbounded range | the two unbounded arms + "present but empty" | same 3 |
yours: reader never uses max_upper |
"skips the four vectors only their upper bounds rule out", "reads no chunk group at all" | same 2 |
| ours: containment never checks the least lower bound | "so does a containment probe" | same 1 |
ours: overlap's lower-side test compares probeLower instead of probeUpper |
week-long window, overlap ["A","C"], overlap ["B","M"], "the rows themselves match" |
same 4 |
| ours: writer treats an empty range as unbounded | "an empty range contributes no bound, so its units record NULL" | same 1 |
The writer mutant against main's copies gives the shell "present but empty" only and the twin 0 reds, so the shell fix is what lets the two arms fail. A probe twin without payload now fails with "the left side is a failed query" instead of passing.
Bookkeeping checked:
compare_to_bash: 30 literal, 1 by template, 0 missing.- Gate: rc=0 (3077 / 1378 / 4455; ceiling 185 → 185).
- Orphan scan: 0.
sort -c: sorted.- Guards: 442.
- Collection: 932, the same as
cluster_tests.
Notes, none blocking:
- The collation choice can differ from the shell's (
test_range_pruning.py:312-320). The twin takes candidates inpg_collationorder, with noORDER BY array_position(...), so on an en_US.UTF-8 box the shell picksucs_basicand the twin picksC. Both discriminate. It also drops ICU (collprovider <> 'i'), so on a host where onlyunicodediscriminates, the twin would decline while the shell runs._qalready turns a failing ICU query intoquery_error(), so the filter isn't needed. test_a_discriminating_collation_was_found(:381-388) can't fail once one is found. It re-asks the question the fixture used to choose. The shell records the name only as a SKIP._ids_match(:363-367) treatsNonevsNoneas the same ids, aspgc_set_hashdoes in the shell. The "both tables hold the same rows" premise rules it out in practice.
🤖 Generated with Claude Code
|
@OffgridwithJD Merged at 🤖 Generated with Claude Code |
For #1341's box "Shell arms added after 2026-09-09 with no pytest counterpart" (
range_pruning, one of its INCOMPLETE suites), and #1339'stest_range_pruning.py:1[twin_mismatch].What changes
The twin is now a port by name. It had its own fixture and names, and 28 of the shell's 31 arms had no counterpart. It now uses the shell's fixture (50,000 rows, one row group of five vectors) and the shell's checks by name, one check per test. It goes from 2 tests to 34.
compare_to_bash.pygives 30 literal matches, 1 by template, 0 missing.range_pruningmoves from INCOMPLETE to COMPLETE.Every reading goes through
query_error(). A failed query fails under its check's name, and the test: twins turn a failed query into query_error(), never their own error text (#1339) #1527 guard passes.The shell's two unbounded-range oracle arms can now fail. They are "a unit holding an unbounded range is never pruned from above" and "the same for a containment probe far to its right". They couldn't fail before, for three reasons, each measured on PG17:
fingerprintsumspayload, whichu_colandu_heapdidn't have. Both sides errored,qreturned "", andcheckcompared "" with "":u_col=[] u_heap=[].'empty'row in the same unit kept them green. An empty range sorts first, so it becomes the unit's minimum, andnative_range_excludesnever prunes a unit whose minimum is empty.e_colalready holds the empty case on its own.INSERTput it in a row group of its own. That group had no finite bound to prune on, so the shell stayed green while the twin (one statement) went red.The tables now have
payload, no empty row, and oneINSERT. Both arms usecheck_text, which refuses an empty side.Evidence
columnar_write_state.c, therupper.infinitebranch does nothing)max_upper(haveUpper = false, the ledger's existing mutation)Clean runs:
Rebased onto #1527:
test_harness_deps20;cluster_tests900 + 32.Ledger:
origin/main; orphan scan 0.The other INCOMPLETE suites in this box are
native_format,large_values,iceberg_data_filesandnative_upgrade_converge. Separate PRs.🤖 Generated with Claude Code