Repository navigation
refactor: narrow physical, cost, accuracy and types visibility (#1054 step 8b) - #1094
Merged
Merged
Conversation
…step 8b)
Each item is pub only when another crate's non-test code uses it; items
only tests use sit behind a `test-support` feature enabled in
dev-dependencies, and items nothing reads are deleted.
- physical: `optimize_physical_asap_assigned` and `materializes_any` are
test-support only; `optimize_physical_asap_chosen`,
`implement_candidate_operators` and the pane-coverage check move behind
`test_support`; summary eligibility, `IngestionPruneReason` and
`summary_window` become crate-private. Deleted the write-only
`PhysicalWorkloadPlan::assignment` and
`SummaryMaterializationEligibility::may_materialize_at_query`.
- accuracy: estimator, sizing and composition helpers only tests call move
behind `test_support`; `budget` and `function_rules` become private (one
path to `per_input_target`).
- cost: `measured` and `resources` become private (one path to the cost
table types); unused `OperatorStatistics::{input_count, promql_input}`
deleted.
- types: new `test-support` feature; single-stage helpers named in #1054
are crate-private with test wrappers; test-only methods are gated;
unused `AggIntent::requires`, `DataModel` and
`ParsedWorkload::planning_workload` deleted.
No behavior change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1054 (step 8b, visibility):
asap-physical-asap-optimization,asap-cost,asap-accuracyandasap-types. Logical and plan-selection follow after their #1047 reshapes.Why
#1054's rule: an item is
pubonly if another crate's non-test code uses it. Test-only access goes behind atest-supportfeature that only dev-dependencies enable. Many items in these four crates werepubwith no production user outside their own crate, so the crate boundaries did not show what each stage actually uses.What
Visibility, import paths and deletions only. Behavior is unchanged.
Narrowed:
optimize_physical_asap_assigned,materializes_any,optimize_physical_asap_chosen,implement_candidate_operatorsand thesummary_windowmodule are now reached throughtest_support.summary_materialization_eligibilityand its types arepub(crate).satisfies,local_guarantee, the sketch size helpers,PropagationStatsand its constants are nowpub(crate), withtest_supportwrappers. Thebudget,function_rulesandestimators::{cms,kll}modules are private. There is one path toper_input_target.measuredandresourcesmodules are private.lookup,aggregate_lookupandStateFamilyare re-exported at the crate root, because plan-selection uses them. Internal statistics types and fields arepub(crate).asap-types/test-supportfeature.Deleted (no non-test reader):
PhysicalWorkloadPlan::assignmentSummaryMaterializationEligibility::may_materialize_at_query, with two test asserts that read only itOperatorStatistics::input_countandpromql_inputAggIntent::requiresand theDataModelenum it alone usedParsedWorkload::planning_workloadHow
pubitem,git grepfound its users across the workspace.pub;#[cfg(any(test, feature = "test-support"))]or a thintest_supportwrapper;pub(crate).asap-typesgains atest-supportfeature. The planner'stest-supportfeature enables it.Key code interfaces added / modified
New test-only modules:
asap_types::test_supportasap_accuracy::test_supportasap_physical_asap_optimization::test_supportEach is a one-line forward or a re-export, compiled only with
test-support.Usage: a test that needs a crate-internal helper enables the feature in dev-dependencies and calls it through
test_support:Production code is unaffected:
stage_pipelineand the planner build without anytest-supportfeature.Major algorithm changes
None.
Before / After
pubwith no production user outside their crate.pubmeans used by another crate's production code.Not done here: about 50 test-only
asap-typesfields and methods that the crate also uses itself (for exampleSummaryCoverage.selectionandPhysicalASAPDAGEdgefields). Hiding them needs accessors and many test edits, so that is a follow-up.Verification
At
7f575d51f(on main2109b346d):Lint: fmt clean.
clippy --workspace --all-targets -D warningsclean, also per package.Normal builds:
cargo build --workspace,cargo build -p asap-devtools --binsandcargo build -p asap-plannerpass with 0 warnings.Feature leakage:
cargo tree -e features,normalon planner, devtools, executor, frontends, plan-selection and integration-tests shows notest-supportfeature on a normal edge, apart from the test-only crate integration-tests, as before.Test builds:
cargo test -p <crate> --no-runfor each of the 14 crates compiles with 0 warnings.Tests:
--libThe 2 known parallel-load flakes pass alone.
Docs:
cargo doc --no-depswarnings are the same as base, or one fewer for accuracy.Independent review: no blocking findings. It confirmed:
External impact: none outside this repo.
🤖 Generated with Claude Code