Consolidate spars_merge wiring and comparator typing - #84
Merged
Merged
Conversation
Index resolves ComparatorType once. SparsMergeConfiguration shares merge rules between validation and SparsMergeInvertedIndexSetup. Signature and matrix indices use the resolved type instead of re-parsing config.
Merge partial-conjunction paths share one configured-comparator predicate. ComparatorFactory uses one castFacet helper. Index validation reuses the parsed ComparatorType for dot-product checks.
Merge field wiring lives in private helpers on BaseInvertedIndex. SparsMergeConfiguration still supplies rules shared with validation.
SparsMergeConfiguration.mergeRequiresSignatureGeneratingComparator matches IndexConfigValidator spars_merge rules. SignatureKeyingStrategy is built from comparatorType, comparator, and an injected generator.
SparsMergeConfiguration and IndexType checks read as does-merge and does-index questions. PartialConjunctionPolicy uses doesUsePartialConjunction.
Merge wiring flags use mergeScoresFromAccumulatedConjunction and doesStoreMergePostingValues. Entity, metadata, row-filter, and merge-search checks read as doesShareAnyTerm, doesIntersect, doesMatchMetaFilter, doesPassRowFilter, and doesRowMayReachMinSimilarity.
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.
Summary
ComparatorTypeonce onIndexand reuse it for matrix dot-product wiring, signature keying, and invertedspars_mergesetup.spars_mergerules inSparsMergeConfiguration(doesMergeSupportCandidateGeneration,doesPartialConjunctionUseConfiguredComparator,doesMergeScoreFromAccumulatedConjunction,doesMergeUseSequenceIndexedMultisetPartialConjunction,doesMergeRequireSignatureGeneratingComparator).BaseInvertedIndexvia private helpers and an injectedMergeSearch.PartialConjunctionPolicy; comparator facet casts stay inComparatorFactoryonly.SignatureKeyingStrategyfromComparatorType,Comparator, andSignatureGenerator(config read inBaseInvertedIndexonly).does*,mergeScoresFromAccumulatedConjunction,doesStoreMergePostingValues,doesShareAnyTerm,doesPassRowFilter, and related helpers).Test plan
bazel test //:test_main