Remove dead and test-only code: row-reference oracle, old_docs, test-only demand model, batch bridge, memo snapshot #1046
Copy link
Copy link
Closed
Labels
Description
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
- Item 1: confirm that columnar parity is accepted, and decide which outputs to keep as fixed expected-row tests per operator before deleting the oracle.
- Item 6: delete the snapshot now, or keep it until the One shared-producer rule: cover every reader's need, derive each reader (top-k, summary size, panes, ranks, …) #954 / Reorganize by stage: one memo-based Pass 2, Stage 1 finishes the memo, deployment inputs split by stage, asap-planner as the only entry point #958 follow-ups land.
Done when
- Each item is removed (item 4: deduplicated), and
cargo test --workspaceand CI pass. - No public API changes outside
asap-physical-asap-optimization(item 7) and the devtools lib (item 4).
🤖 Generated with Claude Code
Activity
zzylol commentedon Oct 29, 2026
Additions from the per-crate review in #1054 (
mainat cef05d2). Each item was checked with a grep that excludes#[cfg(test)]modules,tests/and*_tests.rs. I also searched ASAPQuery-backend and ASAPCollectororigin/main.No users anywhere (delete):
run_stage1_to_stage3_from_pass1(plan-selection/src/search/pipeline.rs:218, re-exported atsearch/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 atest-supportfeature):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_candidate_count(lib.rs:689),materializes_any.confirmed_weights,with_confirmed_weights.compile_physical_asap_dag,compile_physical_asap_workloadvalidate_at_ingestion,planned_data_statedefault_cardinality,default_quantileNot dead, do not delete here:
optimize_physical_asapandselect_planare the reference pricer forstage_pipeline --price-enumerated(devtools/src/memo_pricing.rs:138,:146) andplanner_fuzz. [Refactor] Crate organization by stage: per-crate functionality, cross-stage code into asap-accuracy / asap-cost / asap-types, enforced crate boundaries, public vs private #1054 keeps them as a devtools reference.workload_candidates, the*_pass2_candidatesentries andquery_pruningbecome unused only after [Refactor] One named type per stage boundary: PerComputationLogicalMemoCandidates → LogicalASAPMemoCandidates → PhysicalASAPMemoCandidates #1047 P6. They are deleted in [Refactor] One named type per stage boundary: PerComputationLogicalMemoCandidates → LogicalASAPMemoCandidates → PhysicalASAPMemoCandidates #1047 P6b.docs: remove old_docs, which nothing references (#1046)
refactor: remove dead and test-only code (#1046)
docs: remove old_docs, which nothing references (#1046)
refactor: remove dead and test-only code (#1046)
docs: remove old_docs, which nothing references (#1046)
refactor: remove dead and test-only code (#1046)
refactor: remove the row-reference oracle and share the devtools corp…
docs: remove old_docs, which nothing references (#1046)
refactor: remove dead and test-only code (#1046)
refactor: remove the row-reference oracle and share the devtools corp…
refactor: remove dead and test-only code, part 1 (#1046) (#1069)
refactor: remove the row-reference oracle and share the devtools corp…
refactor: remove the row-reference oracle and share the devtools corp…