feat(orchestrator): compose per-queue speculators and turn speculation on - #508
Open
behinddwalls wants to merge 1 commit into
Open
feat(orchestrator): compose per-queue speculators and turn speculation on#508behinddwalls wants to merge 1 commit into
behinddwalls wants to merge 1 commit into
Conversation
behinddwalls
force-pushed
the
preetam/speculation-wiring
branch
from
August 4, 2026 04:46
628e4f8 to
74850fd
Compare
behinddwalls
marked this pull request as ready for review
August 4, 2026 04:47
This was referenced Aug 4, 2026
…n on ## Summary ### Why? Everything below this commit landed inert: the orchestrator passed the speculate run a placeholder that proposes nothing, so no path was ever funded and no speculative build started. The machinery is all reviewed; nothing configures it per queue or switches it on. ### What? This is the activation switch. Per-queue profiles gain a `Scorer` and a `Speculator`: each queue's speculator is composed from its own scorer as `standard.New(bestfirst.New(scorer), sticky.New(budget))`, with a factory adapter beside the existing ones so routing stays in the wiring layer, and `main.go` swaps the placeholder for `profiles.SpeculatorFactory()`. The scorer profiles are the policy knobs: the baseline scores everything 0.5, test-queue buckets by lines changed, and e2e-test-queue exercises the composite scorer. Every scorer is wrapped by `scorerfake` so a change URI carrying a failure marker forces a scoring error end-to-end. The build budget is a wiring-level constant (4 concurrent builds per queue) with a TODO to move it onto `entity.QueueConfig`. With this commit, paths are funded, builds run per path, and batches finalize from their paths — the whole stack goes live in one revertable step. ## Test Plan ✅ `bazel build //...`, `make fmt`, `make gazelle` ✅ `make e2e-test` — the full pipeline lands changes end-to-end with per-path speculation on.
behinddwalls
force-pushed
the
preetam/speculation-wiring
branch
from
August 4, 2026 05:11
74850fd to
b3d4549
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?
Everything below this commit landed inert: the orchestrator passed the speculate run a placeholder that proposes nothing, so no path was ever funded and no speculative build started. The machinery is all reviewed; nothing configures it per queue or switches it on.
What?
This is the activation switch. Per-queue profiles gain a
Scorerand aSpeculator: each queue's speculator is composed from its own scorer asstandard.New(bestfirst.New(scorer), sticky.New(budget)), with a factory adapter beside the existing ones so routing stays in the wiring layer, andmain.goswaps the placeholder forprofiles.SpeculatorFactory().The scorer profiles are the policy knobs: the baseline scores everything 0.5, test-queue buckets by lines changed, and e2e-test-queue exercises the composite scorer. Every scorer is wrapped by
scorerfakeso a change URI carrying a failure marker forces a scoring error end-to-end. The build budget is a wiring-level constant (4 concurrent builds per queue) with a TODO to move it ontoentity.QueueConfig.With this commit, paths are funded, builds run per path, and batches finalize from their paths — the whole stack goes live in one revertable step.
Test Plan
✅
bazel build //...,make fmt,make gazelle✅
make e2e-test— the full pipeline lands changes end-to-end with per-path speculation on.Stack