Repository navigation
test: native_skip's pytest twin covers every shell arm, and the shell's non-C half runs at last (#1341) - #1510
Conversation
OffgridwithJD
left a comment
There was a problem hiding this comment.
@jdatcmd Requesting changes on one measured gap. Everything the PR claims held, and the fix for it is small.
Measured, all holding
- Shell: 68/68 on PG17 and PG18 (
-abuilds). The log shows-- non-C collation under test: en_US.utf8, and the three non-C arms each have a PASSRESULTline. - Twin: 13 tests, 76/76, on both majors.
compare_to_bash: 52 literal + 4 template matches, 0 missing.- Red first: with the
COLUMNAR_COLLATION_IS_Cguard deleted (source 6933d0f11fd4 against head's ba96698e61e3), the new shell and the twin redden the same 2 names. The shell as on main reddens 1, and prints-- SKIP: no usable non-C collation. - Guards: NO_CLUSTER passes 438/438 at head. Merged onto current main (with #1509) it passes 439/439, and collection gives 754, matching
cluster_tests 754.
A (blocking): the skip that hid the quote bug is still unrecorded
Under the mutant, the suite as on main reported 65 checks, "0 unrunnable, 0 skipped". With the guard intact it would have exited PASSED, and three arms had silently never run on any host. The quote fix repairs this host, but the shape is still there. A box with no usable non-C collation, or one where the --locale=C database can't be created, still only echoes -- SKIP and drops those checks without a trace.
lib.sh's check_unrunnable NAME MISSING_DEPENDENCY DETAIL exists for this: call it for each of the three non-C names and for the --locale=C ones. The suite then ends INCOMPLETE, as the twin's cannot_run already does. That's the guard that would have caught the malformed probe the first time.
B (please fix with A): a missing counter reads as "skips nothing"
_removed() returns 0 when the plan has no Vectors Skipped line, so _skips answers "no" for a plan that isn't a columnar scan at all. I measured it against a heap table: _removed=0, _skips=no. So the refusal arms ("…is refused", "…does not prune") and "non-selective scan skips nothing" pass if that one query loses the custom scan.
On the last one the twin is weaker than the shell, which wants a literal 0, so an empty skipped() goes red there. The sibling test_native_saop_pushdown.py returns -1 when the counter is absent; copying that closes it. The neighbouring range premises do make this unlikely in practice.
C, D (minor, your call)
- C: the "skips groups" arms go through a yes/no
_skips, an inequality in disguise.expect.at_least(_removed(...), 1, name)for those, andexpect.num(..., 0)for the refusals with B's -1, would follow the corpus rule. - D: non-C collation discovery and the
--locale=CCREATE DATABASEcatch anypsycopg.Error, so a broken connection is reported as MISSING_DEPENDENCY. It isn't a silent pass, since the run ends INCOMPLETE, but it names the wrong cause. Narrowing toUndefinedObject/FeatureNotSupportedwould fix it.
I'll re-approve on A and B.
🤖 Generated with Claude Code
|
@OffgridwithJD, all four points are addressed in d6ef25b, rebased onto main after #1509 and #1512. A, the skip is recorded. Both shell B, a missing counter is not "removed nothing". C, the inequalities are explicit:
D, the catches are narrow:
Matrix after the fixes:
The collation-guard mutant evidence from before still holds. |
2bfd515 to
d6ef25b
Compare
OffgridwithJD
left a comment
There was a problem hiding this comment.
@jdatcmd approve, at d6ef25b. A and B both hold, and I measured A myself on PG18.
A, the skip is recorded. I replaced the four collation candidates with two names that don't exist, and the shell run went from PASSED to INCOMPLETE: rc 67, checks unrunnable: 3, accounting: 65 passed + 0 failed + 3 unrunnable + 0 skipped = 68. The --locale=C branch uses the same check_unrunnable shape. The twin matches it with expect.cannot_run("MISSING_DEPENDENCY", …) behind the narrowed catches.
B, a missing counter is a red. _removed returns -1, so every refusal arm (expect.num(..., 0), including "non-selective scan skips nothing") and every pruning arm (at_least(..., 1)) goes red on a plan with no counter.
Head, PG18: shell 68/68 (rc 0), twin 13 passed with 76 of 76 checks.
C and D read as you describe: no yes/no left, and no broad psycopg.Error catch in the skip paths.
🤖 Generated with Claude Code
d6ef25b to
9c4b54a
Compare
|
@OffgridwithJD, restated onto main
Checked on each tree:
Re-approval needed: #1510 at |
9c4b54a to
9f3926c
Compare
|
@OffgridwithJD, restated again, onto main
The behaviour files are the same patches as the heads in my previous table. Re-approval is needed at these three heads. |
9f3926c to
1041941
Compare
|
@OffgridwithJD, restated onto main
On each tree: guards 440, harness files, ledger gate rc 0.
On one check per test. |
…'s non-C half runs at last (#1341) test_native_skip.py ported only the #1433 arms; native_skip was declared INCOMPLETE with 52 shell names missing. Five tests now port the rest by name: scalar ranges and equality on int, bigint (#477) and domains (#483); the anchored LIKE under COLLATE "C" with its unanchored, escaped and `_` cases and the default-collation refusal (#426); a default collation in a --locale=C database deriving the bounds; the refusal under a discovered non-C collation; and a columnar partition taking the custom scan (#436). compare_to_bash: 52 literal + 4 template matches, 0 missing, so native_skip moves from INCOMPLETE to COMPLETE. The port found a shell defect. native_skip.sh's non-C collation probe ended its quoted identifier with a single quote (COLLATE \"$_c\'), malformed SQL, so no candidate ever matched and the three non-C arms skipped on every run, reading as a host without such a collation. The twin's probe found en_US.utf8 here. Fixed: the shell now runs 68 checks, not 65. Red first, the #426 collation guard removed (columnar_customscan.c): shell 66 pass + 2 fail ("default collation that is not C is refused", "anchored LIKE does not prune under a non-C collation"), the twin the same two by name. Before the quote fix the shell reddened only the first. Matrix: shell 68/68 and pytest 13 tests (76 checks) on PG15-19; harness_selftest 1246; collection 754 (cluster_tests 749 -> 754); guards 438/438; ledger gate rc 0 (native_skip has no ledger rows). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1041941 to
10836b7
Compare
|
@OffgridwithJD, restated onto main
#1510 and #1522 both move |
OffgridwithJD
left a comment
There was a problem hiding this comment.
@jdatcmd Re-approving at 10836b7. The range-diff against d6ef25b shows the rebase over #1521 and nothing else: cluster_tests 787 -> 792 (five tests), native_skip sorted into COMPLETE between native_saop_pushdown and native_toasted_write, and the review-fixes commit unchanged. CI is green. #1522 also edits cluster_tests from 787, so whichever of the two merges second needs a restate.
🤖 Generated with Claude Code
…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>
For #1341's twin-parity work:
native_skipwas declared INCOMPLETE, with 52 shell names missing from its pytest twin.The port
Five new tests, every name the shell's:
COLLATE "C"(Text predicates cannot be pushed down, so a LIKE scan decodes every value: 2.2x slower where an integer predicate is 27.7x faster #426): with the unanchored, escaped and_wildcard cases, and the default-collation refusal;--locale=Cdatabase, which must derive the bounds;compare_to_bashnow reports 52 literal + 4 template matches with 0 missing, sonative_skipmoves from INCOMPLETE to COMPLETE.A shell defect the port found
native_skip.sh's non-C collation probe closed its quoted identifier with a single quote,COLLATE \"$_c\'. That's malformed SQL, so no candidate ever matched, and the three non-C arms skipped on every run, reading as a host without such a collation. The twin's probe founden_US.utf8on this host. Fixed: the shell now runs 68 checks, up from 65.Red first
With the #426 collation guard removed (
columnar_customscan.c):Measured
harness_selftest1246; collection 754 (cluster_tests749 → 754); guards 438/438.native_skiphas no ledger rows.This is independent of #1509, though both touch
test_compare_to_bash.pyin different places.🤖 Generated with Claude Code