Commit b2513c6
committed
sql: use metamorphic defaults for optimizer testing knobs in logictest
Wire testing_optimizer_cost_perturbation and
testing_optimizer_disable_rule_probability into logictest via metamorphic
constants, matching other logictest fuzzing knobs and the settings used
by costfuzz and unoptimized-query-oracle.
Metamorphic values are opt-in via COCKROACH_LOGIC_TEST_OPTIMIZER_METAMORPHIC
so normal CI logictest runs keep deterministic query plans. Execbuilder
and SQLite logic tests disable perturbations via TestServerArgs.
Implementation notes:
- metamorphicDisableOptRuleProbability: choices {0, 0.5, 1.0}
- metamorphicOptimizerCostPerturbation: choices {0, 0.1, 1.0}, where
0.1 mirrors the mild-perturbation range used by costfuzz and 1.0
stress-tests extreme plan changes.
- DisableOptimizerPerturbations is emitted by the generate-logictest
template only when ForceProductionValues is absent; all execbuilder
configs already set ForceProductionValues which short-circuits the
knob helper to (0, 0), making the field redundant there.
- The `if disableProb == 0` guard preserves explicit non-zero CLI flag
values; a comment documents the edge case where the metamorphic
constant itself picks 0 (no-op assignment).
To exercise locally:
COCKROACH_LOGIC_TEST_OPTIMIZER_METAMORPHIC=true \
./dev test pkg/sql/logictest/tests/local -f TestLogic_select
Fixes #93825
Release note: None1 parent b852382 commit b2513c6
21 files changed
Lines changed: 99 additions & 24 deletions
File tree
- pkg
- cmd/generate-logictest
- sql
- logictest
- opt/exec/execbuilder/tests
- 3node-tenant-multiregion
- 3node-tenant
- 5node
- local-read-committed
- local
- multiregion-9node-3region-3azs
- sqlitelogictest/tests
- 3node-tenant
- fakedist-disk
- fakedist-vec-off
- fakedist
- local-legacy-schema-changer
- local-mixed-25.4
- local-mixed-26.1
- local-mixed-26.2
- local-prepared
- local-read-committed
- local-repeatable-read
- local-vec-off
- local
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
68 | | - | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
191 | | - | |
| 196 | + | |
| 197 | + | |
192 | 198 | | |
193 | 199 | | |
194 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
603 | 621 | | |
604 | 622 | | |
605 | 623 | | |
| |||
1638 | 1656 | | |
1639 | 1657 | | |
1640 | 1658 | | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
1641 | 1662 | | |
1642 | 1663 | | |
1643 | 1664 | | |
1644 | 1665 | | |
1645 | | - | |
1646 | | - | |
| 1666 | + | |
| 1667 | + | |
1647 | 1668 | | |
1648 | 1669 | | |
1649 | 1670 | | |
| |||
4850 | 4871 | | |
4851 | 4872 | | |
4852 | 4873 | | |
| 4874 | + | |
| 4875 | + | |
| 4876 | + | |
| 4877 | + | |
| 4878 | + | |
| 4879 | + | |
| 4880 | + | |
| 4881 | + | |
| 4882 | + | |
| 4883 | + | |
| 4884 | + | |
| 4885 | + | |
| 4886 | + | |
| 4887 | + | |
| 4888 | + | |
| 4889 | + | |
| 4890 | + | |
| 4891 | + | |
| 4892 | + | |
| 4893 | + | |
| 4894 | + | |
| 4895 | + | |
| 4896 | + | |
| 4897 | + | |
| 4898 | + | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
| 4902 | + | |
4853 | 4903 | | |
4854 | 4904 | | |
4855 | 4905 | | |
| |||
Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments