Skip to content

Defaulted HEAD Baseline of a Candidate-runner Experiment is not pinned for resume #2195

Open

Description

@JacobStephens2

Finding

Raised by the Spec review of pull request #2194 (issue #2188).

When the Candidate is a Custom runner and the Baseline is a thirdshift build, --baseline defaults to HEAD (select_arms in src/evals/experiment.rs). Each invocation resolves that HEAD again. The recorded resume_command comes from the raw argv (resume_args(std::env::args().skip(1))), so it never pins the resolved commit. After any local commit, the resume command resolves a different Baseline commit, which gives a different Experiment identity. The paused Experiment is never resumed; a new one starts and builds a new Arm.

Evidence

This test was added to tests/experiments/custom_runner.rs, run, and then removed:

#[test]
fn candidate_runner_resume_keeps_the_defaulted_head_baseline_across_commits() {
    let fixture = process::fixture();
    runner(&fixture, DELIVER);
    let args = ["experiment", "--candidate-runner", "fixture", "--suite", "process", "--json", "--yes", "--draws", "100"];
    let first = fixture.scenario.run_with_env(&args, &NO_SANDBOX);
    assert_eq!(first.code, Some(0), "{}", first.stderr);
    let first: Value = serde_json::from_str(&first.stdout).unwrap();
    fixture.scenario.commit_locally("unrelated.txt", "unrelated", "Unrelated commit");
    let resumed = fixture.scenario.run_with_env(&args, &NO_SANDBOX);
    assert_eq!(resumed.code, Some(0), "{}", resumed.stderr);
    let resumed: Value = serde_json::from_str(&resumed.stdout).unwrap();
    assert_eq!(first["id"], resumed["id"], "{resumed}");
}

cargo test --test experiments custom_runner::candidate_runner_resume_keeps_the_defaulted_head_baseline_across_commits failed. The second run started a new Experiment and tried to build a new Baseline Arm at the new commit.

Why the review did not decide it

#2188 explicitly specifies "--baseline defaults to HEAD". Its "preserving Experiment resume identity … across commits" criterion is met for the Custom-runner Arm's own identity. Ordinary Experiments behave the same way today: an omitted --baseline (the merge base with main) and a HEAD commit argument both resolve fresh on resume. Pinning resolved refs into resume_command, or documenting the current behaviour, changes resume semantics for every Experiment. That is a product decision for the Spec or the Day shift.

Activity

  1. added
    needs-triage
    in-progress
    and removed
    needs-triage
    on Nov 14, 2026
  2. JacobStephens2 commented on Nov 14, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Investigation summary

    The underlying resume mechanism is confirmed by inspection on selected Base commit 12da417. The Custom-runner reproduction remains unverified here: this Base has neither select_arms nor tests/experiments/custom_runner.rs. PR #2194 is still open against issue-1468.

    Evidence:

    • src/evals/experiment.rs:225-242 resolves the Candidate and Baseline on every invocation, including an omitted Baseline via merge-base with main.
    • src/evals/experiment.rs:319-320 hashes the resolved Arm setups and suite names into Experiment identity. A different resolved commit therefore selects a different Experiment directory (src/evals/experiment/store.rs:271).
    • src/evals/experiment.rs:398-408 records resume_command from raw argv. resume_args at line 616 removes --name but does not pin refs or insert the resolved default Baseline.
    • src/evals/experiment/options.rs:86 and src/evals/experiment/reading.rs:133 only translate legacy statistical flags when displaying recovery commands; they do not pin commits.
    • Existing resume tests in tests/experiments.rs cover preserved Trials, Bar compatibility and argument quoting, but do not exercise moving Git refs between invocations.

    #1468 and #2188 explicitly require a HEAD default for a native Baseline against a Custom-runner Candidate. ADR 0032 does not decide whether generated recovery commands must pin that default. docs/guide.md:1837 describes identity in terms of the same Arms, while site/how-it-works/index.html:319 says the same command resumes paused work. These statements need a clear distinction between repeating a comparison and recovering its recorded Experiment.

    Recommended Day shift decision

    Approve pinning resolved native Arm commits in generated resume_command values, including defaulted Baselines. Keep initial selection defaults and ordinary CLI ref resolution unchanged: repeating a raw command may select new Arms, while following its recorded recovery command should retain the original commits when other identity inputs are unchanged. Do not weaken Experiment identity or search for an old Experiment while ignoring a changed Baseline.

    After approval, shape one implementation Ticket covering shared recovery-command generation, CLI/Console display, compatibility for saved records, and documentation. Coordinate the Custom-runner regression with #2188/#2194; this is a separate recovery-contract decision rather than a duplicate of their HEAD-default requirement.

    Acceptance should execute the actual recorded resume_command after an unrelated commit, retain Experiment ID and completed Trials, and avoid building a replacement Baseline. Cover a defaulted Custom-runner Baseline, ordinary symbolic Candidate/Baseline refs and an omitted merge-base Baseline; preserve shell quoting, --name handling and legacy Bar flags. Specify whether existing records gain pinned commands through read-time translation without rewriting their stored inputs. Update docs/guide.md, regenerate its manual, and correct the hand-written site's resume claim.

    If the Day shift chooses current semantics instead, document that recovery commands require unchanged ref resolution and show explicit commit-SHA usage. For now, explicitly supplying the recorded native Arm commit SHAs avoids this ref-movement problem when other identity inputs remain unchanged.

  3. added
    bug
    ready-for-human
    and removed
    in-progress
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions