Skip to content

feat(orchestrator): compose per-queue speculators and turn speculation on - #508

Open
behinddwalls wants to merge 1 commit into
preetam/speculation-finalizationfrom
preetam/speculation-wiring
Open

feat(orchestrator): compose per-queue speculators and turn speculation on#508
behinddwalls wants to merge 1 commit into
preetam/speculation-finalizationfrom
preetam/speculation-wiring

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

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.

Stack

  1. feat(speculation): generator contract and bestfirst impl #446
  2. feat(speculation): allocator contract and sticky impl #450
  3. feat(speculation): standard composed speculator #451
  4. feat(storage): speculation path set store #501
  5. feat(storage): path-build link store for per-path builds #502
  6. feat(orchestrator): dispatch builds per speculation path #503
  7. feat(orchestrator): poll builds and stop the ones nothing wants #504
  8. fix(orchestrator): mint distinct message IDs for cancel re-publishes #505
  9. feat(orchestrator): re-plan the queue from the Speculator each run #506
  10. feat(orchestrator)!: finalize batches from their speculation paths #507
  11. @ feat(orchestrator): compose per-queue speculators and turn speculation on #508

…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
behinddwalls force-pushed the preetam/speculation-wiring branch from 74850fd to b3d4549 Compare August 4, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant