Skip to content

test: native_decode_gate_width gets its pytest twin, and the unshipped settings are proven absent by SQLSTATE (#1341) - #1457

Merged
jdatcmd merged 13 commits into
mainfrom
test/1341-native-decode-gate-width-twin
Oct 16, 2026
Merged

jdatcmd merged 13 commits into
mainfrom
test/1341-native-decode-gate-width-twin

Conversation

@OffgridwithJD

Copy link
Copy Markdown
Collaborator

#1341, the twin-less suites: native_decode_gate_width.sh (#595) had no pytest twin. This PR adds one, every check by the shell's name, and seeds the suite into the ledger. With it, all four native_d* suites that lacked a twin have one: native_dml (#1454), native_dict_underfill (#1455), native_decode_gating (#1456) and this.

Stacked on #1456, at the top of my chain. This branch is #1456's head plus two commits.

What changes

  • test/pytest/test_native_decode_gate_width.py, the twin: one test in a private schema. It holds the threshold per session; the shell sets it per database, because every helper opens a new connection. compare_to_bash.py grades it as covering all 35 names, and it joins COMPLETE.
  • The two "not shipped" premises are now proven by SQLSTATE. They compared SHOW's output for the rejected probe settings with the empty string. A dead connection returns empty too, and the pytest layer refuses an empty expectation outright. Both twins now require SHOW to raise 42704 (undefined_object).
  • Otherwise the shell needed no change. It pins the policy by moving the threshold across a fixed projection, including the >= boundary, and each width-gate mutation below reddens the arm it names.
  • Ledger: native_decode_gate_width is seeded with 35 rows from five-major runs, and 3 of the 35 rows dated. suites_not_covered goes 214 → 213, and the census is 3720 + 35 = 3755 rows, 2723 + 32 = 2755 never and 997 + 3 = 1000 dated, matching the tsv. The gate gives rc=0 against origin/main.

Red first

Each mutation of the width test in columnar_reader.c was run one at a time on PG18, through both twins, with the .so md5 printed every time.

mutation native_decode_gate_width.sh test_native_decode_gate_width.py the arms that went red
none (the head) 35/35 35/35 none
gating whatever the width (the comparison replaced by true) 33/35 fails narrow, default … NOT gated: got [32] want [96]; wide, gate raised above width … stops gating: got [32] want [800]
> for >= 34/35 fails wide, gate AT the width (>= boundary): got [800] want [32]
the payload count one too high 34/35 fails wide, gate raised above width: got [32] want [800]

Never red (32): the twenty-one premises, plus the arms the width policy doesn't move: the gated counts, the gate-off controls and the correctness arms. The sibling native_decode_gating (#1456) dates those.

Runs

major native_decode_gate_width.sh test_native_decode_gate_width.py
15 35/35 35/35
16 35/35 35/35
17 35/35 35/35
18 35/35 35/35
19 35/35 35/35

Also measured: the guard half (438 tests), harness_selftest 1245/1245 and docs_style. cluster_tests goes 676 → 677 by collection, and TESTS.md gets §149.

🤖 Generated with Claude Code

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving cbaa5aa.

Measured on PG17: native_decode_gate_width.sh 35/35, and test_native_decode_gate_width.py 35 checks. The tsv at this head is 3755 / 2755 / 1000, matching its budget.

The boundary mutant, run myself: >= → > in the width test at columnar_reader.c:3041. Only the boundary arm goes red, in both twins: wide, gate AT the width (>= boundary): gates again -> qual column alone, got [800] want [32].

I took the other two mutants from your table. As with #1456, the stack's restate onto 0edb5ae covers this one.

jdatcmd and others added 13 commits October 16, 2026 05:01
…es ALTER EXTENSION UPDATE (#1341 item 66)

Between installing a new library and running ALTER EXTENSION pgcolumnar UPDATE, a
database runs the 1.0-alpha5 library over its 1.0-alpha4 catalog. The library deletes
from pgcolumnar.retired_group, which that catalog lacks, so DROP TABLE, TRUNCATE and
pgcolumnar.vacuum() on a columnar table fail there with 42P01 'columnar metadata
table "pgcolumnar.retired_group" does not exist', which names neither the cause nor
the remedy. Measured: each refusal changes nothing, reads and writes work throughout,
and after the update all three succeed on the same rows.

open_columnar_table's error now carries a hint naming the update.
docs/installation.md's "If you skipped step 3" shows the error and the hint.

Red first, both twins, PG18: native_upgrade_converge gains the window's arms in a
database at the previous release's catalog (the newest fixture), and the three
refusal arms fail on main with `got [42P01|no-hint]`. test_native_upgrade_converge.py
is their partial twin, declared INCOMPLETE; it stages the previous release's base
script from test/fixtures as the shell does. Green on 15-19 in both twins.

cluster_tests 660 -> 661 by collection; TESTS.md gets section 143.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… still be set to a row store (#1341)

test_fk_referencing.py asserts every shell check by name; compare_to_bash grades it as
covering all 28 (27 checks on PG17+, and the pre-17 branch's own), and it joins
COMPLETE.

The conversion guard's over-rejection control converted a table with no foreign key
back to heap, so it could not see a guard that refused every SET ACCESS METHOD on a
referenced table whatever the target: with the guard's columnar-target test removed,
the suite stayed 26/26. A new arm sets the referenced table itself to heap; under that
mutant both twins now fail it.

cluster_tests 661 -> 666 by collection; TESTS.md gets section 144.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tations of the foreign-key guards (#1341)

28 rows from five-major runs (27/27 on 17-19, 26/26 on 15-16). Dated on PG18 by:
the referenced-side refusal removed (5), the guard keyed on the referencing table
(8), the conversion refusal removed (8), and the conversion refused whatever the
target (1). suites_not_covered 219 -> 218; the census is 3647 rows, 2686 never,
961 dated, restated on main db56168.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_truncate_cleanup.py asserts every shell check by name; compare_to_bash grades it
as covering all 25, and it joins COMPLETE. It runs in a private database, since the
snapshot counts every pgcolumnar catalog row and the shared one holds every other
test's. The shell suite needed no change: each of its arms already goes red under a
mutation of the path it names.

cluster_tests 666 -> 672 by collection; TESTS.md gets section 145.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mutations of the truncate paths (#1341)

25 rows from five-major runs (25/25 on each of 15-19). Dated on PG18 by a rewrite
that keeps the retired storage's rows (7) or its stale write state (1), an in-place
truncate that skips the projections' storages (8), and a storage-tree delete that
skips them (1). suites_not_covered 218 -> 217; the census is 3672 rows, 2695 never,
977 dated, restated on main db56168.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…zone-map answer that ignores deletes (#1341)

test_native_dml.py asserts every shell check by name; compare_to_bash grades it as
covering all 15, and it joins COMPLETE.

The min/max arm could not fail as its comment claimed. The deletes (id % 7 = 0)
removed neither the smallest nor the largest id, so min and max were the same
whether or not the deleted rows counted; and measured with groups that hold deletes
left on the zone-map path, min/max(id) still came out right while min/max(k) came
out wrong (10|50000 for 20|49990). The suite stayed 13/13. The deletes now include
ids 1 and 5000, a premise asserts on heap that min and max moved, and the arm takes
min/max over k as well as id; under that mutant both twins fail it.

The index arms gain a premise that the lookups take the primary-key index, so they
test the index fetch's delete check rather than the scan.

cluster_tests 672 -> 673 by collection; TESTS.md gets section 146.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ons (#1341)

15 rows from five-major runs (15/15 on each of 15-19). Dated on PG18 by: a row group
with deletes still answering min/max from zone maps (1), count(*) from metadata not
subtracting deleted rows (3), and the index fetch ignoring the delete vector (5).
suites_not_covered 217 -> 216; the census is 3687 rows, 2702 never, 985 dated, restated on main db56168.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…longer pass its survival arm (#1341)

test_native_dict_underfill.py asserts every shell check by name; compare_to_bash
grades it as covering all 4, and it joins COMPLETE. It turns the post-codec encoding
choice off for its own session, where the shell sets it for its database.

The survival arm was a fresh SELECT 1, which a crashed backend passes once crash
recovery has finished, and the suite computed a crash flag it never checked. It now
counts "terminated by signal" in the server log. The rejection arm matched
'does not match|corrupt|invalid|out of' in any message, which "out of memory"
satisfies too; it now requires XX001. A premise asserts the inflation rewrote the
chunk's descriptor.

cluster_tests 673 -> 674 by collection; TESTS.md gets section 147.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 rows from five-major runs (4/4 on each of 15-19). Dated on PG18 by the DICT fill
check removed (1) and replaced by a crash (2, one shared). suites_not_covered
216 -> 215; the census is 3691 rows, 2704 never, 987 dated, restated on main db56168.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ers can see a double count and a deleted row (#1341)

test_native_decode_gating.py asserts every shell check by name; compare_to_bash
grades it as covering all 29, and it joins COMPLETE. It sets the width gate off for
its session, where the shell pins it off for its cluster.

Two of the filter counters' guarantees could not fail:
- every row of the needle's surviving vector matched, so the producer's re-test of
  that vector rejected nothing, and a producer counting its rejections a second time
  read exactly right: with the non-counting filter disabled the suite stayed 26/26.
  A qual that half of vector 0 passes now asserts its rejections are counted once.
- the counters were checked only on the table without deletes, so with the
  evaluator's deleted-row test removed the suite stayed 26/26. Rows Removed by Filter
  is now checked on the multi-group table with deletes, against heap's live count.

The multi-group fixture's DELETE ran through the gating it was built to test (its
WHERE is an unprunable qual too), so a gating mutant broke the fixture rather than
the arms. It now runs with the width gate out of reach, and its premise counts the
surviving rows with count(*) instead of a gated WHERE.

cluster_tests 674 -> 676 by collection; TESTS.md gets section 148.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…our mutations of phase 2 (#1341)

29 rows from five-major runs (29/29 on each of 15-19). Dated on PG18 by: the
per-vector evaluation never run (4), a deleted row counted as filtered (1), every
vector skipped (7), and a double count in the producer (2). No premise is dated: the
fixture no longer depends on the gating under test. suites_not_covered 215 -> 214;
the census is 3720 rows, 2722 never, 998 dated, restated on main db56168.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d settings are proven absent by SQLSTATE (#1341)

test_native_decode_gate_width.py asserts every shell check by name; compare_to_bash
grades it as covering all 35, and it joins COMPLETE. It holds the threshold for its
session, where the shell sets it per database because every helper opens a new
connection.

The two premises that the rejected probe settings were not shipped compared SHOW's
output with the empty string: q returns empty for a dead connection too, and an empty
expectation is the shape the pytest layer refuses. Both twins now require SHOW to
raise 42704 (undefined_object).

cluster_tests 676 -> 677 by collection; TESTS.md gets section 149.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y three mutations of the width gate (#1341)

35 rows from five-major runs (35/35 on each of 15-19). Dated on PG18 by gating
whatever the width (2), > for >= (1) and a payload count one too high (1, shared).
suites_not_covered 214 -> 213; the census is 3755 rows, 2754 never, 1001 dated, restated on main db56168.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OffgridwithJD
OffgridwithJD force-pushed the test/1341-native-decode-gate-width-twin branch from cbaa5aa to 0cb4e37 Compare October 16, 2026 05:01

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving 0cb4e37, the restate onto main db56168. I compared every commit's patch with the approved stack using git range-diff. The test and source commits are unchanged, and the ledger-seed commits changed only by re-anchoring on #1470. The census at this head matches its budget paragraph, and the counts step consistently. At #1467's head: the guards pass (438), 687 collected (matching the file), and harness_selftest is 1245/1245.

@jdatcmd
jdatcmd merged commit 52006d6 into main Oct 16, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants