Skip to content

[improvement](build) Add merged lance-c multi-vector API patch - #68056

Merged
Gabriel39 merged 1 commit into
apache:masterfrom
Gabriel39:dev/lance-c-pr83-master
Sep 16, 2026
Merged

Gabriel39 merged 1 commit into
apache:masterfrom
Gabriel39:dev/lance-c-pr83-master

Conversation

@Gabriel39

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Related PR: #67741; consumer integration: #68028

Add merged lance-format/lance-c#83 to the Lance-C third-party patch chain on master. This provides the C/C++ multi-vector query API and its upstream scoring, validation and regression tests as a prerequisite for Doris multi-vector search integration.

The patch records upstream commit 0a30ee6c5a9d1455ceb36f4745acb79e53a00461. Overlapping context is adapted to the existing patch chain while retaining PR #79's scalar-segment execution path and tests. The multi-vector implementation and integration tests are byte-identical to the merged upstream commit. The release archive and dependency versions remain unchanged from #67741.

Apply PR #83 with a separate completion marker so source trees already carrying the existing patches also receive the new API, and repeat runs do not reapply it. Rebuild Lance-C before consuming the new API. This PR changes only third-party patch integration and does not expose new Doris SQL syntax.

Validation

  • Applied the actual Lance-C patch-driver block to clean v0.1.9 sources and to sources already patched through [chore](lance) update some patches from lance-c #67741; both produce identical source trees. Repeat execution leaves the sources unchanged. All patches apply with --fuzz=0.
  • Compared the resulting source tree with the previously validated integrated chain and checked the multi-vector implementation/tests against the merged upstream commit.
  • cargo test --locked: 410 tests passed, including 14 multi-vector integration tests; three opt-in C/C++ compile/run and static-transport tests were ignored in this run.
  • cargo fmt --check and bash -n thirdparty/download-thirdparty.sh passed.
  • Completed local self-review of patch provenance, conflict adaptation, existing API behavior, ownership/resource bounds and cached-source application before committing.

A complete Doris build and SQL regression run are not part of this local dependency-only validation.

Release note

None

Check List (For Author)

  • Test
    • Unit Test
    • Manual test: patch application, cached-source upgrade, repeat execution and source equivalence
  • Behavior changed:
    • Yes: the third-party library gains the upstream multi-vector API; existing API signatures remain unchanged.
  • Does this need documentation?
    • No: upstream API documentation is included in the patch.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Related PR: apache#67741; consumer integration: apache#68028

Add merged [lance-format/lance-c#83](lance-format/lance-c#83) to the Lance-C third-party patch chain on master. This provides the C/C++ multi-vector query API and its upstream scoring, validation and regression tests as a prerequisite for Doris multi-vector search integration.

The patch records upstream commit `0a30ee6c5a9d1455ceb36f4745acb79e53a00461`. Overlapping context is adapted to the existing patch chain while retaining PR apache#79's scalar-segment execution path and tests. The multi-vector implementation and integration tests are byte-identical to the merged upstream commit. The release archive and dependency versions remain unchanged from apache#67741.

Apply PR apache#83 with a separate completion marker so source trees already carrying the existing patches also receive the new API, and repeat runs do not reapply it. Rebuild Lance-C before consuming the new API. This PR changes only third-party patch integration and does not expose new Doris SQL syntax.

### Validation

- Applied the actual Lance-C patch-driver block to clean v0.1.9 sources and to sources already patched through apache#67741; both produce identical source trees. Repeat execution leaves the sources unchanged. All patches apply with `--fuzz=0`.
- Compared the resulting source tree with the previously validated integrated chain and checked the multi-vector implementation/tests against the merged upstream commit.
- `cargo test --locked`: 410 tests passed, including 14 multi-vector integration tests; three opt-in C/C++ compile/run and static-transport tests were ignored in this run.
- `cargo fmt --check` and `bash -n thirdparty/download-thirdparty.sh` passed.
- Completed local self-review of patch provenance, conflict adaptation, existing API behavior, ownership/resource bounds and cached-source application before committing.

A complete Doris build and SQL regression run are not part of this local dependency-only validation.

### Release note

None

### Check List (For Author)

- Test
    - [x] Unit Test
    - [x] Manual test: patch application, cached-source upgrade, repeat execution and source equivalence
- Behavior changed:
    - [x] Yes: the third-party library gains the upstream multi-vector API; existing API signatures remain unchanged.
- Does this need documentation?
    - [x] No: upstream API documentation is included in the patch.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@github-actions github-actions Bot 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.

Static exact-head review completed for b43d176. I found two blocking P2 issues, both left inline.

Critical checkpoints:

  • Goal and tests: the patch adds the merged lance-c multi-vector C/C++ API and covers ordinary exact, indexed, refined, hybrid, nested-projection, metric, validation, offset, and strict-batch behavior. The implementation does not fully meet that goal for finite values that derive non-finite f32 scores, and the tests miss that numeric domain.
  • Scope and compatibility: the Doris change is focused on the third-party patch chain. The ABI addition is additive; no FE/BE protocol, configuration, transaction, persistence, or storage-format change is involved. The independent PR83 cache marker is ordered safely under set -e and the embedded implementation matches the upstream merge context.
  • Concurrency and lifecycle: scoring uses owned Arrow data across bounded blocking tasks; no new shared mutable state or locking is introduced. Scanner mutation is validation-before-commit, caller buffers are copied, callbacks/batch options are preserved, and FTS/scalar-segment coexistence remains fail-closed.
  • Parallel paths and correctness: exact, indexed, mandatory-refinement, appended/hybrid, fragment-scoped, nested, and selected-segment paths were traced. Scorer replacement occurs below the relevant TopK nodes and its schema/distribution contracts are sound. Numeric error handling is not sound for derived overflow/NaN, as noted inline.
  • Performance: candidate counts are bounded, but moving the result window above remaining-column Take defeats limit-driven late materialization and can read/sort up to 100,000 arbitrarily large payload rows for a one-row result.
  • Observability and coverage: existing execution-stat callbacks are preserved and no separate new metric is required. Add focused tests for finite numeric overflow/underflow and for payload reads with k much larger than limit.

User focus: no additional review focus was supplied. Review status: complete after two rounds converged with no new valuable findings. This was static-only as required; no builds or tests were run.

Comment thread thirdparty/patches/lance-c-0.1.9-pr-83.patch
Comment thread thirdparty/patches/lance-c-0.1.9-pr-83.patch
@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 63.02% (29323/46528)
Line Coverage 47.94% (305790/637846)
Region Coverage 43.61% (246936/566275)
Branch Coverage 45.14% (114715/254147)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.21% (34337/45058)
Line Coverage 61.04% (384987/630707)
Region Coverage 57.42% (323966/564235)
Branch Coverage 58.18% (147471/253480)

@Gabriel39
Gabriel39 merged commit f89181c into apache:master Sep 16, 2026
39 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Sep 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants