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

@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 628e4f8 to 74850fd Compare August 4, 2026 04:46
@behinddwalls
behinddwalls force-pushed the preetam/speculation-finalization branch from dfb687a to 2b97a64 Compare August 4, 2026 04:46
@behinddwalls
behinddwalls marked this pull request as ready for review August 4, 2026 04:47
@behinddwalls
behinddwalls requested review from a team and sbalabanov as code owners August 4, 2026 04:47
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 74850fd to b3d4549 Compare August 4, 2026 05:11
@behinddwalls
behinddwalls force-pushed the preetam/speculation-finalization branch 2 times, most recently from 93573ae to 1492c63 Compare August 5, 2026 03:15
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from b3d4549 to 2eaab0e Compare August 5, 2026 03:15
@behinddwalls
behinddwalls force-pushed the preetam/speculation-finalization branch from 1492c63 to 23b4741 Compare August 5, 2026 03:26
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 2eaab0e to 563a58d Compare August 5, 2026 03:26
@behinddwalls
behinddwalls force-pushed the preetam/speculation-finalization branch from 23b4741 to 88bb6b3 Compare August 5, 2026 03:38
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 563a58d to 98c0912 Compare August 5, 2026 03:38
@behinddwalls
behinddwalls force-pushed the preetam/speculation-finalization branch from 88bb6b3 to d9beb4d Compare August 5, 2026 03:44
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 98c0912 to bc71c77 Compare August 5, 2026 03:44
@behinddwalls
behinddwalls force-pushed the preetam/speculation-finalization branch from d9beb4d to 42b8e81 Compare August 5, 2026 04:12
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch 2 times, most recently from e8fdda1 to 00a94c1 Compare August 5, 2026 04:57
@behinddwalls
behinddwalls force-pushed the preetam/speculation-finalization branch from 42b8e81 to 26ae2d9 Compare August 5, 2026 04:57
…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-finalization branch from 4462c89 to 7737f77 Compare August 5, 2026 17:28
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 8aba69e to 6f58c6a Compare August 5, 2026 17:28
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