Repository navigation
feat: cost-based not/or ordering (#205) - #251
Merged
Merged
Conversation
…le optimization) Covers issues #207 and #206: extends optimizer::plan() to accept Expr clauses and interleave them at the earliest position where their variables are bound, and routes the StratifiedEvaluator mixed-rules path through the updated planner. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d rules) TDD plan covering optimizer.rs, matcher.rs, executor.rs, evaluator.rs, and a new Criterion benchmark. 9 tasks, each with exact file paths, code blocks, and expected test output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…#205) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a concise 'WASM omission' comment at every existing and planned #[cfg(not(feature = "wasm"))] ordering gate explaining why sorting is disabled on WASM targets (small datasets, deterministic behaviour). The full rationale lives in the selectivity_score() doc comment; all other sites reference it with a short cross-reference. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cost (#205) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Static 4-tier cardinality cost model. Unconditional (all targets). Sorting call-sites gated on cfg(not(feature = "wasm")) added in next commit.
…se_cost (#205) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cheap filters run first; bindings rejected early never reach expensive filters. Gated on cfg(not(feature = "wasm")) — small datasets + determinism on WASM.
Infrastructure for issue #250 (or short-circuit). All branches still evaluated. Gated on cfg(not(feature = "wasm")). Also adds #[allow(dead_code)] to clause_cost which is public API exercised in tests but not yet consumed by non-test call-sites. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ator (#205) Consistent with executor.rs; cheap filters run first in mixed-rules loop. Gated on cfg(not(feature = "wasm")).
#205) Makes clause_cost reachable from production code (fixes dead_code lint). Semantically identical: clause_cos 8000 t(Not(body)) == branch_cost(body).
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
… unused_mut) Gate pattern_cost / branch_cost / clause_cost and their tests behind #[cfg(not(feature = "wasm"))] to match the call-sites that consume them. Add #[cfg_attr(feature = "wasm", allow(unused_mut))] to `let mut` bindings that are only mutated inside #[cfg(not(feature = "wasm"))] sort blocks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r allow instead of cfg gate (#205) Spec requires pattern_cost/branch_cost/clause_cost to be available on all targets. Only the sorting call-sites are gated on cfg(not(feature = "wasm")). Use cfg_attr(feature = "wasm", allow(dead_code)) to silence the dead_code lint on wasm. Cost-model unit tests also made unconditional (they don't run on wasm32 anyway).
adityamukho
added a commit
that referenced
this pull request
May 17, 2026
Wave 2 (PRs #249, #251, #253) was missing from CHANGELOG.md, ROADMAP.md, and TEST_COVERAGE.md: - CHANGELOG.md: add Wave 2 section between Wave 3 and Wave 1 entries - ROADMAP.md: add Wave 2 to timeline between Wave 1 and Wave 3 - TEST_COVERAGE.md: add Wave 2 completion status note (no new tests — all optimizer + benchmark work covered by existing 850 tests) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
pattern_cost,branch_cost,clause_costtooptimizer.rs(unconditional, all targets)not/not-joinclauses cheapest-first inexecute_query,execute_query_with_rules, andStratifiedEvaluatoror/or-joinbranches cheapest-first inapply_or_clauses(infrastructure for perf: short-circuit or/or-join branch evaluation using cost model #250)#[cfg(not(feature = "wasm"))]— small datasets + determinism on WASMCloses #205
Test plan
cargo test)optimizer.rscargo clippy -- -D warningscleancargo fmt --checkclean🤖 Generated with Claude Code