Skip to content

ffi: Add extensible C search parameters - #70

Merged
jerry-024 merged 2 commits into
apache:mainfrom
shyjsarah:codex/extensible-c-search-params-20260805
Aug 7, 2026
Merged

ffi: Add extensible C search parameters#70
jerry-024 merged 2 commits into
apache:mainfrom
shyjsarah:codex/extensible-c-search-params-20260805

Conversation

@shyjsarah

Copy link
Copy Markdown
Contributor

Summary

Add an append-only C search-parameter structure so future query tuning fields can be exposed without adding a new by-value ABI version for every field.

This also exposes max_initial_filter_expansion_factor to C and C++ while preserving the existing V1/V2 symbols and behavior.

Changes

  • Add pointer-based PaimonVindexSearchParamsEx with a caller-provided struct_size.
    • Missing fields from shorter caller structs use existing defaults.
    • Unknown trailing fields from newer caller structs are ignored.
  • Add *_ex variants for single, filtered, batch, and filtered-batch C searches.
  • Keep all existing by-value C search functions unchanged for binary compatibility.
  • Route the C++ RAII reader through the extensible API and expose:
    • max_initial_filter_expansion_factor
    • IVF-PQ batch table reuse mode
    • IVF-PQ batch table reuse memory budget
  • Document the append-only ABI contract and C/C++ usage.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --workspace --locked -- -D warnings
  • cargo test --workspace --locked
  • C FFI roundtrip tests, including a shorter prefix struct passed to the new API
  • C++ roundtrip tests and query tuning parameter forwarding
  • git diff --check

Notes

@jerry-024 jerry-024 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@jerry-024
jerry-024 merged commit d5efa3f into apache:main Aug 7, 2026
9 checks passed
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.

2 participants