Skip to content

Refactor Optional Iterator Optimized mode - [MOD-9678]#6352

Merged
GuyAv46 merged 11 commits intomasterfrom
guyav-refactor_optional_iterator_optimized
Jun 23, 2025
Merged

Refactor Optional Iterator Optimized mode - [MOD-9678]#6352
GuyAv46 merged 11 commits intomasterfrom
guyav-refactor_optional_iterator_optimized

Conversation

@GuyAv46
Copy link
Copy Markdown
Collaborator

@GuyAv46 GuyAv46 commented Jun 19, 2025

Describe the changes in the pull request

Implement the optimized variant of the optional iterator

Main objects this PR modified

  1. New implementation
  2. A few small fixes
  3. Implement new tests and benchmark cases
  4. Fix SkipToOld benchmark

Mark if applicable

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

@GuyAv46 GuyAv46 marked this pull request as draft June 19, 2025 12:12
@GuyAv46 GuyAv46 marked this pull request as ready for review June 19, 2025 13:45
@GuyAv46 GuyAv46 marked this pull request as draft June 19, 2025 13:45
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.89%. Comparing base (741f7cb) to head (30794e7).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6352      +/-   ##
==========================================
+ Coverage   88.84%   88.89%   +0.04%     
==========================================
  Files         247      247              
  Lines       41213    41340     +127     
  Branches     3483     3483              
==========================================
+ Hits        36617    36749     +132     
+ Misses       4553     4548       -5     
  Partials       43       43              
Flag Coverage Δ
flow 81.35% <0.00%> (-0.30%) ⬇️
unit 46.94% <100.00%> (+0.26%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@GuyAv46 GuyAv46 marked this pull request as ready for review June 20, 2025 07:03
@GuyAv46 GuyAv46 marked this pull request as draft June 20, 2025 07:03
@GuyAv46 GuyAv46 added the enforce:coverage Run coverage flow even on draft pull request label Jun 20, 2025
@GuyAv46 GuyAv46 marked this pull request as ready for review June 20, 2025 07:05
@GuyAv46 GuyAv46 marked this pull request as draft June 20, 2025 07:06
@GuyAv46 GuyAv46 added action:run-micro-benchmark and removed enforce:coverage Run coverage flow even on draft pull request labels Jun 20, 2025
@GuyAv46 GuyAv46 marked this pull request as ready for review June 20, 2025 17:09
@GuyAv46 GuyAv46 requested review from JoanFM and Copilot June 23, 2025 07:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the optional iterator implementation to support an optimized mode and updates its API by switching to a QueryEvalCtx parameter. Key changes include:

  • Updating the NewOptionalIterator API in both production and test code to pass a query context instead of discrete maxDocId/numDocs values.
  • Adding new tests and benchmark cases for the optimized iterator behavior, and adjusting expected values in timeout scenarios.
  • Minor fixes in the benchmark and auxiliary index utilities to support the refactoring.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/cpptests/test_cpp_iterator_optional.cpp Updated tests to pass QueryEvalCtx and revised expected behavior, e.g. lastDocId after timeout.
tests/cpptests/micro-benchmarks/benchmark_optional_iterator.cpp Adjusted benchmark parameters and initialization based on the new optimized flag.
tests/cpptests/index_utils.h Modified MockQueryEvalCtx constructor to optionally accept a document vector.
src/iterators/optional_iterator.h Updated the NewOptionalIterator API to accept a QueryEvalCtx and added a wildcard iterator field.
src/iterators/optional_iterator.c Refactored Read and SkipTo functions to incorporate the optimized behavior using the wildcard iterator.
Comments suppressed due to low confidence (1)

src/iterators/optional_iterator.h:22

  • [nitpick] The variable name 'wcii' is ambiguous; consider renaming it to 'wildcardIterator' for improved clarity.
  QueryIterator *wcii;    // wildcard child iterator, used for optimization

@GuyAv46 GuyAv46 added this pull request to the merge queue Jun 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 23, 2025
@GuyAv46 GuyAv46 added this pull request to the merge queue Jun 23, 2025
Merged via the queue into master with commit 2dfefe9 Jun 23, 2025
22 checks passed
@GuyAv46 GuyAv46 deleted the guyav-refactor_optional_iterator_optimized branch June 23, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants