From 8ce398be97b5c6580a82d05ed9ae9d12e69eb8ec Mon Sep 17 00:00:00 2001 From: OffgridwithJD Date: Sat, 12 Sep 2026 01:02:37 +0000 Subject: [PATCH] test: the hilbert premises name the table they digest (#982) hilbert_cluster held the second-largest loss: one premise repeated before four separate arms, and two pairs of (d) checks repeated across two fixtures. clean main 181 records 176 distinct keys 3 colliding 5 lost this branch 181 records 181 distinct keys 0 colliding 0 lost Record count unchanged, so this renames and nothing else. A THIRD FORM OF THE RULE, and the files keep supplying them. #984: a continuation carries the discriminator its headline interpolates. #989: where the headline names none either, it gains one. Here NOTHING interpolates anything -- all eight sites are hand-written -- so the discriminator comes from the check's own VALUE EXPRESSION, the table it queries: "$(pgc_is_columnar_scan 'SELECT * FROM s3hi')" -> ... digested for s3hi ... "$(pgc_is_columnar_scan 'SELECT * FROM av_hi')" -> ... digested for av_hi ... That keeps the name and the assertion in agreement, which is worth more than brevity: a reader can check one against the other without leaving the line. The word doing the colliding was "here" -- which names the site to someone reading top to bottom and names nothing at all to a key. The two (d) pairs take the table their own count(*) and physlayout name, for the same reason: moved s4d1's layout, no row was lost from s4d2. No ledger change: hilbert_cluster is not one of the two suites the ledger covers, which is why 21 of the 24 collisions matter for #432's seeding and not for the census today. hilbert_cluster 181 checks 0 FAIL on both trees | docs_style 9/9 shellcheck 0 findings | ledger and budget untouched Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Uf6UoeBRZYLQZa4KxNiw8a --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ test/hilbert_cluster.sh | 16 ++++++++-------- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 720ff606..6c4059d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1816,6 +1816,39 @@ true until the next version shipped. the extracted block holds one and the premise passes. The static caller sweep catches it -- injected, both the premise and the arm report `got [4] want [3]`. +- The hilbert premises name the table they digest, so five checks stop sharing three + ledger keys (#982, third of eight). + + `hilbert_cluster` held the second-largest loss: a premise repeated before four separate + arms, and two pairs of `(d)` checks repeated across two fixtures. Measured against a + control run on clean `main`: + + clean main 181 records 176 distinct keys 3 colliding 5 lost + this branch 181 records 181 distinct keys 0 colliding 0 lost + + The record count is unchanged, so this renames and nothing else. + + **A third form of the rule, and the files keep supplying them.** #984 said a continuation + carries the discriminator its headline interpolates; #989 added that where the headline + names none either, it gains one. Here *nothing* interpolates anything -- all eight sites + are hand-written -- so the discriminator comes from the check's own **value expression**: + + premise: the plan being digested here is the columnar custom scan too + "$(pgc_is_columnar_scan 'SELECT * FROM s3hi')" -> ... digested for s3hi ... + "$(pgc_is_columnar_scan 'SELECT * FROM s5hi')" -> ... digested for s5hi ... + "$(pgc_is_columnar_scan 'SELECT * FROM s6t')" -> ... digested for s6t ... + "$(pgc_is_columnar_scan 'SELECT * FROM av_hi')" -> ... digested for av_hi ... + + That keeps the name and the assertion in agreement, which is worth more than brevity: a + reader can check one against the other without leaving the line. The word doing the + colliding was `here`, which named the site to someone reading top to bottom and named + nothing at all to a key. + + The two `(d)` pairs take the table their own `count(*)` and `physlayout` name -- + `moved s4d1's layout`, `no row was lost from s4d2` -- for the same reason. + + No ledger change: `hilbert_cluster` is not one of the two suites the ledger covers. + ## [1.0-alpha3] - 2026-09-02 ### Added diff --git a/test/hilbert_cluster.sh b/test/hilbert_cluster.sh index 86c314a5..6f0a7aa1 100755 --- a/test/hilbert_cluster.sh +++ b/test/hilbert_cluster.sh @@ -517,7 +517,7 @@ S3HI_MOVED="$(changed "$S3HI_SEQ0" "$(scanorder s3hi)")" check "premise: vacuum_sorted moved s3lex from its own baseline" "$S3LEX_MOVED" "moved" check "premise: cluster moved s3zo from its own baseline" "$S3ZO_MOVED" "moved" check "premise: cluster_hilbert moved s3hi from its own baseline" "$S3HI_MOVED" "moved" -check "premise: the plan being digested here is the columnar custom scan too" \ +check "premise: the plan being digested for s3hi is the columnar custom scan too" \ "$(pgc_is_columnar_scan 'SELECT * FROM s3hi')" "yes" psql_run "ALTER TABLE s3hi OWNER TO h_owner;" @@ -704,19 +704,19 @@ check_text "premise: the two (d) twins are byte-identical before either is reclu S4D1_RET="$(q "SELECT pgcolumnar.recluster_hilbert('s4d1','b','a');")" S4D1_MOVED="$([ "$S4D1_RET" -gt 0 ] 2>/dev/null && echo yes || echo no)" check "(d) recluster_hilbert over DIFFERENT columns still rewrites (>0)" "$S4D1_MOVED" "yes" -check "(d) and that rewrite moved the layout" \ +check "(d) and that rewrite moved s4d1's layout" \ "$(changed "$S4D1_PHYS" "$(physlayout s4d1)")" "moved" check_text "(d) and it is still a hilbert table, now on the new key" "$(skind s4d1)/$(skey s4d1)" "hilbert/{b,a}" -check_num "(d) and no row was lost" "$(q 'SELECT count(*) FROM s4d1;')" "20000" +check_num "(d) and no row was lost from s4d1" "$(q 'SELECT count(*) FROM s4d1;')" "20000" S4D2_RET="$(q "SELECT pgcolumnar.recluster('s4d2','b','a');")" S4D2_MOVED="$([ "$S4D2_RET" -gt 0 ] 2>/dev/null && echo yes || echo no)" check "(d) plain recluster over DIFFERENT columns rewrites a hilbert table (>0)" "$S4D2_MOVED" "yes" -check "(d) and that rewrite moved the layout" \ +check "(d) and that rewrite moved s4d2's layout" \ "$(changed "$S4D2_PHYS" "$(physlayout s4d2)")" "moved" check_text "(d) and naming the plain verb with a NEW key is the explicit switch back to zorder" \ "$(skind s4d2)/$(skey s4d2)" "zorder/{b,a}" -check_num "(d) and no row was lost" "$(q 'SELECT count(*) FROM s4d2;')" "20000" +check_num "(d) and no row was lost from s4d2" "$(q 'SELECT count(*) FROM s4d2;')" "20000" # THE ONLINE VERB'S CURVE DEFENCE, and it is gated on both rewrites having # happened. Untouched, s4d1 is still on the (a,b) layout while s4d2 is on the @@ -760,7 +760,7 @@ S5ZO_BEFORE="$(scanorder s5zo)" S5HI_SET="$(setof s5hi)" S5ZO_SET="$(setof s5zo)" check_text "premise: the two single-column fixtures start identical" "$S5HI_BEFORE" "$S5ZO_BEFORE" -check "premise: the plan being digested here is the columnar custom scan too" \ +check "premise: the plan being digested for s5hi is the columnar custom scan too" \ "$(pgc_is_columnar_scan 'SELECT * FROM s5hi')" "yes" hrun "cluster_hilbert('s5hi','a')" "SELECT pgcolumnar.cluster_hilbert('s5hi','a');" @@ -801,7 +801,7 @@ check_text "and each records its own verb's kind" "$(skind s5hi)/$(skind s5zo)" mk4 s6t hrun "cluster_hilbert('s6t','a','b')" "SELECT pgcolumnar.cluster_hilbert('s6t','a','b');" check_text "premise: s6t is a hilbert table before vacuum_sorted touches it" "$(skind s6t)" "hilbert" -check "premise: the plan being digested here is the columnar custom scan too" \ +check "premise: the plan being digested for s6t is the columnar custom scan too" \ "$(pgc_is_columnar_scan 'SELECT * FROM s6t')" "yes" # THE ORDER DIGEST IS THE INSTRUMENT HERE, NOT physlayout. vacuum_sorted is an # EAGER verb, and an eager rewrite reproduces the stripe geometry exactly, so @@ -887,7 +887,7 @@ check_text "premise: and the key the daemon will read off it is the one it was c check_text "premise: the daemon agrees a recluster is due, and that a compaction is NOT" \ "$(q "SELECT recluster_due::text || '/' || compact_rewrite_due::text FROM pgcolumnar.maintenance_due('av_hi');")" \ "true/false" -check "premise: the plan being digested here is the columnar custom scan too" \ +check "premise: the plan being digested for av_hi is the columnar custom scan too" \ "$(pgc_is_columnar_scan 'SELECT * FROM av_hi')" "yes" # The two references, driven by hand while the daemon is still off.