Commit f951c03
feat(orchestrator): compose per-queue speculators and turn speculation on
## Summary
### Why?
Everything below this commit landed inert: the orchestrator passed the speculate run a placeholder that proposes nothing, so no path was ever funded and no speculative build started. The machinery is all reviewed; nothing configures it per queue or switches it on.
### What?
This is the activation switch. Per-queue profiles gain a `Scorer` and a `Speculator`: each queue's speculator is composed from its own scorer as `standard.New(bestfirst.New(scorer), sticky.New(budget))`, with a factory adapter beside the existing ones so routing stays in the wiring layer, and `main.go` swaps the placeholder for `profiles.SpeculatorFactory()`.
The scorer profiles are the policy knobs: the baseline scores everything 0.5, test-queue buckets by lines changed, and e2e-test-queue exercises the composite scorer. Every scorer is wrapped by `scorerfake` so a change URI carrying a failure marker forces a scoring error end-to-end. The build budget is a wiring-level constant (4 concurrent builds per queue) with a TODO to move it onto `entity.QueueConfig`.
With this commit, paths are funded, builds run per path, and batches finalize from their paths — the whole stack goes live in one revertable step.
## Test Plan
✅ `bazel build //...`, `make fmt`, `make gazelle`
✅ `make e2e-test` — the full pipeline lands changes end-to-end with per-path speculation on.
# Conflicts:
# service/submitqueue/orchestrator/server/BUILD.bazel
# service/submitqueue/orchestrator/server/main.go
# service/submitqueue/orchestrator/server/profiles.go
# 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 093e285d
# Last command done (1 command done):
# pick 286ddbc # feat(orchestrator): compose per-queue speculators and turn speculation on
# No commands remaining.
# You are currently rebasing branch 'preetam/speculation-wiring' on '093e285d'.
#
# Changes to be committed:
# modified: service/submitqueue/orchestrator/server/BUILD.bazel
# modified: service/submitqueue/orchestrator/server/main.go
# modified: service/submitqueue/orchestrator/server/profiles.go
#
# Conflicts:
# service/submitqueue/orchestrator/server/BUILD.bazel
# 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 cecd16c9
# Last command done (1 command done):
# pick 65b92953 # feat(orchestrator): compose per-queue speculators and turn speculation on
# No commands remaining.
# You are currently rebasing branch 'preetam/speculation-wiring' on 'cecd16c9'.
#
# Changes to be committed:
# modified: service/submitqueue/orchestrator/server/BUILD.bazel
# modified: service/submitqueue/orchestrator/server/main.go
# modified: service/submitqueue/orchestrator/server/profiles.go
#
# Conflicts:
# service/submitqueue/orchestrator/server/main.go
# 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 b374994
# Last command done (1 command done):
# pick 85147a6 # feat(orchestrator): compose per-queue speculators and turn speculation on
# No commands remaining.
# You are currently rebasing branch 'preetam/speculation-wiring' on 'b3749949'.
#
# Changes to be committed:
# modified: service/submitqueue/orchestrator/server/BUILD.bazel
# modified: service/submitqueue/orchestrator/server/main.go
# modified: service/submitqueue/orchestrator/server/profiles.go
#1 parent eb3fc58 commit f951c03
3 files changed
Lines changed: 110 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | | - | |
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
| |||
201 | 199 | | |
202 | 200 | | |
203 | 201 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 202 | + | |
| 203 | + | |
210 | 204 | | |
211 | 205 | | |
212 | 206 | | |
| |||
471 | 465 | | |
472 | 466 | | |
473 | 467 | | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
| |||
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
52 | 71 | | |
53 | 72 | | |
54 | 73 | | |
| |||
100 | 119 | | |
101 | 120 | | |
102 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
103 | 130 | | |
104 | 131 | | |
105 | 132 | | |
| |||
122 | 149 | | |
123 | 150 | | |
124 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
125 | 156 | | |
126 | 157 | | |
127 | 158 | | |
128 | | - | |
| 159 | + | |
129 | 160 | | |
130 | 161 | | |
131 | 162 | | |
132 | 163 | | |
133 | 164 | | |
134 | 165 | | |
135 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
136 | 173 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
141 | 178 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
145 | 184 | | |
146 | 185 | | |
147 | 186 | | |
| |||
150 | 189 | | |
151 | 190 | | |
152 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
153 | 198 | | |
154 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
155 | 214 | | |
156 | | - | |
| 215 | + | |
157 | 216 | | |
158 | 217 | | |
159 | 218 | | |
| |||
162 | 221 | | |
163 | 222 | | |
164 | 223 | | |
165 | | - | |
| 224 | + | |
166 | 225 | | |
167 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
168 | 234 | | |
| 235 | + | |
| 236 | + | |
169 | 237 | | |
170 | | - | |
| 238 | + | |
171 | 239 | | |
172 | | - | |
173 | | - | |
174 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
175 | 244 | | |
176 | 245 | | |
177 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
0 commit comments