Repository navigation
test: native_agg's pytest twin covers every shell arm (#1341) - #1514
Merged
Merged
Conversation
test_native_agg.py ported only the timestamptz arms (#1293) and the gating arms (#1435); native_agg was declared INCOMPLETE with 28 shell names missing. A new test ports the rest by name: the metadata node asserted before any answer (count, sum/min/max), the eleven int4/text/ sum/avg parity arms, the node beating a parallel plan with no Gather (#133), count(*) reading no zone maps against an aggregate that must, and the filtered, sum(bigint) and empty-table fallbacks. The three gating arms existed, but built their names with a conditional f-string the parity tool cannot read; they are written out now, which also puts native_agg on the loop-reader list. compare_to_bash: 40 literal matches, 0 missing, so the pair moves to COMPLETE. Red first: count(col) folded from the row-group row count instead of the value count (columnar_vector.c) reddens "count(col,nulls)" in both twins (shell 10000 vs 8000, pytest 12000 vs 9600 on its own fixture). Matrix: shell 40/40 and pytest 3 tests (40 checks) on PG15-19, the PG17 legs rerun on a clean install; harness_selftest 1246; collection 750 (cluster_tests 749 -> 750); guards 439/439; ledger gate rc 0 (the shell suite is unchanged, so its 40 ledger rows are too). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jdatcmd
force-pushed
the
test/1341-native-agg-twin
branch
from
October 16, 2026 20:12
a522565 to
2718d4a
Compare
The restate onto main kept both main's 'cluster_tests 750' and this branch's 751. CI's awk read then returned two lines and pytest refused '751\n750' as --pgc-expect-tests. Collection on this tree is 751. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Head is now My local check missed it because it runs only the |
OffgridwithJD
approved these changes
Oct 16, 2026
OffgridwithJD
left a comment
Collaborator
There was a problem hiding this comment.
Measured
- PG17 and PG18: the shell is 40/40, and the twin passes its 3 tests with 40 of 40 checks.
- Pairing:
compare_to_bash.pymatches all 40 names, with 0 missing. - Guards: 439 passed.
- Collection: 751, which matches
cluster_tests 751.
Mutants (columnar_vector.c, PG18)
The shell and the twin go red under the same names:
| mutant | red |
|---|---|
needZones = true from the start |
"count(*) reads no zone maps" |
avg's count adds rg->rowCount, not z->valueCount |
"avg(int4,nulls)" |
| the metadata path costed at the cheapest scan's cost (#133 restored) | shell: the 4 parallel/Gather arms; twin: "count(*) beats a parallel plan" only (see 4 below) |
Non-blocking
test_native_agg.py:244turns the zone-map delta into yes/no.expect.at_least(after - before, 1, "an aggregate that needs zone maps reads them")would carry the measurement itself, andnative_agg.sh:137drops the number entirely.- The
RESETs in_plan(:152-167) aren't intry/finally. If an EXPLAIN raises, the parallel settings stay on the shared connection. - The
sum(bigint)fallback and empty-table arms check only the answer. Nothing asserts that the fallback plan ran. Same as the shell, so a paired follow-up rather than this PR. - The third test holds about 27 checks under fail-fast. Under the #133 mutant the twin reports one red where the shell reports four. Splitting it into parity, plan-choice, zone-map and fallback tests would report the whole red set.
- The body still says collection 750, which your comment already corrects. The module docstring's first line describes only the timestamptz arms.
🤖 Generated with Claude Code
This was referenced Oct 16, 2026
jdatcmd
added a commit
that referenced
this pull request
Oct 17, 2026
…1339) In CI's harness the first red in a test raises, so a twin holding many checks in one test reports fewer reds than its shell. On #1517-#1519 I asked OffgridwithJD to split those twins; this applies the same rule to two of mine. test_native_agg.py went from 3 tests holding 40 checks to 40 tests. Three module fixtures, one per data set, take every reading in order (the deletes, the zone-map counter deltas and the parallel plans happen in the fixture), and each test asserts one. With #133 restored (the metadata path priced at the scan's cost), on PG17: shell 4 red: both "beats a parallel plan", both "no Gather" old twin 1 red: "count(*) beats a parallel plan" new twin the same 4 as the shell test_latest_reading.py went from 1 test holding 9 checks to 9 tests, the same way. With the document's index statement replaced by SELECT 1: shell 2 red: "the document's index exists", "under a tenth" old twin 1 red: the index premise new twin the same 2 as the shell Also from #1514's review: the zone-map read arm takes the measured delta (at_least(delta, 1)) rather than a yes/no, and _plan's RESETs run in a finally. The twin grader still matches every name: 40 of 40, and 9 of 9. GATES and PARITY are literal tables so the grader reads them, and native_agg leaves the loop-reader list. cluster_tests 779 -> 824 by collection. test_native_skip.py, which has the same shape, waits for Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jdatcmd
added a commit
that referenced
this pull request
Oct 17, 2026
…1339) In CI's harness the first red in a test raises, so a twin holding many checks in one test reports fewer reds than its shell. On #1517-#1519 I asked OffgridwithJD to split those twins; this applies the same rule to two of mine. test_native_agg.py went from 3 tests holding 40 checks to 40 tests. Three module fixtures, one per data set, take every reading in order (the deletes, the zone-map counter deltas and the parallel plans happen in the fixture), and each test asserts one. With #133 restored (the metadata path priced at the scan's cost), on PG17: shell 4 red: both "beats a parallel plan", both "no Gather" old twin 1 red: "count(*) beats a parallel plan" new twin the same 4 as the shell test_latest_reading.py went from 1 test holding 9 checks to 9 tests, the same way. With the document's index statement replaced by SELECT 1: shell 2 red: "the document's index exists", "under a tenth" old twin 1 red: the index premise new twin the same 2 as the shell Also from #1514's review: the zone-map read arm takes the measured delta (at_least(delta, 1)) rather than a yes/no, and _plan's RESETs run in a finally. The twin grader still matches every name: 40 of 40, and 9 of 9. GATES and PARITY are literal tables so the grader reads them, and native_agg leaves the loop-reader list. cluster_tests 792 -> 837 by collection. test_native_skip.py, which has the same shape, is next, now that #1510 has merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #1341's twin-parity work:
native_aggwas declared INCOMPLETE, with 28 shell names missing.The port
A new test, every name the shell's:
count(*)reads none, against an aggregate that must read them, so the zero isn't a dead counter.sum(bigint)and the empty table.The three gating arms (#1435) were already there, but built their names with a conditional f-string the parity tool can't read. They're written out now, which also puts
native_aggon the loop-reader list.compare_to_bashnow reports 40 literal matches, 0 missing, so the pair moves to COMPLETE.Red first
With
count(col)folded from the row group's row count instead of its value count (columnar_vector.c), both twins redden "count(col,nulls)":Measured
harness_selftest1246; collection 750 (cluster_tests749 → 750); guards 439/439.It shares
expected_tests.txt/ TESTS.md /test_compare_to_bash.pywith #1510, #1512 and #1513; whichever lands later restates those lines.🤖 Generated with Claude Code