fix: use base scalar Similarity types in RVV SQ4U fallback path#1588
Merged
sre-ci-robot merged 1 commit intoApr 20, 2026
Merged
Conversation
11ca213 to
3f92744
Compare
3f92744 to
f82c707
Compare
f82c707 to
cb9190c
Compare
The previous fix (zilliztech#1586) added `simdwidth` to `SimilarityL2_rvv<0>` and `SimilarityIP_rvv<0>`, but `select_distance_computer_rvv` still passed RVV tag types directly to the base `select_distance_computer`. Because that function instantiates `DCTemplate<..., Sim, 1>` for every switch branch, and the SIMDWIDTH=1 specialization requires a full scalar Similarity interface (constructor, begin, add_component, add_component_2, result), the riscv64 build still fails with errors like "no member named 'begin'" / "no matching constructor". Fix: map `SimilarityL2_rvv<0>` → `SimilarityL2<1>` and `SimilarityIP_rvv<0>` → `SimilarityIP<1>` before calling `select_distance_computer`, so the base function instantiates templates with types that satisfy the full interface contract. This also reverts the incomplete fix from zilliztech#1586 (adding `simdwidth` to RVV tag types), since the RVV code path never reads `simdwidth` from its Similarity types — keeping the tag types minimal and consistent with their pure-tag design. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: CLiqing <2208529306@qq.com>
cb9190c to
44882a1
Compare
Collaborator
|
/rerun-e2e |
Collaborator
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CLiqing, foxspy The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Follow-up fix for #1586. The previous fix added
simdwidthto the RVV Similarity tag types, but theQT_4bit_uniformfallback path inselect_distance_computer_rvvstill passedSimilarityL2_rvv<0>/SimilarityIP_rvv<0>directly to the baseselect_distance_computer, causing compilation failure on riscv64.Fix:
select_distance_computer:SimilarityL2_rvv<0>(metric_type == METRIC_L2) →SimilarityL2<1>SimilarityIP_rvv<0>(metric_type == METRIC_INNER_PRODUCT) →SimilarityIP<1>simdwidthfrom RVV tag types), since the RVV code path never readsSimilarity::simdwidth— keeping tag types minimal and consistent with their pure-tag design.issue: #1587
Compilation errors before this fix (on riscv64 with v2.6.11 + #1586)