Skip to content

[bench] Property-join planner regression bench (analyze_property_join_plan boundaries) #1229

Open

Description

@aaj3f

Context

Follow-up bench from PR #1228 review (item 1 in coverage gaps). The query planner's weighted-width gate (memory: mem:fact-01kmt5bw0782hg138vkahvnha3) and fused star-path selection (memory: mem:fact-01kmt9rs6m9d4rxt2ges55teq1) drove ~176×–933× perf wins recently. A regression in analyze_property_join_plan would not be caught by query_hot_bsbm unless the wins were end-to-end-visible — by which point the regression has already shipped to production.

Scope

Add fluree-db-api/benches/query_hot_property_join.rs (or a more focused location under fluree-db-query/benches/ if the bench can avoid the full Fluree stack) covering the analyze_property_join_plan decision boundary. Specifically:

  • Inputs that fall on either side of the weighted-width thresholds (2.0 / 3.0 / 4.0). The bench should construct datasets that deterministically produce widths just below and just above each threshold so a regression that flips the gate's decision is detectable.
  • A scenario per gate output: "wide-row property-join chosen", "fused star-path chosen", "fallback nested-loop chosen". Whatever the planner emits today is the baseline; the bench locks it in.
  • Use the chassis pattern. fluree_bench_support::gen::* for datasets; bench_runtime() / current_profile() / current_scale() for env-driven sizing; next_ledger_alias() for unique aliases per iteration. Register a budget in regression-budget.json for (crate, query_hot_property_join).

Acceptance

  • Bench compiles and runs --test green at tiny scale.
  • regression-budget.json has an entry under the appropriate crate.
  • BENCHMARKING.md's "Current benches" table gets a row.
  • If the bench introduces a new category, add a row to docs/contributing/benches.md.
  • Bench-gate CI job picks it up via the existing cargo bench --workspace -- --test step.

References

  • PR Workspace-Wide Benchmarking Foundation #1228 review (pr-1228-review.md in repo or comment thread): coverage gap #1.
  • Memory: mem:fact-01kmt5bw0782hg138vkahvnha3 (planner weighted-width gate), mem:fact-01kmt9rs6m9d4rxt2ges55teq1 (fused star-path selection).
  • Chassis docs: BENCHMARKING.md, docs/contributing/benches.md, fluree-bench-support/README.md.

Out of scope

This is a targeted regression bench, not a planner correctness suite. Correctness is owned by the existing integration tests; this bench locks in the perf decisions only.

Activity

  1. aaj3f commented on Aug 25, 2026

    @aaj3f
    ContributorAuthor

    Sweep re-verification at 47e96b7b6: still undelivered — no bench targets analyze_property_join_plan; the nearest coverage is query_overlay_matrix's star scenario, which is macro-level, not the boundary. And the ask has gotten more valuable, not less: 43 commits have touched where_plan.rs since this was filed.

    Updating the body to match current code: the 2.0/3.0/4.0 threshold trio is gone — it's a single PROPERTY_JOIN_MIN_WIDTH_SCORE = 3.0 (where_plan.rs:854), and the gate's output space is now {property-join, fused star-path, fallback} driven by width + selective-anchor + eligibility. The unit tests at where_plan.rs:4513-4576 already pin the score math, so the bench should focus on the perf cliff between chosen plans, not the arithmetic. (Also dropping the stale mem:fact-* references — those were session-local and aren't readable by anyone picking this up.)

  2. added
    P2
    area:query
    on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:query

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions