Skip to content

feat(speculate): bypass unsettled deps on full passed coverage - #656

Merged
behinddwalls merged 2 commits into
mainfrom
blrd
Sep 1, 2026
Merged

feat(speculate): bypass unsettled deps on full passed coverage#656
behinddwalls merged 2 commits into
mainfrom
blrd

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why?

A batch's merge used to wait for every dependency to resolve even when its passed builds already covered every way those dependencies could turn out. That made a small change sit behind a slow one for no reason: both the with- and without-dependency trees were validated, so whichever future arrives is already green.

What?

Adds bypassablePath to the speculate controller: decide() merges a head once passed, unbroken, well-formed paths cover every 2^n combination of its unsettled dependencies. Settled dependencies still pin each path to reality through assumptionBroken. Finalize prefers a strict mergeable path and falls back to bypass coverage, superseding siblings either way.

Tightened isWellFormed to require dependencies in the head's canonical order, and read the coverage signature positionally off the slice (dropping the per-path map). Order is load-bearing: Base() projects the path positionally, so a permuted path is a different stack, and a reordered path can no longer masquerade as coverage for the canonical combination.

The NoBypassWhenCoverageIsIncomplete e2e test asserts ordering (follower lands only after the lead) rather than the racy intermediate speculating state: waiting is a recorded history event, and once the ungated lead lands the seeded path is strictly mergeable — the old assertion raced the queue and flaked on fast runners.

Test Plan

  • ./tool/bazel test //submitqueue/orchestrator/controller/speculate:go_default_test
  • ./tool/bazel test //submitqueue/extension/speculation/... //submitqueue/entity:go_default_test //submitqueue/orchestrator/controller/build:go_default_test
  • New TestBypassablePath "does not count a reordered path" and TestIsWellFormed "dependencies out of queue order" fail before, pass after.
  • Four bypass E2E tests pass (BypassedHeadLandsFirst, BypassesMergingDependency, NoBypassWhenCoverageIsIncomplete, BypassesAnUnresolvedDependency); full e2e suite green twice locally.

@behinddwalls
behinddwalls marked this pull request as ready for review August 31, 2026 20:41
@behinddwalls
behinddwalls requested review from a team and sbalabanov as code owners August 31, 2026 20:41
## Summary

### Why?

A batch's merge used to wait for every dependency to resolve even when its passed builds already covered every way those dependencies could turn out. That made a small change sit behind a slow one for no reason: both the with- and without-dependency trees were validated, so whichever future arrives is already green.

### What?

Adds bypassablePath to the speculate controller: decide() merges a head once passed, unbroken, well-formed paths cover every 2^n combination of its unsettled dependencies. Settled dependencies still pin each path to reality through assumptionBroken. Finalize prefers a strict mergeable path and falls back to bypass coverage, superseding siblings either way.

Tightened isWellFormed to require dependencies in the head's canonical order, and read the coverage signature positionally off the slice (dropping the per-path map). Order is load-bearing: Base() projects the path positionally, so a permuted path is a different stack, and a reordered path can no longer masquerade as coverage for the canonical combination.

The NoBypassWhenCoverageIsIncomplete e2e test asserts ordering (follower lands only after the lead) rather than the racy intermediate speculating state: waiting is a recorded history event, and once the ungated lead lands the seeded path is strictly mergeable — the old assertion raced the queue and flaked on fast runners.

## Test Plan

- ./tool/bazel test //submitqueue/orchestrator/controller/speculate:go_default_test
- ./tool/bazel test //submitqueue/extension/speculation/... //submitqueue/entity:go_default_test //submitqueue/orchestrator/controller/build:go_default_test
- New TestBypassablePath "does not count a reordered path" and TestIsWellFormed "dependencies out of queue order" fail before, pass after.
- Four bypass E2E tests pass (BypassedHeadLandsFirst, BypassesMergingDependency, NoBypassWhenCoverageIsIncomplete, BypassesAnUnresolvedDependency); full e2e suite green twice locally.
@behinddwalls
behinddwalls added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit 67829de Sep 1, 2026
15 checks passed
@behinddwalls
behinddwalls deleted the blrd branch September 1, 2026 16:09
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