Skip to content

Add optional MergeablePostingsList/Iterator and Releasable interfaces - #84

Closed
capemox wants to merge 1 commit into
nextfrom
bitpack-simd
Closed

capemox wants to merge 1 commit into
nextfrom
bitpack-simd

Conversation

@capemox

@capemox capemox commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

Part of the bitpack-simd effort (zapx blevesearch/zapx#447, bleve companion PR): adds three optional capability interfaces, following the existing OptimizablePostingsIterator pattern rather than changing the base PostingsList/PostingsIterator contracts.

  • MergeablePostingsList (RawDocFreq() uint64, HasLocs() bool) and MergeablePostingsIterator (NextWithLocBytes(...)) let a segment-merge path depend on published interfaces instead of a package-private bridge.
  • Releasable (Release()) lets a PostingsList/PostingsIterator value opt into pooled reuse, replacing prealloc-passing as the primary reuse mechanism for implementations that choose to support it.

These are additive and optional by design: bleve unconditionally registers zapx v11-v17 as segment plugins, none of which implement these methods, so adding them as required methods on the base interfaces would have broken bleve's build against six already-released modules. Checking via type assertion (the same idiom bleve's optimize.go already uses for OptimizablePostingsIterator) avoids that entirely.

Test plan

  • go build ./..., go vet ./... clean

Lets a PostingsList/PostingsIterator implementation opt into
segment-merge support and pooled reuse without changing the base
PostingsList/PostingsIterator contract, so existing implementations
(older zapx major versions) keep compiling unchanged.
@capemox

capemox commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Putting this off for a future release -- the zapx side (interface-only merge + pooling) is being reverted to the single PostingsList/PostingsIterator implementation. Closing rather than merging.

@capemox capemox closed this Sep 16, 2026
@capemox
capemox deleted the bitpack-simd branch September 16, 2026 01:34
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