Skip to content

feat(submitqueue): code-aware jev scorer, scoring benchmarks, and a speculation liveness fix - #1

Merged
tvandalovsky-cw merged 3 commits into
mainfrom
feat/jev-scorer
Oct 13, 2026
Merged

tvandalovsky-cw merged 3 commits into
mainfrom
feat/jev-scorer

Conversation

@tvandalovsky-cw

Copy link
Copy Markdown
Owner

Why?

SubmitQueue's speculation ranks builds by each batch's probability of succeeding, and the shipped scorer prices every batch at a flat 0.5. This branch explores a code-aware scorer backed by a System One decision model (TypeSafe Jev, reached through a LiteLLM proxy), and builds the infrastructure to measure whether it beats simple baselines: an oracle ceiling, a real-history replay benchmark, and a synthetic corpus with build-verified labels. Along the way it fixes a speculation liveness bug the experiments exposed.

What?

Three commits, reviewable independently:

  1. fix(submitqueue): cancel undispatched paths in the run that breaks them — a funded path whose build was never dispatched stayed cancelling after its guess broke, holding a budget slot until a later speculate run that a quiet queue never sends. At buildBudget: 2 this wedged the queue with batches stuck in speculating. Such paths are now cancelled in the run that marks them. Includes a regression test that fails without the fix. Self-contained and suitable for upstream on its own.
  2. feat(submitqueue): add jev scorer with code-aware context and replay benchmark
    • scorer/jev — scores a batch through the proxy with a shared price cache, a fallback scorer, and configurable byte caps.
    • extension/changediff — new extension returning each change's diff and, optionally, modified files in full and package-scoped references (untouched callers of changed declarations, definitions of called functions), read from the orchestrator's existing git copy. Jev sends them as an annotated repository_context.
    • scorer/oracle — benchmarks-only scorer pricing batches from recorded outcomes; the ceiling for comparisons.
    • buildrunner/replay + tool/replaybench — benchmarks-only replay of GitHub merge-queue history: fetch attempts, rebuild each PR's change on an epoch base, answer builds with the recorded CI outcome and duration.
    • RFCs: doc/rfc/submitqueue/code-aware-scoring.md, doc/rfc/submitqueue/replay-benchmark.md.
  3. feat(tool): add jevcorpus synthetic scorer corpus — generates Go changes by mutating a seed repository, labels them by building and testing, writes a replay-format dataset, and grades jev offline. RFC: doc/rfc/submitqueue/synthetic-corpus.md.

Everything new is opt-in configuration; existing queues behave as before. oracle and replay log a warning when configured and are documented as never for production.

Findings so far (details in the RFCs)

  • With file stats only, Jev is no better than chance; with the diff it catches failures visible in the changed lines, and with files + references it was the best scorer on a synthetic subtle-failure workload (AUC 0.79; fewest builds at budget 4 and fastest to land at both budgets).
  • It still misses a cross-file signature break even when shown the broken caller — better handled by a deterministic static check outside the model.
  • On a first small slice of real Jaeger history (20 PRs, 3 failures, 2 likely flaky) it did not predict failures; more data is needed before drawing conclusions.
  • The current proxy deployment rejects requests above roughly 16–20KB (HTTP 502), so deployments must set jev.diff.maxDiffBytes / maxContextBytes; the code defaults are far larger.

Test Plan

  • make lint, make check-gazelle, make check-tidy, make check-mocks pass.
  • make test: 154/155 pass. The one failure, //tool/compose:compose_test, fails identically on main without these commits (a macOS /var vs /private/var path assertion introduced upstream in chore(docker): supply docker compose via Bazel uber/submitqueue#830), so it is unrelated.
  • make e2e-git-test passes (needs --spawn_strategy=local on macOS, where Bazel's sandbox blocks Docker buildx).
  • New unit tests: git differ (diffs, stacks, stale target, files, scoped callers/definitions, renames), jev request shape and budgets, oracle, replay runner and truth, replaybench verdict logic, profile wiring for jev/oracle/replay, and the speculation regression test.
  • Local queue experiments: 8 scorer configurations × budgets 4 and 2 on a synthetic workload, and an end-to-end replay of real Jaeger PRs through the git provider.

Issue

None — exploratory work on this fork.

A funded path whose build was never dispatched stayed cancelling after a
speculate run broke, superseded or user-cancelled it. Only the next run's
read moved it to cancelled, and a quiet queue sends no next run: no build
exists to signal, so the path held its budget slot forever and wedged every
batch behind it. Seen at buildBudget 2, where two such paths filled the
budget and the queue stalled with batches in speculating.

A pending path the run's own read found no build for is now cancelled
outright when it is marked. The build stage starts only pending paths and the
poll loop already stops builds for cancelled paths, so a build dispatched
after the read is still stopped.
…benchmark

- jev: a content scorer that prices a batch with a System One decision model
  behind a LiteLLM proxy, with a shared price cache and a fallback scorer.
- changediff: a new extension returning each change's diff and, optionally,
  its modified files in full and package-scoped callers of changed
  declarations and definitions of called functions, read from the
  orchestrator's git copy. jev sends it as annotated repository context
  under configurable byte caps.
- oracle: a benchmarks-only scorer pricing batches from recorded outcomes,
  the ceiling other scorers are measured against.
- replay: a benchmarks-only build runner answering builds with recorded CI
  outcomes and durations, and tool/replaybench to build datasets and
  sandboxes from GitHub merge-queue history.
- RFCs: code-aware-scoring and replay-benchmark.
Generates Go changes by mutating a seed repository into safe and unsafe
variants balanced across size tiers, labels each by building and testing it,
writes a replay-format dataset and sandbox, and grades jev against a size
baseline offline. Indexes the code-aware-scoring, replay-benchmark and
synthetic-corpus RFCs.
@tvandalovsky-cw
tvandalovsky-cw merged commit 15d0f7d into main Oct 13, 2026
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.

1 participant