feat(speculation): fold predictor into Scorer - #683
Open
behinddwalls wants to merge 5 commits into
Open
Conversation
behinddwalls
force-pushed
the
preetam/outcome-predictor
branch
from
September 7, 2026 23:52
c1143a8 to
3ebd06c
Compare
behinddwalls
force-pushed
the
preetam/outcome-predictor
branch
from
September 7, 2026 23:54
3ebd06c to
e3dbe23
Compare
behinddwalls
force-pushed
the
preetam/outcome-predictor
branch
2 times, most recently
from
September 8, 2026 00:51
c8114ac to
ecd4305
Compare
behinddwalls
force-pushed
the
preetam/outcome-predictor
branch
from
September 8, 2026 00:57
ecd4305 to
1068958
Compare
behinddwalls
marked this pull request as ready for review
September 8, 2026 01:09
## Summary ### Why? A scorer prices change content, but speculation also needs a separate contract for revising that price with evidence observed during a run. Keeping the concerns separate avoids adding path data that every content scorer would discard. ### What? Add the `predictor.Predictor` contract and an evidence implementation that converts the scorer probability to odds, applies factors for passed and failed all-succeed paths plus merging and cancelling states, and converts the result back to a probability. Include generated mocks and unit coverage for neutral factors, compounding evidence, path filtering, bounds, validation, and scorer failures. ## Test Plan - `bazel test //submitqueue/extension/speculation/predictor/...` - `make check-gazelle`
## Summary ### Why? The evidence implementation still described the model as logistic regression over odds and referenced fitting work that the RFC no longer proposes. That made the code's vocabulary diverge from the factor contract exposed to operators. ### What? Combine the applicable evidence factors first and revise the scorer price with the equivalent bounded formula. Remove stale fitting rationale and keep implementation and tests in the RFC's scorer-price and factor terminology without changing behavior. ## Test Plan - ✅ `./tool/bazel test //submitqueue/extension/speculation/predictor/...`
## Summary ### Why? Neutral prediction changed exact scorer prices at 0 and 1, non-finite factors could create certainty, and failed-path compounding relied on duplicate logical paths that a valid path set cannot contain. ### What? Return the scorer price unchanged for a neutral combined factor, reject non-finite configured factors, keep revised outputs strictly inside the probability range, and apply failed all-succeeds evidence at most once. Extend tests for exact endpoints, large factors, and infinite-factor rejection. ## Test Plan - ✅ `./tool/bazel test //submitqueue/extension/speculation/predictor/...`
Add the predictor package guide and clarify how it composes over the scorer without adding path evidence to the scorer contract.
Score takes the path-set snapshot. Evidence is a scorer wrapping a base; heuristic and composite ignore paths. Delete the sibling Predictor factory.
behinddwalls
force-pushed
the
preetam/outcome-predictor
branch
from
September 11, 2026 16:47
1068958 to
0ff6ea7
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?
The RFC now has one public ranking interface. Keeping a Predictor package after that would leave a second factory the rest of the stack still had to delete.
What?
Widen
Scorer.Scorewith the path-set snapshot. Move evidence underscorer/evidenceas a Scorer wrapping a base. Heuristic, composite, and fake implement the same signature and ignorepaths(composite forwards them). Delete the Predictor package and its mocks.Test Plan
make mocks && make gazelle./tool/bazel test //submitqueue/extension/speculation/scorer/... //submitqueue/extension/speculation/generator/bestfirst:go_default_test //submitqueue/extension/speculation/speculator/standard:go_default_testIssues