Skip to content

Remove dead and test-only code: row-reference oracle, old_docs, test-only demand model, batch bridge, memo snapshot #1046

Closed

Description

@milindsrivastava1997

Code that production never reaches, found by a repo-wide audit and checked with git grep on main at cef05d20. None of it is tracked by #1010 or its sub-issues. Removing it cuts about 6,300 lines.

The stage column says which #1010 stage issue each item belongs to.

# Remove Evidence Stage Lines
1 Row-at-a-time reference operators: executor/src/operators/row_reference/ (11 files), operators/aggregate/row_reference.rs, and the row_reference::enabled_for hook (operators/mod.rs:437) #[cfg(test)]. Tests run each operator twice, once under with_row_reference, and compare the outputs (harness::assert_matches_reference). #1016 ~3,100
2 old_docs/ (README plus design.md and the l1–l4 docs) No reference anywhere in the repo (code, docs, CI, tools). docs/ replaces it. – ~1,770
3 plan-selection/src/search/costing/demand.rs (derive_candidate_demand, CandidateDemand, BoundaryConsumer) #[cfg(test)] (costing/mod.rs:6). Only its own tests call it, and they never compare it against the production cost evaluator. #1015 ~408
4 Duplicated corpus helpers in the devtools bins: col, dqc_catalog, netflow_catalog, bgp_catalog, sql_stmts/sql_statements, promql_lines/corpus_lines, parse_sample_interval Each of sketch_coverage.rs, variant_coverage.rs, analyze_corpora.rs and examples/canonical_examples.rs keeps its own copy, and bgp_catalog already differs between copies. sketch_coverage.rs:3 says it "mirrors variant_coverage's corpus list exactly". Replace with one corpora module in the devtools lib, and consider merging sketch_coverage into variant_coverage. #1008 ~200–320
5 executor/src/runtime/batch_execution.rs (evaluate_batch, evaluate_inputs, evaluate_source, evaluate_dag) evaluate_inputs has no callers. Every other function is reached only from tests; the one non-test-file use is a test module in operators/aggregate/temporal.rs:405. The module doc calls it a "bridge for deployments" that does not exist. Move what that test needs into the test. #1016 ~213
6 logical-asap-optimization/src/pass2/memo/shared_producer_snapshot.rs #[cfg(test)] (pass2/memo.rs:16). An FNV hash of the whole memo, recorded to show the #959 refactor changed no candidates. Every unrelated memo change now has to re-record it (it already was once, for #1032). The rule tests in pass2/memo/rules/ cover the behavior. #1013 ~188
7 optimize_physical_asap_without_query_time_raw_scans, every_assignment_scans_raw_at_query_time, and the private reads_raw_at_query_time (physical-asap-optimization/src/lib.rs:455-547) No callers anywhere, including tests. #1014 ~93

Decisions needed

Done when

  • Each item is removed (item 4: deduplicated), and cargo test --workspace and CI pass.
  • No public API changes outside asap-physical-asap-optimization (item 7) and the devtools lib (item 4).

🤖 Generated with Claude Code

Activity

  1. zzylol commented on Oct 29, 2026

    @zzylol
    Contributor

    Additions from the per-crate review in #1054 (main at cef05d2). Each item was checked with a grep that excludes #[cfg(test)] modules, tests/ and *_tests.rs. I also searched ASAPQuery-backend and ASAPCollector origin/main.

    No users anywhere (delete):

    • run_stage1_to_stage3_from_pass1 (plan-selection/src/search/pipeline.rs:218, re-exported at search/mod.rs:44).
    • asap_aware_cse::with_shared_candidates (logical-asap-optimization/src/pass2/asap_aware_cse.rs:521).
    • hydra_kind_for, default_hydra_params (types/src/ir/schema/sketch.rs:501, :529).
    • MeasuredCpu, MeasuredResources (types/src/workload/resources/; used only inside that module).

    Public but used only by tests (move under #[cfg(test)] or a test-support feature):

    • logical:
      • accuracy::native_target (accuracy/mod.rs:91)
      • may_change_rollup_candidate (asap_aware_cse.rs:2048)
      • pane_configurations, pane_width_divisors (memo/shared_configurations.rs)
      • expand_concrete_summary_state_groups, _in_domain (memo/state_groups.rs:58, :67)
      • local_pane_candidates, add_local_window_composition (memo/window_candidates.rs)
    • physical: physical_candidate_count (lib.rs:689), materializes_any.
    • plan-selection: confirmed_weights, with_confirmed_weights.
    • types:
      • compile_physical_asap_dag, compile_physical_asap_workload
      • validate_at_ingestion, planned_data_state
      • default_cardinality, default_quantile

    Not dead, do not delete here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions