docs(rfc): queue-scoped speculation design#413
Open
behinddwalls wants to merge 1 commit into
Open
Conversation
## Summary ### Why? A merge queue that verifies one change at a time is bounded by its slowest build. Speculation pipelines it — building a batch early against a guess at how its unresolved dependencies will resolve, so a matching build is already done when reality settles. Doing that correctly on an eventually consistent, transactionless substrate needs a real design: how futures are represented, which ones build under a bounded CI budget, what is persisted, and where each decision lives. ### What? This RFC designs speculation for SubmitQueue end to end. Every queue change runs a pass: read the current facts, apply fixed rules, ask one pluggable extension which paths to build, and write the result. Only chosen paths are persisted (a path set per head, each chosen path keyed by a content hash so crash recovery is idempotent); the rest are recomputed each pass, never stored. The one extension — the Speculator — decides which paths to build and which running ones to preempt; verdicts (merge/fail/cancel) and refutation cancels stay controller rules, so a swapped-in extension can never merge or fail a batch. The default Speculator composes three per-queue tuning interfaces: PathScorer (prices a path as the product of its dependencies' landing chances), Generator (a lazy best-first candidate stream per head that caps its own planning depth), and Allocator (spends the build budget across heads under a score floor and settles in-flight paths by ID). This fills the previously empty doc/rfc/submitqueue/speculation.md.
behinddwalls
force-pushed
the
speculation-rfc
branch
from
July 21, 2026 19:39
502e96e to
e0ac903
Compare
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?
A merge queue that verifies one change at a time is bounded by its slowest build. Speculation pipelines it — building a batch early against a guess at how its unresolved dependencies will resolve, so a matching build is already done when reality settles. Doing that correctly on an eventually consistent, transactionless substrate needs a real design: how futures are represented, which ones build under a bounded CI budget, what is persisted, and where each decision lives.
What?
This RFC designs speculation for SubmitQueue end to end. Every queue change runs a pass: read the current facts, apply fixed rules, ask one pluggable extension which paths to build, and write the result. Only chosen paths are persisted (a path set per head, each chosen path keyed by a content hash so crash recovery is idempotent); the rest are recomputed each pass, never stored. The one extension — the Speculator — decides which paths to build and which running ones to preempt; verdicts (merge/fail/cancel) and refutation cancels stay controller rules, so a swapped-in extension can never merge or fail a batch. The default Speculator composes three per-queue tuning interfaces: PathScorer (prices a path as the product of its dependencies' landing chances), Generator (a lazy best-first candidate stream per head that caps its own planning depth), and Allocator (spends the build budget across heads under a score floor and settles in-flight paths by ID).
This fills the previously empty doc/rfc/submitqueue/speculation.md.