feat(speculation): add outcome predictor implementation - #683
Open
behinddwalls wants to merge 4 commits into
Open
feat(speculation): add outcome predictor implementation#683behinddwalls wants to merge 4 commits into
behinddwalls wants to merge 4 commits into
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
## 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.
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
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?
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.Predictorcontract and an evidence implementation that combines factors for the passed or failed all-succeeds path plus merging and cancelling states, then revises the scorer's price while keeping the result a probability. Neutral factors preserve the scorer price exactly, including0and1; non-finite factors are rejected; revised results remain strictly between the endpoints. Add the predictor package guide and clarify its relationship to the scorer.Test Plan
./tool/bazel test //submitqueue/extension/speculation/predictor/...make check-gazelleIssues
Stack