Skip to content

[MOD-17684] Give OptimizedWildcard a suspended counterpart - #10896

Merged
LukeMathWalker merged 1 commit into
masterfrom
luca-reval-wildcard-machinery
Aug 17, 2026
Merged

LukeMathWalker merged 1 commit into
masterfrom
luca-reval-wildcard-machinery

Conversation

@LukeMathWalker

@LukeMathWalker LukeMathWalker commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Describe the changes in the pull request

  1. Current: OptimizedWildcard — the wildcard iterator reading the existing-docs inverted index — has no suspended counterpart, so neither it nor the enums that wrap it can be held across a release of the index spec read lock.
  2. Change: it implements RQEIteratorBoxed::suspend / RQESuspendedIterator::resume. The enum is re-shaped into a Ref-mode-parametrized RawOptimizedWildcard, so suspending is a layout-preserving reinterpretation of the same allocation rather than a rebuild, with each arm's inverted-index wildcard transitioned in place. Same shape as [MOD-17682] NumericIteratorVariant: suspend/resume #10894's RawNumericIteratorVariant; the legacy revalidate is unchanged.
  3. Outcome: no user-visible change — the pipeline does not suspend iterators yet. This is a per-iterator prerequisite for that wiring, and it unblocks the rest of the wildcard family (DiskWildcardIterator, NewWildcardIterator) and any composite over wildcard children.

Which additional issues this PR fixes

  1. MOD-17684

Main objects this PR modified

  1. RawOptimizedWildcard<'query, Rf> plus the OptimizedWildcard / OptimizedWildcardSuspended aliases — one generic enum rather than a hand-maintained pair, so variant order and tag encoding agree by construction. The const proof asserts what is left: arm correspondence (an IsSame witness that suspending an arm yields exactly the matching arm) and per-arm plus whole-enum layout identity.
  2. suspend / resume on the enum — reuse the heap allocation so external borrows into the iterator's interior stay valid, and drive each arm through the shared child-slot helpers.
  3. The revalidation decision, which stays the arm's own: abort when the GC nulled out or replaced existingDocs, Moved when the current document was collected, Ok otherwise. Stating it in the wrapper as well is what would let the two drift apart.
  4. inverted_index visibility — core, and RawWildcard's it field and should_abort, go back to private now that the wrapper reaches the arm through its trait impl instead of past it.
  5. tests/integration/wildcard.rs — round trip per variant (box-address stability, and that the cast lands on the same variant), plus the nulled, replaced, and current-document-collected cases against a real existing-docs index.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Release Notes

  • This PR requires release notes
  • This PR does not require release notes

@codecov

codecov Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.15385% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.22%. Comparing base (5a83a5b) to head (2af2ebb).
⚠️ Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
src/redisearch_rs/rqe_iterators/src/wildcard.rs 70.58% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10896      +/-   ##
==========================================
- Coverage   83.16%   82.22%   -0.94%     
==========================================
  Files         606      635      +29     
  Lines       80987    82402    +1415     
  Branches    36248    37614    +1366     
==========================================
+ Hits        67350    67757     +407     
- Misses      13290    14301    +1011     
+ Partials      347      344       -3     
Flag Coverage Δ
flow 84.35% <ø> (-0.04%) ⬇️
unit 55.82% <71.15%> (-0.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add `OptimizedWildcardSuspended`, its layout-invariant proof, and the
`RQEIteratorBoxed` impl that pairs them. Extracted from the UnionOpaque
revision, which carried this wildcard machinery for no reason of its own.
@LukeMathWalker LukeMathWalker changed the title [MOD-16714] Give OptimizedWildcard a suspended counterpart [MOD-17684] Give OptimizedWildcard a suspended counterpart Aug 17, 2026
@LukeMathWalker
LukeMathWalker force-pushed the luca-reval-wildcard-machinery branch from 76f84a4 to 2af2ebb Compare August 17, 2026 10:49
@github-actions github-actions Bot added size:L and removed size:M labels Aug 17, 2026
@sonarqubecloud

Copy link
Copy Markdown

@LukeMathWalker
LukeMathWalker added this pull request to the merge queue Aug 17, 2026
Merged via the queue into master with commit 7f79b74 Aug 17, 2026
60 of 61 checks passed
@LukeMathWalker
LukeMathWalker deleted the luca-reval-wildcard-machinery branch August 17, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants