feat(entity): speculation path and run entities - #444
Open
behinddwalls wants to merge 1 commit into
Open
Conversation
behinddwalls
marked this pull request as ready for review
July 27, 2026 17:36
behinddwalls
force-pushed
the
preetam/speculation-entities
branch
from
July 27, 2026 18:02
4c78ae2 to
e178f70
Compare
behinddwalls
marked this pull request as draft
July 27, 2026 18:05
behinddwalls
marked this pull request as ready for review
July 27, 2026 19:00
behinddwalls
marked this pull request as draft
July 27, 2026 20:45
behinddwalls
marked this pull request as ready for review
July 27, 2026 23:17
Add the speculation domain model in submitqueue/entity/speculation.go: SpeculationPath (keyed by a content hash), DependencyBet/DependencyBetType, SpeculationPathStatus, SpeculationPathEntry, and SpeculationPathSet, plus the run vocabulary PathAction/Speculation/CandidatePath. Enums are iota-based and every type round-trips through ToBytes/FromBytes; covered by table tests. No storage and no wiring — these are the entities the speculation extension and controller build on.
behinddwalls
force-pushed
the
preetam/speculation-entities
branch
from
July 27, 2026 23:18
e178f70 to
f905059
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why?
Queue-scoped speculation (#413) needs a shared vocabulary before the extension, generator, allocator, and controller can be built against it. Landing it on its own keeps it reviewable and gives the rest of the stack a fixed base.
What?
Adds the speculation domain model in
submitqueue/entity/speculation.go.Stored:
SpeculationPath— a head batch plus one bet per dependency, in queue order.ID()hashes the head and its ordered bets, so identical paths share an ID.DependencyBet/DependencyBetType—included,excluded, ordropped(ignored by conflict relaxation).SpeculationPathStatus—pending,building,passed,failed,cancelling,cancelled.IsTerminal()excludescancelling: a build being cancelled may still reachpassedorfailed.SpeculationPathEntry— keyed by the content hash. No build reference, no score: an execution is(ID, Attempt), and a score only means something within one run.SpeculationPathSet— one head's paths under a single version, live and recently finished.Transient, never stored:
PathAction(buildorcancelonly — a verdict is a controller fact, not a proposal),Speculation,CandidatePath.The three stored types round-trip through
ToBytes/FromBytes. Enums are string-valued with""sentinels. No storage and no wiring.Test Plan
✅
bazel test //submitqueue/entity/...Table tests cover
ID()determinism and its sensitivity to head, dependency, bet, and bet order;IsTerminal()across every status; and JSON round-trips plus invalid and empty input for eachFromBytes.Stack