Skip to content

refactor(speculation): move the scorer in with the rest of speculation - #625

Merged
behinddwalls merged 1 commit into
mainfrom
preetam/scorer-under-speculation
Aug 25, 2026
Merged

refactor(speculation): move the scorer in with the rest of speculation#625
behinddwalls merged 1 commit into
mainfrom
preetam/scorer-under-speculation

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why?

The Speculator is composed from a generator, an allocator and a scorer, but only two of the three lived under submitqueue/extension/speculation/. The scorer sat at the top level as if it were a peer of storage or the change provider, which it is not: there is no scoring stage, and nothing outside the speculation generator has ever asked it for a price. The tree implied a seam that does not exist.

What?

submitqueue/extension/scorer/ becomes submitqueue/extension/speculation/scorer/, taking its contract, heuristic, composite, fake and mock with it. Import paths and BUILD files follow; no code changes.

The mocks Makefile target listed the old path explicitly. It is dropped rather than repointed, because the ./submitqueue/extension/speculation/... pattern already on that line now covers it.

Test Plan

bazel test //submitqueue/... //service/... — 53 tests pass
make gazelle — BUILD files regenerated
make mocks — unchanged output from the new path

Issues

@behinddwalls
behinddwalls marked this pull request as ready for review August 20, 2026 20:18
@behinddwalls
behinddwalls requested review from a team and sbalabanov as code owners August 20, 2026 20:19
@behinddwalls
behinddwalls force-pushed the preetam/scorer-under-speculation branch from 2971f2e to 3fae490 Compare August 24, 2026 19:14
@behinddwalls
behinddwalls marked this pull request as draft August 24, 2026 19:15
@behinddwalls
behinddwalls marked this pull request as ready for review August 24, 2026 19:26
## Summary

### Why?

The Speculator is composed from a generator, an allocator and a scorer, but only two of the three lived under `submitqueue/extension/speculation/`. The scorer sat at the top level as if it were a peer of storage or the change provider, which it is not: there is no scoring stage, and nothing outside the speculation generator has ever asked it for a price. The tree implied a seam that does not exist.

### What?

`submitqueue/extension/scorer/` becomes `submitqueue/extension/speculation/scorer/`, taking its contract, `heuristic`, `composite`, `fake` and `mock` with it. Import paths and BUILD files follow; no code changes.

The `mocks` Makefile target listed the old path explicitly. It is dropped rather than repointed, because the `./submitqueue/extension/speculation/...` pattern already on that line now covers it.

## Test Plan

✅ `bazel test //submitqueue/... //service/...` — 53 tests pass
✅ `make gazelle` — BUILD files regenerated
✅ `make mocks` — unchanged output from the new path

# Conflicts:
#	Makefile

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# interactive rebase in progress; onto c93310d
# Last command done (1 command done):
#    pick 3fae490 # refactor(speculation): move the scorer in with the rest of speculation
# No commands remaining.
# You are currently rebasing branch 'preetam/scorer-under-speculation' on 'c93310dd'.
#
# Changes to be committed:
#	modified:   Makefile
#	modified:   service/submitqueue/orchestrator/server/BUILD.bazel
#	modified:   service/submitqueue/orchestrator/server/profiles.go
#	modified:   service/submitqueue/orchestrator/server/profiles_test.go
#	modified:   submitqueue/extension/speculation/generator/bestfirst/BUILD.bazel
#	modified:   submitqueue/extension/speculation/generator/bestfirst/bestfirst.go
#	modified:   submitqueue/extension/speculation/generator/bestfirst/bestfirst_test.go
#	renamed:    submitqueue/extension/scorer/BUILD.bazel -> submitqueue/extension/speculation/scorer/BUILD.bazel
#	renamed:    submitqueue/extension/scorer/README.md -> submitqueue/extension/speculation/scorer/README.md
#	renamed:    submitqueue/extension/scorer/composite/BUILD.bazel -> submitqueue/extension/speculation/scorer/composite/BUILD.bazel
#	renamed:    submitqueue/extension/scorer/composite/scorer.go -> submitqueue/extension/speculation/scorer/composite/scorer.go
#	renamed:    submitqueue/extension/scorer/composite/scorer_test.go -> submitqueue/extension/speculation/scorer/composite/scorer_test.go
#	renamed:    submitqueue/extension/scorer/fake/BUILD.bazel -> submitqueue/extension/speculation/scorer/fake/BUILD.bazel
#	renamed:    submitqueue/extension/scorer/fake/fake.go -> submitqueue/extension/speculation/scorer/fake/fake.go
#	renamed:    submitqueue/extension/scorer/fake/fake_test.go -> submitqueue/extension/speculation/scorer/fake/fake_test.go
#	renamed:    submitqueue/extension/scorer/heuristic/BUILD.bazel -> submitqueue/extension/speculation/scorer/heuristic/BUILD.bazel
#	renamed:    submitqueue/extension/scorer/heuristic/scorer.go -> submitqueue/extension/speculation/scorer/heuristic/scorer.go
#	renamed:    submitqueue/extension/scorer/heuristic/scorer_test.go -> submitqueue/extension/speculation/scorer/heuristic/scorer_test.go
#	renamed:    submitqueue/extension/scorer/mock/BUILD.bazel -> submitqueue/extension/speculation/scorer/mock/BUILD.bazel
#	renamed:    submitqueue/extension/scorer/mock/scorer_mock.go -> submitqueue/extension/speculation/scorer/mock/scorer_mock.go
#	renamed:    submitqueue/extension/scorer/scorer.go -> submitqueue/extension/speculation/scorer/scorer.go
#
@behinddwalls
behinddwalls force-pushed the preetam/scorer-under-speculation branch from 3fae490 to c9c14c2 Compare August 25, 2026 21:52
@behinddwalls
behinddwalls added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 9292e3c Aug 25, 2026
15 checks passed
@behinddwalls
behinddwalls deployed to stack-rebase August 25, 2026 22:47 — with GitHub Actions Active
@behinddwalls
behinddwalls deleted the preetam/scorer-under-speculation branch August 25, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants