feat(speculation): standard composed speculator - #451
Open
behinddwalls wants to merge 1 commit into
Open
Conversation
Add submitqueue/extension/speculation/speculator/standard, the standard Speculator composed from a Generator and an Allocator. It decides nothing itself — it opens the generator's candidate stream and hands it to the allocator — so its behavior is entirely that of the two parts it is built from. Pairing bestfirst with sticky yields the default speculation policy.
This was referenced Jul 28, 2026
behinddwalls
marked this pull request as ready for review
July 28, 2026 20:03
sbalabanov
approved these changes
Jul 28, 2026
|
|
||
| Like the other extensions, a `Speculator` is selected **per queue** by the wiring layer through the `Config` (queue name) and `Factory` interface. Budget, depth bound, clock, and any extra data are injected at construction by the integrator, not carried on the contract. | ||
|
|
||
| ## The `standard` Speculator |
Contributor
There was a problem hiding this comment.
move to "standard"'s README
The description should say not how it is composed, but what it does (what behavior it implements wrt prioritizing paths and working with build budget).
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.
Summary
Why?
The three branches below this one define the pieces: the
Speculatorcontract (#445), aGeneratorthat ranks candidate paths (#446), and anAllocatorthat spends the build budget on them (#450). This one joins them up.Keeping the composition in its own implementation means a queue can change how paths are scored, or how the budget is rationed, independently — and without either choice reaching the
Speculatorcontract the controller depends on.What?
Adds
submitqueue/extension/speculation/speculator/standard.Speculateopens the generator over the queue's batches and path sets, then hands the resulting candidate iterator to the allocator. That is the whole implementation: it makes no decision of its own, so its behavior is entirely the behavior of the two parts it is built from. Pairingbestfirstwithstickygives the default policy — rank paths by how likely their guesses are to hold, fill the free budget in that order, never preempt a running build.Also adds a note to the
speculatorpackageREADME.mddescribing the composition.Test Plan
✅
bazel test //submitqueue/extension/speculation/...(3 targets),make lint,make check-gazelleOne end-to-end test wires the real
bestfirstandstickytogether and checks the pair proposes only builds, and that the funded path for a dependent batch is the optimistic guess. Two mock-based tests cover the wiring itself: that the iterator the generator returns is the one handed to the allocator, and that a generator error propagates rather than being swallowed.Note the commit also updates a
sticky.Newcall site for the logger argument added in #450 — the signature change landed there, and this is the only caller.Stack