Skip to content

Consolidate spars_merge wiring and comparator typing - #84

Merged
drametwally merged 6 commits into
mainfrom
ussi-oop-cleanup
Oct 1, 2026
Merged

drametwally merged 6 commits into
mainfrom
ussi-oop-cleanup

Conversation

@drametwally

@drametwally drametwally commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Resolve ComparatorType once on Index and reuse it for matrix dot-product wiring, signature keying, and inverted spars_merge setup.
  • Centralize spars_merge rules in SparsMergeConfiguration (doesMergeSupportCandidateGeneration, doesPartialConjunctionUseConfiguredComparator, doesMergeScoreFromAccumulatedConjunction, doesMergeUseSequenceIndexedMultisetPartialConjunction, doesMergeRequireSignatureGeneratingComparator).
  • Wire merge fields in BaseInvertedIndex via private helpers and an injected MergeSearch.PartialConjunctionPolicy; comparator facet casts stay in ComparatorFactory only.
  • Build SignatureKeyingStrategy from ComparatorType, Comparator, and SignatureGenerator (config read in BaseInvertedIndex only).
  • Rename boolean predicates to question form across index, merge, entity, metadata, and row-filter APIs (does*, mergeScoresFromAccumulatedConjunction, doesStoreMergePostingValues, doesShareAnyTerm, doesPassRowFilter, and related helpers).

Test plan

  • bazel test //:test_main

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.
@drametwally drametwally changed the title Consolidate index wiring for spars_merge and ComparatorType Consolidate spars_merge wiring and comparator typing Oct 1, 2026
@drametwally
drametwally merged commit d596c6e into main Oct 1, 2026
3 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.

1 participant