Skip to content

docs(rfc): add speculation design#230

Merged
behinddwalls merged 2 commits into
mainfrom
preetam/ext/speculation-rfc
Jul 7, 2026
Merged

docs(rfc): add speculation design#230
behinddwalls merged 2 commits into
mainfrom
preetam/ext/speculation-rfc

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Capture how SubmitQueue speculates before the interfaces land. Speculation is modeled as two layers: decision seams — enumeration and scoring describe the tree of possible bets, selection and prioritization act on it — and signal-driven limit policies that decide how much to allow at each step (dependency limit, selection limit, prioritization limit), scaling with the build system's resources. A path's score is dynamic — recomputed as dependencies land, fail, or have their builds pass — not frozen at enumeration.

Covers: the problem (dependent batches serialize behind multi-minute builds), the Base/Head path-and-tree model, where speculation sits in the orchestrator pipeline, the status-vs-action ownership split, the dependency limit as an eligibility gate (batches wait for predecessors to land rather than trimming their base), dynamic rescoring, and how prioritization rations the queue's builds against its budget.

Design only; entities, store, and extension interfaces follow in later PRs in this stack. Adds doc/rfc/submitqueue/speculation.md and links it from the RFC index.

Changes since review

Reframed from two seams (enumeration + selection) to describe/act decisions + limits, addressing @sbalabanov's review:

  • selector resource-awareness → the new prioritization layer owns the queue-wide build budget; the selector stays a pure per-batch policy
  • "variable depth, not a single knob" → the dependency limit is a signal-driven policy, not a constant
  • clarified the dependency limit is an eligibility gate on active in-flight dependencies (a batch waits until predecessors land), not a base trim
  • dynamic scoring: split scoring out of enumeration into a scorer that recomputes each path's score as dependencies land/fail/pass — enumeration is now structure-only
  • entire tree persisted (the selector reads all path statuses + scores, so it can cancel a path it earlier asked to build); the redundant fallback path is cancelled on a winning bet; slash-free example names; trimmed impl-detail bullets
  • recorded as open: extending rescoring to weigh how long a batch has waited

Test Plan

Doc-only. Rendered locally; ASCII diagrams and tables verified; no hard-wrapped prose.

Issues

Stack

  1. @ docs(rfc): add speculation design #230
  2. feat(entity,storage): rework speculation tree model and store #231
  3. feat(speculation): add enumerator and selector extensions #232

Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-rfc branch from 67da1e9 to 0ee54c9 Compare June 11, 2026 03:28

@sbalabanov sbalabanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sending it back as it is quite old, resubmit if needed

@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-rfc branch from 0ee54c9 to eb56b8f Compare July 7, 2026 22:05
@behinddwalls

Copy link
Copy Markdown
Collaborator Author

Reworked and resubmitting. Reframed the design around three decisions (enumeration, selection, prioritization) + three signal-driven limit policies (dependency / selection / prioritization limit) that scale with build resources.

Addresses all review comments:

  • Selector resource-awareness — the new prioritization layer is the queue-wide enforcer that rations builds against the queue's budget; the selector stays a pure per-batch policy, with its SelectionLimit injected and called internally.
  • Variable depth, not one knob — the dependency limit is a signal-driven policy, not a constant.
  • What depth means — clarified it's an eligibility gate on active in-flight dependencies (a batch waits until predecessors land), not a base trim; added a gating-by-example.
  • Store all paths? — yes, the controller persists the entire tree; the selector reads every path's status and can cancel one it earlier asked to build.
  • Redundant fallback cancelled on a winning bet; slash-free example names; leaf-only target validation kept prominent; impl-detail bullets trimmed.
  • Open item recorded: rescoring a batch the longer it waits queued.

PTAL @sbalabanov

@behinddwalls behinddwalls requested a review from sbalabanov July 7, 2026 22:05
@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-rfc branch 3 times, most recently from c6eceaa to 3053dd4 Compare July 7, 2026 22:28
Comment thread doc/rfc/submitqueue/speculation.md
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Comment thread doc/rfc/submitqueue/speculation.md Outdated
Capture how SubmitQueue speculates before the interfaces land: the problem (dependent batches serialize behind multi-minute builds), the Base/Head path-and-tree model, where speculation sits in the orchestrator pipeline, and the two pluggable seams it splits into — tree enumeration and path selection. Also records the status-vs-action ownership split and speculation depth.

Design only; the entities, store, and extension interfaces follow in later PRs in this stack. Adds doc/rfc/submitqueue/speculation.md and links it from the RFC index.
@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-rfc branch from 3053dd4 to 58cabeb Compare July 7, 2026 22:43
@behinddwalls behinddwalls merged commit e1b7c7b into main Jul 7, 2026
3 checks passed
@behinddwalls behinddwalls deleted the preetam/ext/speculation-rfc branch July 8, 2026 15:22
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.

2 participants