Skip to content

feat(speculation): add selector + selection-limit extensions#317

Draft
behinddwalls wants to merge 1 commit into
preetam/ext/speculation-scorerfrom
preetam/ext/speculation-selector
Draft

feat(speculation): add selector + selection-limit extensions#317
behinddwalls wants to merge 1 commit into
preetam/ext/speculation-scorerfrom
preetam/ext/speculation-selector

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Add the selector seam and its limit counterpart from the speculation RFC, as vendor-agnostic extension interfaces under submitqueue/extension/speculation/.

selector: given a batch, loads its speculation tree (with controller-stamped status and score) from storage and returns a per-path action (Build/Cancel) for the paths it chooses to act on. It is the policy seam — it reads stored state and emits actions only, never writes status, and does not decide merging. The store is the source of truth: it takes only the batch identity and reads the tree through read access injected at its Factory, so the controller stays the single writer.

selectionlimit: the "how much" policy bounding how many paths a batch may build in parallel. It is the selector's companion — the selector decides which paths, the limit decides how many. Injected into the selector at construction and called by it, keeping the selector interface limit-free; the value is dynamic, not a fixed constant.

Each follows the repo extension contract: Factory.For(Config) (T, error) with Config carrying only QueueName. Includes READMEs, gomock packages, and programmable fakes. Interfaces 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 selector seam and its limit counterpart from the speculation RFC, as vendor-agnostic extension interfaces under submitqueue/extension/speculation/.

selector: given a batch, loads its speculation tree (with controller-stamped status and score) from storage and returns a per-path action (Build/Cancel) for the paths it chooses to act on. It is the policy seam — it reads stored state and emits actions only, never writes status, and does not decide merging. The store is the source of truth: it takes only the batch identity and reads the tree through read access injected at its Factory, so the controller stays the single writer.

selectionlimit: the "how much" policy bounding how many paths a batch may build in parallel. It is the selector's companion — the selector decides which paths, the limit decides how many. Injected into the selector at construction and called by it, keeping the selector interface limit-free; the value is dynamic, not a fixed constant.

Each follows the repo extension contract: Factory.For(Config) (T, error) with Config carrying only QueueName. Includes READMEs, gomock packages, and programmable fakes. Interfaces 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
@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-selector branch from 5e6a56f to e89bb7c 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