Skip to content

feat(clickhouse): add StatisticsPartPruning oracle; re-enable RowPolicy oracle - #15

Merged
fm4v merged 1 commit into
mainfrom
nik/clickhouse-statistics-part-pruning-oracle
Aug 28, 2026
Merged

feat(clickhouse): add StatisticsPartPruning oracle; re-enable RowPolicy oracle#15
fm4v merged 1 commit into
mainfrom
nik/clickhouse-statistics-part-pruning-oracle

Conversation

@fm4v

@fm4v fm4v commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

  • New ClickHouseStatisticsPartPruningOracle covers ClickHouse/ClickHouse#94140 ("Add statistics-based part pruning"), i.e. the use_statistics_for_part_pruning setting (default-on since 26.4). Before this, the setting was only exercised incidentally via the generic session-settings randomizer, with no dedicated correctness check.
  • Two arms, both differential use_statistics_for_part_pruning=1 vs =0 over toString(v) row multisets:
    • Fresh-fixture arm: a private table with an Int64/Float64/Decimal(18,4) column (optionally Nullable, with NaN/Inf edge rows for floats) declared STATISTICS(minmax), populated across disjoint-range parts, probed with range/boundary/NULL predicates.
    • Backfill arm: ALTER TABLE ... ADD STATISTICS on an already-populated table before and after MATERIALIZE STATISTICS, checking that stale/un-backfilled parts aren't wrongly pruned.
  • Registered as oracle StatisticsPartPruning and appended to ALL_ORACLES in .claude/run-sqlancer.sh.
  • Also re-enables the RowPolicy oracle (its Code-49 noise source, ClickHouse#106099, is fixed upstream; the oracle now tolerates the Code 162/306 depth-error families locally and checks the CREATE POLICY return value before proceeding) and prunes the now-closed #106099 entry from .claude/CLAUDE.md.

Test plan

  • mvn -B package -DskipTests=true -Djacoco.skip=true builds clean.
  • Isolated dev-vm run, --oracles StatisticsPartPruning, 8 min / 26.7k queries: 0 thread deaths, 0 reproducers.
  • Isolated dev-vm run, --oracles StatisticsPartPruning, 15 min / 64k queries, 6 threads: 0 thread deaths, 0 reproducers.
  • Full-fleet dev-vm run, --oracles all, 10 min / 47k queries: 67 reproducers, all attributable to the pre-existing, by-design TextIndexDirectRead #107186 family (none from the new oracle).
  • Final validation on the merged/rebased codebase, --oracles StatisticsPartPruning,RowPolicy, 10 min / 115k queries, head 26.9.1.268: 0 thread deaths, 0 reproducers.

…cy oracle

New ClickHouseStatisticsPartPruningOracle covers ClickHouse#94140's
use_statistics_for_part_pruning (26.4 default-on), which was previously only
exercised incidentally via the generic settings randomizer. Two arms, both
differential ON/OFF over toString(v) row multisets: a fresh-fixture arm with
a minmax-statistics-decorated column populated across disjoint-range parts,
and a backfill arm that ADD STATISTICS on an already-populated table before
and after MATERIALIZE STATISTICS to check the staleness boundary. Validated
0-FP on dev-vm head 26.9.1.268 (multiple isolated + full-fleet runs, 300k+
queries combined).

Also re-enable the RowPolicy oracle: its Code-49 noise source (#106099) is
fixed upstream, and the oracle now tolerates the Code 162/306 depth-error
families locally and checks the CREATE POLICY return value before
proceeding. Prune the now-closed #106099 entry from CLAUDE.md.
@fm4v
fm4v merged commit 2cdf6e1 into main Aug 28, 2026
0 of 2 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.

1 participant