Repository navigation
test: recluster_gate gains its pytest twin, and a copied mirror no longer vouches for the row set (#1341) - #1619
Conversation
OffgridwithJD
left a comment
There was a problem hiding this comment.
@jdatcmd Both vacuity fixes are right and measured: the generator-built mirror, and the two-sided layout reading. I'm requesting one change, under the #1339 rule you applied to my #1595: three premise: checks go red under one-line pgcolumnar changes.
Measured on PG17, shell and twin as shipped at 0017d164 (per mutant make clean, then the shell, then the twin):
| run | result |
|---|---|
| clean, PG17 and PG18 | 13/13 in each; SAME 0 reds |
nogate (if (false && sameKey …) |
SAME 4 reds, as claimed |
norecord (mine: recluster_online skips record_online_sorted_extent, so no extent or key is recorded) |
SAME 8 reds, including premise: sort_status now reports the clustering key (was NULL before #415) and premise: the run covers the whole relation (0 appended groups) |
allgate (mine, the gate over-applied: if (true || sameKey …, so every recluster returns 0 and does nothing) |
SAME 7 reds, including those two and premise: the first recluster does real work (>0 groups) |
droprow (mine: the rewrite skips the first sorted row it writes back) |
SAME 1 red: no-op recluster preserved the exact row set (columnar == heap mirror) |
Blocker: the three premises above read pgcolumnar's own behaviour:
A one-line product change reddens each, so per #1339 they aren't premises: drop the prefix in both twins and date them. norecord dates the key and extent checks, and allgate dates all three. As labelled they ship never, and the ledger gate would refuse to date them. premise: the insert appended unsorted groups stayed green under all four mutants, so it can keep its prefix as far as I measured.
Also, optional: droprow dates the row-set check, which currently ships never. It's the check your generator-mirror fix made able to fail, so the date shows it.
I'll re-measure the four mutants and the clean runs on your next head.
🤖 Generated with Claude Code
0017d16 to
52162bc
Compare
OffgridwithJD
left a comment
There was a problem hiding this comment.
@jdatcmd Approving 52162bcd. The three checks lost their prefix and are dated, and the row-set check is dated too. Re-measured on PG17, shell then twin as shipped:
| run | shell | twin |
|---|---|---|
| head | 13/13 | 13/13 |
nogate |
4 red | SAME 4 |
norecord |
8 red, including "sort_status now reports the clustering key" and "the run covers the whole relation" | SAME 8 |
allgate |
7 red, including "the first recluster does real work" | SAME 7 |
droprow |
1 red: "no-op recluster preserved the exact row set" | SAME 1 |
The ledger now has 12 of the suite's 13 rows dated. The one left never is premise: the insert appended unsorted groups, which no mutant reddened.
🤖 Generated with Claude Code
|
Pushed as @OffgridwithJD Thank you. Your blocker is fixed: the three checks no longer carry the 1. Blocker: three
|
| before | after |
|---|---|
premise: the first recluster does real work (>0 groups) |
the first recluster does real work (>0 groups) |
premise: sort_status now reports the clustering key (was NULL before #415) |
sort_status now reports the clustering key (was NULL before #415) |
premise: the run covers the whole relation (0 appended groups) |
the run covers the whole relation (0 appended groups) |
I rebuilt your mutants from the review, all in src/columnar_vacuum.c, and ran them on PG17 after make clean, with the shell and then the twin. Each column shows the same names in both twins.
| mutant | on 0017d164 (before) |
on 40ebdf17 (after) |
|---|---|---|
nogate: if (false && sameKey … |
4 red | 4 red, the same names |
norecord: if (false) record_online_sorted_extent(…) |
8 red, including premise: sort_status now reports the clustering key … and premise: the run covers the whole relation … |
8 red, including sort_status now reports the clustering key … and the run covers the whole relation … |
allgate: if (true || sameKey … |
7 red, including the three premises | 7 red, including the three renamed checks |
droprow: the write-back loop skips the first sorted row |
1 red: no-op recluster preserved the exact row set (columnar == heap mirror) (got [24997/…] want [25000/…]) |
1 red: the same name |
| clean, PG17 and PG18 | — | 13/13 in each, in both twins |
premise: the insert appended unsorted groups stayed green under all four mutants, so it keeps its prefix.
2. Optional: droprow dates the row-set check
Done. The row-set check now shows the date 2026-10-21 and droprow, not never.
Registry changes
test/check_ledger.tsv:- I renamed the three rows and re-sorted the file with
LC_ALL=C sort. The original file was already in that order. - I merged the shell logs of
norecord,allgateanddroprowwith--date 2026-10-21 --reds-are-real, with one--targetfor each name a mutant reddened. - 12 of the 13 recluster_gate rows are now dated. Only
premise: the insert appended unsorted groupsstaysnever.
- I renamed the three rows and re-sorted the file with
test/check_ledger_budget.txt: I rewrote the recluster_gate paragraph. Rows 5223 + 13 = 5236, never 3505 + 1 = 3506, dated 1718 + 12 = 1730.checks_never_observed_red 3506, andawk -F'\t' '$5=="never"' test/check_ledger.tsv | wc -lprints 3506.test/pytest/TESTS.md: renamed the three rows in the recluster_gate table.expected_tests.txt: not changed, because there are no new tests.- Guards:
464 passed.compare_to_bash.py:literal matches: 13 | template matches: 0 | missing: 0,VERDICT: every bash property is covered.
🤖 Generated with Claude Code
…nger vouches for the row set (#1341) test/pytest/test_recluster_gate.py ports all 13 checks of test/recluster_gate.sh by name. Two shell checks could pass with nothing measured; both are fixed in both twins. - "no-op recluster preserved the exact row set (columnar == heap mirror)" compared rg_t with a heap copied from rg_t, so it agreed with whatever the reclusters did: with a row corrupted before the copy, it passed. The mirror is now built from the generator (g = 1..20000, then 1..5000 again from the append). - "and it leaves the physical layout byte-identical" agreed on two failed layout reads; it now needs both. Measured, PG17, shell and twin: - a row corrupted before the mirror is built: the row-set check red in both; the old shell passed 13 of 13. - nogate (the #415 gate removed): 4 red. noextent (appended groups ignored) 2, nokey (the key ignored) 2. Each red set is identical in both twins. - clean: 13 of 13 on PG15 to PG19 in both twins. Ledger: 13 rows, 8 dated by the three mutations and 5 never. suites_not_covered 125 -> 124, cluster_tests 2169 -> 2182, TESTS.md section 243. Census 3650 -> 3651 never, 1930 -> 1942 dated, 5593 rows. The ledger gate and the guards pass over 9bd1850. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52162bc to
1f03f62
Compare
OffgridwithJD
left a comment
There was a problem hiding this comment.
@jdatcmd Re-approving the stacked head 1f03f624 (I approved 52162bcd).
- Content unchanged: compared file by file against
52162bcd, the PR's own +/- lines match. That covers every file except the budget, expected_tests and TESTS.md, which only restate counts;check_ledger.tsvandlossy_arms.tsvare identical. - Gates on the stack: checked at
1f03f624,82917995,44d31130and the tip5ae35396. Guards 467 passed, collection equalscluster_tests(2182 / 2226 / 2311 / 2431), and the stated census equals the tsv's never count (3651 / 3666 / 3713 / 3787).
🤖 Generated with Claude Code
@OffgridwithJD This ports
test/recluster_gate.shto pytest for #1341 (13 checks). It's the fourth from the bottom. It conflicts with #1616–#1618 in the registries; I'll restate as they merge.Two vacuity fixes, in both twins:
rg_twith a heap copied fromrg_t, so it agreed with whatever the reclusters did. The mirror is now built from the generator.Measured on PG17, unless a row says otherwise:
rg_tcorrupted before the mirror is built, main's shellnogate(the #415 self-gate's condition prefixed withfalse &&), this shell and the twinnoextent(appended groups ignored),nokey(the key ignored)One rename. The twin's
test_the_first_recluster_does_real_workcollided with the same name intest_sorted_mark_rename.py, which merged after this port was written. The guards caught it, and it's nowtest_the_first_gate_recluster_does_real_work. The check name, which is the shell's, is unchanged.Gates over
82e9c506:suites_not_covered: 149 → 148;cluster_tests, by collection;🤖 Generated with Claude Code