Repository navigation
[MOD-17681] UnionTrimmed: refuse suspend/resume - #10893
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e2c946a92
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10893 +/- ##
==========================================
- Coverage 83.16% 82.19% -0.97%
==========================================
Files 606 635 +29
Lines 80987 82293 +1306
Branches 36248 37505 +1257
==========================================
+ Hits 67350 67639 +289
- Misses 13290 14307 +1017
Partials 347 347
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ransitions for UnionTrimmed
1e2c946 to
238882e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 238882e892
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| unreachable!( | ||
| "suspend is not supported on UnionTrimmed — trimmed unions are not subject to GC" | ||
| ); |
There was a problem hiding this comment.
Implement the advertised suspend transition
When a composite parent suspends a child slot containing UnionTrimmed, this implementation unconditionally panics instead of returning the Suspended type promised by RQEIteratorBoxed, making the newly advertised capability unusable and aborting that operation. Unlike the previously reviewed implementation, the current diff has replaced the unsafe child conversion with this unconditional panic; implement the transition for every owned child, including children outside the active trim window, rather than codifying the failure in suspend_panics.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
That'd be useless, since resume panics unconditionally, as revalidate used to do.
| fn suspend(self: Box<Self>) -> Box<Self::Suspended> { | ||
| // Unreachable for the reason `RQEIterator::revalidate` documents: the | ||
| // partial-range pipeline never releases the spec read lock underneath a | ||
| // trimmed union. A trimmed union is also always the *root* iterator — |
There was a problem hiding this comment.
Technically if wrapped by Profile then it's not longer the root iterator.
There was a problem hiding this comment.
True, but semantically I'd say this stands, no?
There was a problem hiding this comment.
Yes, I think so, the logic is sound.
|



Describe the changes in the pull request
UnionTrimmedis the one iterator whoserevalidatepanics — trimmed unions are only built for the partial-range (numericSORTBY) optimization, whose pipeline drains all upstream results inside a single lockedsendChunkcall, so the spec read lock is never released underneath one. It has no place in the suspend/resume hierarchy yet.resumecannot be implemented at all: a trimmed union yields documents out of doc-id order and itsskip_topanics, so there is no position to re-derive after the children move. With no resume, suspending would only manufacture a state nothing can consume — sosuspendpanics too, at the call that requested the unsupported transition rather than one lock cycle later. A trimmed union is also always the root iterator (QOptimizer_Iteratorsonly trims when the AST root is a numeric node whose iterator is the union itself), so no composite parent has to transition it as a child slot either.UnionTrimmednow satisfies theRQEIteratorBoxedbound that suspendable parents are generic over, without pretending to support a cycle it cannot complete.Which additional issues this PR fixes
Main objects this PR modified
UnionTrimmed::suspend— panics, mirroring the existingrevalidate. The comment carries the two independent reasons (never suspended in practice; nothing could be done with the result) and defers the pipeline argument torevalidate, which owns it.RawUnionTrimmed<Suspended, _>'sRQESuspendedIteratorimpl — kept only to name a type satisfyingRQEIteratorBoxed::Suspended's bound; no value of it can be built, soresumepanics and the two accessors stay plain field reads.constlayout-invariant proof and nounsafe: with neither transition reinterpreting an allocation, there is no cast whose soundness a proof would guard.tests/integration/union_trimmed.rs— onesuspend_panicstest over type-erased children (the shape production hands the union) replaces the suspend round-trip, child-window, box-address, and suspended-accessor tests.resume's panic is not reachable from any value the crate can build, so it is untestable by construction.Mark if applicable
Release Notes