Sort submissions by metadata count - #164
Open
jerbaroo wants to merge 17 commits into
Open
Conversation
Separate chunk/submission selection
Support random submission selection
Add assert_streaming_chunks
No explicit destructor call
Call the metadata count FFI function
Avoid duplicate MATERIALIZE
There was a problem hiding this comment.
Pull request overview
Moves PreferDistinct selection from chunk scans to metadata-ranked submission selection with indexed chunk lookup.
Changes:
- Ranks submissions using reservation metadata exposed through SQLite FFI.
- Adds submission random-order indexing and simplifies metastate tracking.
- Adds fairness and reservation-filtering tests.
Reviewed changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
workspace-hack/Cargo.toml |
Updates generated dependency features. |
opsqueue/src/consumer/strategy.rs |
Reworks strategy query generation. |
opsqueue/src/consumer/dispatcher/reserver.rs |
Exposes reservation lookup. |
opsqueue/src/consumer/dispatcher/mod.rs |
Registers SQLite FFI callbacks. |
opsqueue/src/consumer/dispatcher/metastate.rs |
Simplifies counts and adds JSON export. |
opsqueue/src/common/submission.rs |
Reuses one SQL parameter. |
opsqueue/src/common/chunk.rs |
Adds signed chunk-index conversion. |
opsqueue/migrations/20260803133844_add_random_order_index_to_submissions.up.sql |
Adds submission random ordering. |
opsqueue/migrations/20260803133844_add_random_order_index_to_submissions.down.sql |
Reverts submission random ordering. |
opsqueue/Cargo.toml |
Adds SQLite FFI dependency. |
libs/opsqueue_python/tests/test_roundtrip.py |
Tests PreferDistinct fairness. |
Cargo.toml |
Defines the workspace SQLite dependency. |
Cargo.lock |
Updates resolved dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jerbaroo
force-pushed
the
jerbaroo-faster-prefer-distinct
branch
from
August 10, 2026 14:44
735f40b to
525fbdf
Compare
jerbaroo
force-pushed
the
jerbaroo-faster-prefer-distinct
branch
from
August 10, 2026 15:04
525fbdf to
4887d3d
Compare
Fix comment in migration file
jerbaroo
marked this pull request as ready for review
August 10, 2026 15:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes changes to how the chunk selection query of the
PreferDistinctstrategy. In the Files changed tab, you can see the impact on the benchmark SVG .Key changes: