Skip to content

feat(speculation): add path scorer extension#316

Draft
behinddwalls wants to merge 1 commit into
preetam/ext/speculation-enumeratorfrom
preetam/ext/speculation-scorer
Draft

feat(speculation): add path scorer extension#316
behinddwalls wants to merge 1 commit into
preetam/ext/speculation-enumeratorfrom
preetam/ext/speculation-scorer

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Add the scorer seam from the speculation RFC, as a vendor-agnostic extension interface under submitqueue/extension/speculation/scorer/.

The scorer computes each speculation path's predicted-success score from the current state: the per-batch scores of the path's base batches (entity.Batch.Score) and which of those dependencies have resolved (landed or build-passed), plus optionally other signals. It is a prediction over live state, so the controller re-runs it on every respeculate right after reconciling status, and persists the result; the scorer owns only the formula.

The store is the source of truth: the scorer takes only the batch identity and loads what it needs — the batch's speculation tree (with controller-reconciled statuses) and its dependency batches — through read access injected at its Factory. It returns the scored tree; the controller persists the scores, staying the single writer of tree state.

This is the per-path scorer, distinct from the existing per-batch score stage (extension/scorer) that sets entity.Batch.Score — the path scorer consumes those to score whole paths.

Follows the repo extension contract: Factory.For(Config) (Scorer, error) with Config carrying only QueueName. Includes README, gomock package, and a programmable fake. Interface only; concrete impls and controller wiring are deferred.

Stack

  1. feat(entity,storage): rework speculation tree model and store #231
  2. feat(speculation): add enumerator + dependency-limit extensions #315
  3. @ feat(speculation): add path scorer extension #316
  4. feat(speculation): add selector + selection-limit extensions #317
  5. feat(prioritization): add prioritizer + prioritization-limit extensions #318

Add the scorer seam from the speculation RFC, as a vendor-agnostic extension interface under submitqueue/extension/speculation/scorer/.

The scorer computes each speculation path's predicted-success score from the current state: the per-batch scores of the path's base batches (entity.Batch.Score) and which of those dependencies have resolved (landed or build-passed), plus optionally other signals. It is a prediction over live state, so the controller re-runs it on every respeculate right after reconciling status, and persists the result; the scorer owns only the formula.

The store is the source of truth: the scorer takes only the batch identity and loads what it needs — the batch's speculation tree (with controller-reconciled statuses) and its dependency batches — through read access injected at its Factory. It returns the scored tree; the controller persists the scores, staying the single writer of tree state.

This is the per-path scorer, distinct from the existing per-batch score stage (extension/scorer) that sets entity.Batch.Score — the path scorer consumes those to score whole paths.

Follows the repo extension contract: Factory.For(Config) (Scorer, error) with Config carrying only QueueName. Includes README, gomock package, and a programmable fake. Interface only; concrete impls and controller wiring are deferred.
@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-scorer branch from 4e8b0ba to 86f877f Compare July 8, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant