Skip to content

Remove the unread accuracy-evidence API - #641

Draft
zzylol wants to merge 1 commit into
stack/fix-nested-topk-keysfrom
stack/cleanup-12-evidence-api
Draft

zzylol wants to merge 1 commit into
stack/fix-nested-topk-keysfrom
stack/cleanup-12-evidence-api

Conversation

@zzylol

@zzylol zzylol commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #574 → #620 → #618 → #621 → #627 → #625 → #628 → #632 → #634 → #616 → #617 → #622 → #624 → #629 → #630 → #631 → #633 → #635 → #636 → #637 → #638 → #640 → #641

Rebased onto #640. At this head cargo fmt --all --check, clippy -D warnings and cargo test --workspace pass (1277 passed, 0 failed, 13 ignored); viewer tests OK.

Problem

After the legacy search was removed (#635), the planning-time accuracy-evidence API has no reader. PlanningModels.evidence was stored but never read: no stage pipeline code (Stage 1 logical_candidates/pass2, Stage 3 plan_stages/build_violation/answers/satisfies, executor, frontends, devtools stage_pipeline, facade) calls a provider method. Removing the items and building the whole workspace (all targets) confirms it.

Changes

Deleted:

  • PlanningModels.evidence and with_evidence. PlanningModels::new(accuracy, evidence) becomes new(accuracy).
  • accuracy/evidence.rs: AccuracyEvidenceProvider, NoAccuracyEvidence, WorkloadAccuracyEvidence (and its test), EstimatorContract, QuantileInputDomain, along with the crate-root and accuracy re-exports.
  • ClassicHllConfidence and its 4 tests. Only an EstimatorContract::ClassicHll could reach it, and nothing produced one.

Kept:

  • The generic HLL estimator (hll::generic_guarantee, hll_precision), which Stage 3 uses through local_guarantee.
  • PropagationStats, which hydra_guarantee reads. It is now a pub(crate) struct in accuracy/estimators/mod.rs with only the two Hydra shared-grid fields that are read. The other fields were filled only by the provider or by nothing: quantile ratio domains, row count, distribution, TopK intervals, non-negative proof and evidence provenance.

Docs: I removed the evidence row from library-api.md, and made short factual edits to input-output-workflow.md, accuracy-models.md (evidence section, and the Classic HLL example replaced with a short HLL-confidence note) and end-to-end-accuracy-guarantees.md. Two docs already marked historical (evidence-dependent-candidates.md, ddsketch-quantile-ratios.md) still mention the old names and are left as they are.

For a later decision (not changed here)

MaintainedPopulationStrategy::candidate (pass1/maintained_population.rs) is reachable from no planner path. Only tests call it, in logical-optimizer, frontend-sql, frontend-promql and executor. Stage 2 rejects maintained populations (reject_maintained_populations). It is left in place for a separate decision.

Test plan

  • cargo fmt --all -- --check: clean
  • cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo test --workspace: 1275 passed, 0 failed, 14 ignored (123 suites). The 5 removed tests were the evidence and classic HLL tests.

🤖 Generated with Claude Code

After the legacy search was removed, nothing reads planning-time accuracy
evidence. Delete AccuracyEvidenceProvider, NoAccuracyEvidence,
WorkloadAccuracyEvidence, EstimatorContract, QuantileInputDomain,
PlanningModels.evidence / with_evidence, and ClassicHllConfidence, which only
an EstimatorContract could reach. PropagationStats keeps the two Hydra
shared-grid fields hydra_guarantee reads and moves next to it. The generic
HLL estimator Stage 3 uses is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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