feat: baseline.ref = "pr", a switch judged on and off in the PR's own build #95

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:feat/switch-baseline into main 2026-11-18 19:55:17 +00:00
Owner

Why

A PR whose change sits behind a runtime switch it adds doesn't need main at all. The fair test is the PR's own build with the switch on against the same build with it off. That isolates the switch, and nothing of main changes in between.

Note on what it saves: the PR is never built from scratch. It's a pack built over main's base (dev_packs.py base, then pack), so a base is needed either way.

  • The main base build: skipped when the tester's existing base is already in the PR's history.
  • Running main: never happens.
  • Otherwise: the base is built as usual.

What changed

  • Plan schema 6: [baseline] ref = "pr". Both sides run the PR's build, the PR side with [matrix.pr_only]'s switches and the baseline side without. A switch that defaults on is tested off with RX_VK_X = ["0"].
    • Refusals: no PR-only switch, a scenario with matrix = false (both sides would be the same), [timing] (it times main's build), or schema < 6.
    • Normalization: the plan normalizes to schema 6 and goes only to agents of plan schema 6. The agent now says 6.
    • Fixtures: the agent's Plan and the coordinator's plan.py check alike, cross-checked by a good fixture and four refusals. bad-schema.toml moves to 7.
  • Agent (JobPipeline):
    • Base: with ref = "pr", when this PC's base (Workspace.BaseCommitOf) is the job's base or an ancestor of the PR head, it's reused with no main build. Its build record says so.
    • Runtimes: the baseline side's runtime is made from the PR's pack (RuntimeAsync(..., withPrPack: true), LayoutOf(..., withPrPack)), in its own folder, so neither side starts warmer.
    • Build check: the PR's CPU level stands for both sides.
  • Report: baseline_ref ("main" or "pr"), checked by the coordinator.
  • Wording:
    • The comment's plan says "Against: the PR itself, switch on (RX_…) and off; main is not built or run".
    • Matrix cells run "with the switch on and off", and pictures "compare with the switch off".
    • Table headers read "vs switch off"; the measurements' Before/After are "this PR @ sha, switch off / on", and the method says so.
    • The report page's columns say switch off / on.
  • Planner: told when to use it: only when everything the PR changes is behind the switch.
  • Docs: test-plan.md ([baseline], schema 6) and report-schema.md (baseline_ref).

Tests

  • Coordinator: 565 passed, 1 skipped. New tests cover:
    • the normalized plan and its words;
    • each refusal;
    • schema-6 plans offered only to schema-6 agents;
    • the report page's side names, and baseline_ref validation.
  • Agent: 2003 checks passed, including the fixture cross-check and the baseline runtime's layout.
  • Agent release build: 0 warnings.
  • Not tested: a real farm run. It needs a PR with a switch and testers on the next nightly.
## Why A PR whose change sits behind a runtime switch it adds doesn't need main at all. The fair test is the PR's own build with the switch on against the same build with it off. That isolates the switch, and nothing of main changes in between. **Note on what it saves:** the PR is never built from scratch. It's a pack built over main's base (`dev_packs.py base`, then `pack`), so a base is needed either way. - **The main base build:** skipped when the tester's existing base is already in the PR's history. - **Running main:** never happens. - **Otherwise:** the base is built as usual. ## What changed - **Plan schema 6:** `[baseline] ref = "pr"`. Both sides run the PR's build, the PR side with `[matrix.pr_only]`'s switches and the baseline side without. A switch that defaults on is tested off with `RX_VK_X = ["0"]`. - **Refusals:** no PR-only switch, a scenario with `matrix = false` (both sides would be the same), `[timing]` (it times main's build), or `schema` < 6. - **Normalization:** the plan normalizes to schema 6 and goes only to agents of plan schema 6. The agent now says 6. - **Fixtures:** the agent's `Plan` and the coordinator's `plan.py` check alike, cross-checked by a good fixture and four refusals. `bad-schema.toml` moves to 7. - **Agent (`JobPipeline`):** - **Base:** with `ref = "pr"`, when this PC's base (`Workspace.BaseCommitOf`) is the job's base or an ancestor of the PR head, it's reused with no main build. Its build record says so. - **Runtimes:** the baseline side's runtime is made from the PR's pack (`RuntimeAsync(..., withPrPack: true)`, `LayoutOf(..., withPrPack)`), in its own folder, so neither side starts warmer. - **Build check:** the PR's CPU level stands for both sides. - **Report:** `baseline_ref` (`"main"` or `"pr"`), checked by the coordinator. - **Wording:** - The comment's plan says "Against: the PR itself, switch on (`RX_…`) and off; main is not built or run". - Matrix cells run "with the switch on and off", and pictures "compare with the switch off". - Table headers read "vs switch off"; the measurements' Before/After are "this PR @ sha, switch off / on", and the method says so. - The report page's columns say switch off / on. - **Planner:** told when to use it: only when everything the PR changes is behind the switch. - **Docs:** test-plan.md (`[baseline]`, schema 6) and report-schema.md (`baseline_ref`). ## Tests - **Coordinator:** 565 passed, 1 skipped. New tests cover: - the normalized plan and its words; - each refusal; - schema-6 plans offered only to schema-6 agents; - the report page's side names, and `baseline_ref` validation. - **Agent:** 2003 checks passed, including the fixture cross-check and the baseline runtime's layout. - **Agent release build:** 0 warnings. - **Not tested:** a real farm run. It needs a PR with a switch and testers on the next nightly.
feat: baseline.ref = "pr", a switch judged on and off in the PR's own build
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
CI / Coordinator tests (pull_request) Has been cancelled
CI / Agent build and checks (pull_request) Has been cancelled
CI / Coordinator image (pull_request) Has been cancelled
cfdef8a41b
A PR whose change is behind a runtime switch it adds can now be tested
against itself: plan schema 6's [baseline] ref = "pr" runs the PR's own
build on both sides, the PR side with [matrix.pr_only]'s switches and
the baseline side without, so the switch alone is judged. main is not
run, and not built when the tester's base is already in the PR's
history (the PR's pack goes over it; otherwise the base is built as
usual, since the PR is built over one). Both sides get a runtime of
their own from the PR's pack, so neither starts warmer.

The plan needs at least one PR-only switch, every scenario on the
matrix, and no [timing]; agent and coordinator check it alike (new
fixtures), and it goes only to agents of plan schema 6 (the agent says
6 now). The planner is told when to use it. The comment, the
measurements and the report page call the sides "switch off" and
"switch on"; the report carries baseline_ref.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch feat/switch-baseline 2026-11-18 19:55:18 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk!95
No description provided.