Skip to content

[BUG](sqlite): Balance composite filters - #8002

Draft
adity982 wants to merge 1 commit into
chroma-core:mainfrom
adity982:fix/balance-large-composite-filters
Draft

adity982 wants to merge 1 commit into
chroma-core:mainfrom
adity982:fix/balance-large-composite-filters

Conversation

@adity982

Copy link
Copy Markdown

What changes

Large flat $and and $or filters now become balanced SQL expression trees, keeping nesting depth logarithmic in the number of clauses. Empty and single-child filters keep their existing results.

Validation

  • cargo fmt --all -- --check passed
  • git diff --check passed
  • Added a 16,500-clause SQL rendering regression
  • Local Rust test compilation is pending: Cargo stalled while fetching upstream Git dependencies and their submodule before reaching compilation. Hosted checks should provide the compile and test result.

This patch was prepared with AI assistance. It addresses the crash reported in #7970.

Fixes #7970

@github-actions

Copy link
Copy Markdown

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

This branch has not been deployed

No deployments
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.

[Bug]: A where $or of about 16,500 or more clauses crashes the embedded client process (SIGSEGV)

1 participant