Skip to content

refactor(baseline): name how a run applies its patches, and the failures that end it - #1961

Merged
chaojhou merged 41 commits into
mainfrom
feature/chenyi/cc-baseline-runs
Oct 22, 2026
Merged

chaojhou merged 41 commits into
mainfrom
feature/chenyi/cc-baseline-runs

Conversation

@chennyiiis

@chennyiiis chennyiiis commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What this does

Refactors orchestrator/actions/executors/baseline.py into warm-patch screening/application, benchmark launch/result handling, and round orchestration. _boot_failure centralizes the error-text choice that main repeated inline. Inline loading of benchmark_report.json is replaced with the existing read_json(..., require_dict=True) helper. The redundant hasattr(live_shared_state, "set_stop_reason") guard inside the former _run_once flow is removed.

Three records are added: _OverlayText, _BenchmarkRound, and _BenchProcess. No module is added or removed. Relative to main bb2da63332dcbc46bdf10702c516ef43eb80a016, production code changes by +1406/-1500 (94 fewer lines); the complete PR including tests and baseline is 106 lines smaller.

The existing size-exception covers 2906 changed production lines, counting additions plus deletions. Patch snapshotting, round setup, warmup/measure/accuracy execution and final cleanup form one benchmark lifecycle, and their call sites must move with the extracted stages. _run_once retains the ordered setup, _run_single_benchmark assembles the launch/result context, and _maybe_stop_on_missing_baseline_accuracy retains the salvage-before-stop decision. Their remaining length is recorded below; the PR reduces branch complexity without hiding the lifecycle behind a second module or claiming the size debt is gone.

Observable effect

  • An empty patch_ref file in a required timeline reports unsafe_or_non_text_diff instead of missing_artifact. Empty files in best-effort mode and non-text patches already reported unsafe_or_non_text_diff and retain that behavior.
  • A patch_ref naming a directory reports artifact_read_failed instead of missing_artifact in both modes. In required mode the top-level failure changes as well.
  • A headerless hunk in best-effort mode reports missing_touched_paths without detail; previously it reported git_apply_failed with git's patch-fragment error text. Required mode already reported missing_touched_paths.
  • An eval-rooted stop that recovers accuracy from a sibling attempt now emits the sibling-salvage WARNING from _apply_salvaged_accuracy. That warning names recovered accuracy and its source file; it is not a patch-application warning.
  • Failure to persist the post-application warm-replay pending state is now logged at WARNING instead of DEBUG through _save_warm_replay_pending.
  • The ordinary missing-accuracy stop uses the existing finite-positive accuracy_meets_floor predicate with floor zero. Non-finite accuracy can no longer satisfy the former positive-value shortcut.

The required timeline still snapshots before mutation, restores failed applications, and leaves a successful required replay patched for PRELUDE to promote. Main's removal of the eval opt-out is preserved: no force_disable_eval, disable_run_eval, or _eval_disabled path is restored; runs_accuracy_eval remains authoritative.

Complexity and validation

Measured with ruff 0.16.2 and complexipy 8.0.1 against the main commit above; lines are physical spans from def through the last statement:

Function Cyclomatic Cognitive Lines
_run_once 54 → 6 171 → 9 675 → 106
_run_single_benchmark 38 → 5 119 → 9 596 → 94
_apply_warm_patches 52 → 10 175 → 19 416 → 72
_maybe_stop_on_missing_baseline_accuracy 13 → 10 29 → 16 126 → 108

The baseline diff removes 10 entries, lowers 4, and adds none. Stored function-lines allowances lower from 649→106 for _run_once, 566→94 for _run_single_benchmark, and 126→108 for _maybe_stop_on_missing_baseline_accuracy; module-lines lower 4144→4050. These are baseline records, distinct from physical source spans. The three functions remain above the 80-line threshold. The highest cognitive complexity in the resulting file is 29, in _apply_warm_patch_sequence.

Validation: 203 tests passed across test_sbd_v6_baseline_timeline.py, test_warm_patch_apply.py, and test_warm_replay.py under Linux/Python 3.10. A separate base/head differential exercised 16 warm-patch cases, including successful apply, missing/empty/directory artifacts, non-text and binary patches, path escape, and headerless hunks, in required and best-effort modes; it confirms the reason changes above and identical applied contents. Ruff lint and format checks passed. The head already contains the main commit named above.

…res that end it

_run_once applied the recipe's warm patches and settled their outcome inline;
_run_single_benchmark reported a run that produced no workspace the same way.
Name the four jobs, and the two records that carry what they read.

_run_once:             685 -> 594 lines, cognitive 177 -> 128, cyclomatic 56 -> 45
_run_single_benchmark: 597 -> 538 lines, cognitive 120 ->  92, cyclomatic 39 -> 30

vulture found the rollback's trailing return unreachable -- every path through
it already reports -- so the caller no longer tests for a None it cannot get.

Observable effect: none -- pure refactor.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chennyiiis
chennyiiis requested a review from a team as a code owner October 17, 2026 07:23
@chennyiiis chennyiiis added baseline-raise Waives new, worse and baseline-growth code-metrics findings; reason required in the PR description run-e2e Run the single-GPU Hyperloom e2e smoke on this PR (again on every new commit while set) labels Oct 17, 2026
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Code metrics gate: PASSED

Judged: the 4 files this change touches. Files it does not touch never fail it; anything found there is listed under Outside this change for information.

Dimension Limit New Worse Baseline out of date Baseline entries vs base
Cyclomatic complexity fails > 20 0 0 0 17 -3
Cognitive complexity fails > 30 0 0 0 99 -3
Function length (lines) fails > 80 0 0 0 238 -2
Nested block depth fails > 5 0 0 0 9 -2
Parameter count fails > 5 0 0 0 88 +0
Module length (lines) warns > 800, fails > 1200 0 0 0 47 +0
Duplicated lines per file fails > 0 0 0 0 95 +0
Dead code (vulture) fails > 0 0 0 0 2 +0
Check Findings Effect
Comments 0
English only 0
Production code imports test code 0
Repeated literals 0
A1 Private name of another package 0
A8 Flag argument 0
A9 Tuple return 0
A10 Raw vocabulary comparison 0
A11 Hidden global write 0
A12 Pure forwarder 0
A12 Single-implementation abstraction 0
76 findings in files this change does not touch

Outside this change (informational): 76

Unit Dimension Baseline Now
src/hyperloom/orchestrator/state/shared_state.py resolve_graded_comparison Cognitive complexity absent 34
src/hyperloom_kb/collect/mapping.py _experience Cognitive complexity absent 31
src/kernelforge/cli/forge_loop_command.py forge_loop Cognitive complexity absent 31
src/kernelforge/loop/runner.py IterationLoop._collect_session_candidate Cognitive complexity absent 44
src/kernelforge/loop/runner.py IterationLoop._rule_on_attempt Cognitive complexity absent 38
src/hyperloom/inference_optimizer/cli/__init__.py _reexport_session_environment Function length (lines) absent 107
src/hyperloom/inference_optimizer/cli/__init__.py _resolve_agent_lineup Function length (lines) absent 89
src/hyperloom/inference_optimizer/cli/__init__.py _resolve_run_topology Function length (lines) absent 92
src/hyperloom/inference_optimizer/multi_node/scripts/launch_multinode.py _build_parser Function length (lines) absent 84
src/hyperloom/inference_optimizer/multi_node/scripts/launch_multinode.py _spawn_rank_actors Function length (lines) absent 84
src/hyperloom_kb/sync.py GlobalSync.pull Function length (lines) absent 84
src/kernelforge/loop/runner.py IterationLoop._close_iteration Function length (lines) absent 117
src/kernelforge/loop/runner.py IterationLoop._collect_session_candidate Function length (lines) absent 185
src/kernelforge/loop/runner.py IterationLoop._implementer_history Function length (lines) absent 112
src/kernelforge/loop/runner.py IterationLoop._rule_on_attempt Function length (lines) absent 102
src/kernelforge/loop/runner.py IterationLoop._source_attempt Function length (lines) absent 175
src/hyperloom_kb/http_service.py Module length (lines) absent 1525
src/kernelforge/cli/forge_loop_command.py Module length (lines) absent 2003
src/hyperloom/orchestrator/actions/executors/_kv_metrics.py port_from_server_log Nested block depth absent 6
src/hyperloom/orchestrator/actions/executors/_grid_runner.py run_grid Cognitive complexity 177 180
src/hyperloom/orchestrator/actions/executors/explore.py ExploreExecutor.__call__ Cognitive complexity 369 383
src/hyperloom/orchestrator/specialists/dispatch.py SpecialistDispatchCollaborator.warm_specialist_params Cognitive complexity 93 94
src/hyperloom/orchestrator/actions/executors/_grid_runner.py run_grid Cyclomatic complexity 55 56
src/hyperloom/orchestrator/actions/executors/explore.py ExploreExecutor.__call__ Cyclomatic complexity 76 83
src/hyperloom/agents/quantization/driver/retry.py quantize_via_prompt Function length (lines) 102 103

...and 51 more; the job log lists every row.

Verdict computed by the gate scripts in /home/runner/work/_temp/code-metrics-gate, not by this tree's copy.

Thresholds and sources: [tool.hyperloom.code_metrics] in pyproject.toml. Tools: complexipy 8.0.1, jscpd 5.4.1, ruff 0.16.2, vulture 2.16.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

CI E2E report — ❌ Failed

item value
result ❌ Failed
model Qwen/Qwen3-0.6B (dense)
resources 1× GPU, TP=1
PR branch feature/chenyi/cc-baseline-runs
commit 83b87950cbabf9b93461e54d6d1dbbc2feef5f0e
session_id hyperloom:oneoff-3ffb36cc024f46dd
backend run fca9243c-8146-4cf7-97d5-6afdf45288c3 on -
queue → dispatch 1s
run time 8m 46s
total 8m 47s
reason safe-workload: the platform ended the run (Terminated, Pod was terminated because the allocation this Pod ran on ended; the node's pods were stopped (the node stopped this workload at 2026-10-19T04:22:48.212Z because the allocation it ran on ended: the allocation's payload asked for it); DisruptionTarget: TerminationByKubelet (2026-10-19T04:22:49): Kubelet: the allocation this Pod ran on ended; the node's pods were stopped)
platform error
safe-workload: the platform ended the run (Terminated, Pod was terminated because the allocation this Pod ran on ended; the node's pods were stopped (the node stopped this workload at 2026-10-19T04:22:48.212Z because the allocation it ran on ended: the allocation's payload asked for it); DisruptionTarget: TerminationByKubelet (2026-10-19T04:22:49): Kubelet: the allocation this Pod ran on ended; the node's pods were stopped)

details

@chennyiiis

Copy link
Copy Markdown
Contributor Author

e2e has now been reaped by the platform three times on this PR, never by anything in the diff:

Attempt Platform message
1 claw: the sandbox never became usable (sandbox_exited_before_ready)
2 Terminated, Pod was terminated because the allocation this Pod ran on ended
3 DisruptionTarget: TerminationByKubelet — the allocation this Pod ran on ended

Each time the run ended before the smoke workload reported anything, so there is no measurement to read. Re-queued.

Everything else is green: 34 checks pass, 0 fail. Locally, pytest across the 12 test files that reference BenchmarkRunExecutor, _apply_warm_patches or _run_single_benchmark — 661 passed, 11 skipped; the one failure there is a missing TraceLens install and fails the same way on the base commit.

@chennyiiis chennyiiis removed the run-e2e Run the single-GPU Hyperloom e2e smoke on this PR (again on every new commit while set) label Oct 19, 2026
@chennyiiis

Copy link
Copy Markdown
Contributor Author

Dropping run-e2e and cancelling the queued run.

The three attempts all ended with the platform reaping the pod before the smoke workload reported anything, so none of them measured this change — re-queueing a fourth buys nothing. This is a pure refactor with no observable effect, and the unit coverage is what pins it: 661 passed, 11 skipped across the 12 test files that reference BenchmarkRunExecutor, _apply_warm_patches or _run_single_benchmark. Whoever reviews can add the label back if they want a GPU run before it lands.

chennyiiis and others added 10 commits October 19, 2026 13:26
The label is off, but ci-e2e.yml does not listen for unlabeled, so the cancelled
run's status stayed red. A synchronize event lets it skip instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The warm-replay overlays, their per-tree evidence and the exact rollback that
undoes them move out of the baseline executor into a module of their own; the
baseline executor keeps the benchmark round.

No observable change: internal structure only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…uracy

The salvage from a sibling attempt, the routing of an under-floor score into
the enablement lane and the stop with no usable reference each become a named
step, leaving the decision itself readable at one level.

No observable change: internal structure only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Resolving the trees an overlay belongs to, screening its diff text, snapshotting
each tree before anything is written, landing one overlay and reporting the
sequence each become a named job with a typed result, and the four refusal
reports a required timeline can produce now share one skeleton.

No observable change: internal structure only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Resolving what the attempt runs with, writing its benchmark config, refusing it
when the run cannot afford it, holding its GPU lease and running the warmup,
measured and staged-accuracy rounds each become a named step, and the arguments
the rounds share travel as typed objects instead of a free-variable scope.

No observable change: internal structure only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Launching the subprocess, classifying its exit, harvesting what it leaked and
turning the workspace it left into a measurement each become a named step, with
the round's launch inputs and the subprocess's outcome carried as typed objects
rather than two dozen locals shared across six hundred lines.

No observable change: internal structure only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…installs

The client-side tokenizer hook and the lm-eval patches an eval run needs each
become a named step that reports the tree it cannot be installed in.

No observable change: internal structure only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… lowered

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread src/hyperloom/inference_optimizer/tests/test_warm_replay.py Fixed
Comment thread src/hyperloom/inference_optimizer/tests/test_warm_replay.py Fixed
Comment thread src/hyperloom/inference_optimizer/tests/test_warm_replay.py Fixed
Comment thread src/hyperloom/inference_optimizer/tests/test_warm_replay.py Fixed
Comment thread src/hyperloom/inference_optimizer/tests/test_warm_replay.py Fixed
Comment thread src/hyperloom/inference_optimizer/tests/test_warm_replay.py Fixed
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chennyiiis chennyiiis added size-exception Waives the PR diff budget; added by a maintainer with a reason in the PR description and removed baseline-raise Waives new, worse and baseline-growth code-metrics findings; reason required in the PR description labels Oct 19, 2026

@chaojhou chaojhou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #1961 -- refactor(baseline): name how a run applies its patches, and the failures that end it

What it does: PR #1961 splits four over-complex functions in executors/baseline.py into named helpers and NamedTuples: _run_once, _run_single_benchmark, _apply_warm_patches and _maybe_stop_on_missing_baseline_accuracy. BaselineExecutor._after_materialize_config is also split, though the description does not say so. The warm-replay patch machinery moves into a new private module, _warm_patch_apply.py. At head the refactor behaves the same as base, but the PR conflicts with main in a way that changes behaviour (main's #1984 removed the eval opt-out that the PR's new helpers still carry), so it is blocked until rebased.

Blocking issues: 1

  1. [conflict-1984-eval-optout] Semantic conflict with #1984: new helpers keep the removed eval opt-out, and one stale _eval_disabled call auto-merges [verified]
    Problem: mergeable=CONFLICTING. Main's f7f64ac (#1984) deleted BenchmarkRunExecutor._eval_disabled, the force_disable_eval plumbing and the disable_run_eval/--no-eval opt-out, and added runs_accuracy_eval. This PR moves that same logic into new helpers: _baseline_accuracy_reference_is_due:1517, _resolve_round_setup:1788-1792, _run_warmup_round:2127 and _BaselineRunRequest:943. In git merge-tree, main's deletion of def _eval_disabled merges cleanly, while the call at head 1517 (merged line 1479) is outside every conflict hunk. src/hyperloom/orchestrator/actions/executors/baseline.py:1517
    Impact: Every genuine-baseline round fails with AttributeError. A PR-side resolution also brings back #1984's removed --no-eval/disable_run_eval opt-out (RUN_EVAL=false, a cancelled staged accuracy round, a skipped accuracy stop) and drops runs_accuracy_eval, which reverts #1984 without saying so.
    Action: Rebase onto main and re-express #1984 in the new helpers. Remove _eval_disabled calls, force_disable_eval from _BaselineRunRequest and the _run_once signature, eval_disabled from _RoundSetup and the warmup force_warmup_eval clauses. Put if not self.runs_accuracy_eval: extra_envs['RUN_EVAL']='false' and the plain defer_accuracy into _resolve_round_setup, and update the comment at 3356. Then regenerate code_metrics_baseline.txt.

Checked: _apply_warm_patches (base baseline.py:1098 -> head _warm_patch_apply.py:845 + _prepare_warm_patch_run/_warm_patch_trees/ (yes); moved helpers _git_toplevel..revert_warm_patch_trees, stamp_warm_patch*, restore/revert_warm_kernel*, _rollback_warm (yes); BenchmarkRunExecutor._run_single_benchmark (head baseline.py:3517 + _restart_multi_node_server/_measured_round_result/_m (yes); BenchmarkRunExecutor._run_once (head baseline.py:2457 + _resolve_round_setup/_settle_attempt_server_args/_sanitized_over (yes); BenchmarkRunExecutor._maybe_stop_on_missing_baseline_accuracy (head baseline.py:1618 + _baseline_accuracy_reference_is_d (yes); BaselineExecutor._after_materialize_config (head baseline.py:3822 + _client_tokenizer_hook_failure/_eval_patch_failure) (yes) | Conflict with main semantic | Base: ef93838 | Head: 91a7491

@ZhengGong-amd

Copy link
Copy Markdown
Collaborator

Requesting changes: this refactor grows production code by 823 lines and carries #1984's removed eval opt-out back into new helpers; please rebase and rework it so it deletes mechanisms instead of renaming them.

Production code: +2880/−2057 (net +823), plus 20 new NamedTuples (13 in baseline.py, 7 in _warm_patch_apply.py). Total cyclomatic complexity across the two files rose 451→526. A complexity refactor should shrink the code. Bring the net change to zero or below by deleting the mechanisms listed below. Moving them to another file does not count.

Blocking

  1. Semantic conflict with main: baseline.py:1517 still calls self._eval_disabled(ctx), which Remove the accuracy eval opt-out #1984 deleted. That call sits outside every conflict hunk, so resolving the conflicts in this PR's favour either raises AttributeError on every genuine baseline round or silently reverts Remove the accuracy eval opt-out #1984. Rebase onto main and remove force_disable_eval, _RoundSetup.eval_disabled and disable_run_eval/force_warmup_eval (:943, :983, :1788-1792, :2127-2128, :2461). Use if not self.runs_accuracy_eval: extra_envs["RUN_EVAL"] = "false" as main does.
  2. The re-export alias kept only for phases/prelude.py breaks Finish the replacement (baseline.py:118-120). Delete it and have prelude.py:44 import from _warm_patch_apply directly.

Simplify instead of relocate

  • Read and filter each warm patch once. Delete _overlay_text_for_apply and _unsafe_overlay_reason, which repeat _warm_patch_text and _unusable_patch_reason.
  • Remove the dead target_repo parameter (production always passes "") and the before_apply_sha = "" constant. Make _apply_warm_patches always return a dict so that the four isinstance dispatches can go. Keep a single "missing framework_root" rule (baseline.py:2543-2552 and _warm_patch_apply.py:856-857 currently disagree on best-effort timelines).
  • Collapse _BenchmarkOutput/_BenchmarkOutcome/_BenchProcess into one process-result type. Drop _refused_benchmark and return early instead. Replace _BaselineRunRequest/_RoundSetup/_MaterializedRound/_RoundExecution with at most one type that holds only cross-round fields, without ctx/params/shared_state.
  • Split into: deletions, then a pure move of _warm_patch_apply, then _run_single_benchmark, then _run_once.

The "Cmetrics (CodeArts)" scores in the description cannot be reproduced with the repo tools (ruff C901 / complexipy). The line counts are 4261→4085, not 4253→4082.

…eline-runs

Resolve the baseline executor toward #1984: the accuracy-eval opt-out stays
deleted, re-expressed through the extracted helpers. `_eval_disabled`,
`_BaselineRunRequest.force_disable_eval`, `_RoundSetup.eval_disabled` and the
`disable_run_eval` / `RUN_EVAL` reads are gone; `_resolve_round_setup` turns the
eval off only for an executor whose `runs_accuracy_eval` is False, and
`_baseline_accuracy_reference_is_due` no longer tolerates a missing accuracy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ZhengGong-amd

Copy link
Copy Markdown
Collaborator

Production code is still too large. The net growth is +733 lines (it was +823), and it needs to keep shrinking before this can merge.

I classified every changed line in the touched production files with an AST pass (merge-base vs head ff0b53e9c):

net lines
executable logic +91
docstrings +143
def/class signatures +278
NamedTuple/dataclass fields +113
blank lines between new defs +112
imports / __all__ +15

Functions go from 144 to 209, record types from 1 to 21, and total parameters from 293 to 467. Of the 87 new definitions, 58 are referenced exactly once in src/.

The logic barely changed (+91). The growth is the scaffolding around single-use units: their signatures, docstrings, fields and spacing (about +661 lines). That is the same control flow in more places, not a simpler one (AGENTS.md Simplify by removing a mechanism). The parameter-count and tuple-return limits in [tool.hyperloom.code_metrics] are review triggers, not a reason to add a type or a helper. When a limit and the clearer code disagree, keep the clearer code and say so (Size is a design signal).

Cut next:

  • _apply_warm_patches returning list | dict: return one shape and delete the isinstance dispatch.
  • _BenchmarkOutput, _BenchmarkOutcome and _BenchProcess: one process-result type. Delete _refused_benchmark and return early instead.
  • _BaselineRunRequest, _RoundSetup, _MaterializedRound and _RoundExecution: at most one cross-round type.
  • Inline the remaining helpers that have one caller and only thread arguments through, and drop the docstrings that restate a private helper's name (Comment below the local average).

Target: production net ≤ 0, or name each remaining new type in the description with what it removes.

Test and others added 8 commits October 20, 2026 16:54
…eline-runs

# Conflicts:
#	scripts/code_metrics_baseline.txt
…eline-runs

# Conflicts:
#	scripts/code_metrics_baseline.txt
Review asked why these PRs add so many docstrings. The files already document
96-98% of their functions, so the growth is the function count the complexity
ceiling forced, not a higher documentation rate. Every new helper keeps a
docstring; the Args:/Returns: blocks on them go.

Mechanical, via collapse_docstrings.py --added-vs origin/main: only functions
this branch adds are touched, pre-existing functions, module and class
docstrings are left alone. No behaviour change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…pse improved

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…chenyi/cc-baseline-runs

# Conflicts:
#	scripts/code_metrics_baseline.txt
#	src/hyperloom/orchestrator/actions/executors/baseline.py
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ZhengGong-amd

Copy link
Copy Markdown
Collaborator

We compared this PR with a delete-first reference implementation built on the same merge-base. Both bring all five targets under the thresholds. This PR adds +658 net production lines (65 functions, 20 NamedTuples, a new module, cyclomatic sum 446 → 512). The reference implementation removes −406 (cyclomatic sum 446 → 443). Please rework the PR along these lines before it merges.

Targets: _run_once (cc 54 / cog 171 / 650 lines), _apply_warm_patches (52 / 175 / 416), _run_single_benchmark (38 / 119 / 567), _maybe_stop_on_missing_baseline_accuracy (126 lines), BaselineExecutor._after_materialize_config (96 lines). Revert the rest: the move to _warm_patch_apply.py, the _revert_warm_patch_state → revert_warm_patch_state rename, and the phases/prelude.py import. If you want the move, send it as a separate move-only PR and note there that the logger name changes.

Delete

  1. _BenchmarkOutput, _BenchmarkOutcome, _BenchProcess, _refused_benchmark, _benchmark_outcome, _observed_benchmark_outcome. These are three overlapping process records plus a value-or-refusal pair. Replace them with one record that holds only facts (no failure field, no classification fields), and return refusals as early dicts.
  2. _loaded_benchmark_report duplicates an existing helper. Use read_json(report_path, None, require_dict=True) from hyperloom.common.jsonio.
  3. _BaselineRunRequest, _FrameworkArgs, _ScriptOverrides, _RoundSetup, _MaterializedRound, _RoundPatches, _RoundExecution, _PatchSettlement, _AccuracyStageDecision, _refused_round are single-use bags and value-or-refusal pairs. See Change 4.
  4. Inline these single-use pass-throughs at their callers: _sanitized_overrides, _resolve_round_setup, _record_round_invocation, _round_preflight_failure, _run_single_round, _run_warmup_round, _warmup_failure_result, _run_measure_round, _run_accuracy_round, _post_measure_accuracy_decision, _multi_node_warmup_result, _server_is_already_ready, _sweep_stale_aiter_locks, _succeeded_round_result, _measured_round_result, _settle_patch_application. Fold _attach_round_accuracy into _stamp_round_quality.
  5. _stamp_round_patches forwards to an existing helper. Move its warm_patches_applied write into _stamp_warm_patch_outcome.
  6. Inline _baseline_accuracy_reference_is_due and delete _adopt_sibling_baseline_accuracy. Log the handoff inside _apply_salvaged_accuracy when expected_handoff=True.
  7. In the warm-patch code, delete _WarmPatchTrees, _ScreenedPatches, _WarmPatchPreparation, _WarmPatchSite, _PatchApplyOutcome, _WarmPatchSequence, _MUTATING_APPLY_METHODS, _recorded_patch_roots, _screened_patch_contents, _prepare_warm_patch_run, _refuse_after_snapshot_failure, _refuse_unpersisted_warm_patch_state, _land_warm_patch and _apply_overlay_without_git. Use plain locals in _apply_warm_patches and _apply_warm_patch_sequence instead.
  8. Delete the hasattr(live_shared_state, "set_stop_reason") guard in _roll_back_failed_patches. SharedState.set_stop_reason always exists, so the guard is redundant.

Change

  1. Keep one boot-failure ladder. _failed_measurement_result and _no_workspace_failure each carry a copy of it today; make both call this:
    def _boot_failure(finished, server_log: Path) -> tuple[str, str] | None:
        death = server_log_death_excerpt(str(server_log))
        dead = death is not None or finished.returncode == SERVER_DEAD_RETURNCODE
        death_error = death or "server engine/worker init failed (reaped by liveness watchdog); see server.log"
        error = death_error if dead else (finished.stderr or finished.stdout)[-2000:]
        texts = (finished.server_log_text, finished.stderr, finished.stdout)
        if is_aiter_jit_registry_mismatch(*texts): return "aiter_jit_registry_mismatch", error
        if _is_cuda_graph_capture_failure(*texts): return "cuda_graph_capture_failed", error
        return ("server_init_dead", death_error) if dead else None
  2. Merge _failed_measurement_result, _refuse_nonzero_exit_without_complete_protocol and _nonzero_exit_failure into one path. Build one shared failed base dict with the 10 common fields, then add the fields for each error_class.
  3. Merge _timeout_failure and _detokenizer_stall_failure into _reaped_round_failure(output_dir, workspaces_before, started_unix, fields). It does the workspace selection, harvest and envelope once.
  4. Split _run_once into two stages. _run_once resolves, materializes and records. _run_attempt_rounds runs preflight → budget → patches → lease → rounds. Carry state between them in the existing common round-kwargs dict, adding recorder and run_index. Use one try/finally (legacy-patch revert and lease close) instead of the two that _run_single_round and _run_cold_start_guarded_rounds each have today.
  5. Save warm_replay_pending in one helper. The merge, save and except Exception are repeated in _persist_recipe_snapshot, _settle_patch_application and _roll_back_failed_patches:
    def _save_warm_replay_pending(self, state, **fields) -> bool:
        state.warm_replay_pending = {**(state.warm_replay_pending or {}), **fields}
        try:
            state.save(self.session_dir)
        except Exception:
            log.warning("baseline_executor: warm replay pending state persist failed", exc_info=True)
            return False
        return True
  6. _snapshot_warm_patch_trees should raise instead of returning Exception | None. Catch the specific errors at its one call site.

Keep: _requested_framework, _BENCHMARK_REPORT_NAME, both accuracy outcomes (_route_accuracy_failure_to_enablement, _stop_without_accuracy_reference), _settle_attempt_server_args, _round_refused_before_ignition, _cold_anchor_when_hot_pass_unaffordable, _record_measured_against_warmup, _settle_deferred_accuracy, _run_cold_start_guarded_rounds, _restart_multi_node_server, _launch_benchmark, _round_result_from_workspace, _stamp_round_quality, _no_workspace_failure, _roll_back_failed_patches, _eval_patch_failure. In the warm-patch code keep _OverlayText, _refused_warm_replay, _warm_patch_trees, _warm_patch_text, _unusable_patch_reason, _git_apply_overlay, _apply_warm_patch_sequence and _warm_replay_report.

Watch out

  • Call _boot_failure before harvest_leaked_artifacts. Harvesting can copy a leaked server.log into output_dir and change the classification.
  • Keep float(x or 0.0) for post_measure_accuracy_min_tput. Don't switch it to to_float, which rejects bools and maps inf/nan to the default.
  • In _warm_patch_text, keep errors="replace", and keep FileNotFoundError (missing_artifact) separate from other OSError (artifact_read_failed).
  • _requested_framework returns None, not "".
  • A successful rollback sets warm_replay_pending = {} rather than merging into it. Keep that branch.
  • The _settle_patch_application persist failure goes from debug to warning. Say so in the PR description.

This reaches cc ≤ 12 / cog ≤ 28 on every target with net ≤ 0 production lines. _run_single_benchmark stays at about 166 lines until a follow-up replaces its 13 kwargs with one round-input record built in _run_reported_round; that record should replace the signature, not sit alongside it. Regenerate scripts/code_metrics_baseline.txt after rebasing.

Test and others added 6 commits October 21, 2026 14:13
…ocating

Rework of the three over-gate baseline functions along the review on #1961.

The move to `_warm_patch_apply.py`, the `_revert_warm_patch_state` rename and
the `phases/prelude.py` import are reverted; every function this PR had
restructured without being over a repo threshold is back as `origin/main` has
it. What is left reaches the thresholds by removing mechanism:

- one process record of facts replaces the three overlapping ones, and one
  `_boot_failure` ladder replaces the copies in the no-workspace and
  failed-measurement paths;
- `_loaded_benchmark_report` gives way to `read_json(..., require_dict=True)`;
- the two timeline validation passes in `_apply_warm_patches` become one, and
  its refusal/report plumbing moves behind named helpers rather than bags;
- `_timeout_failure` and `_detokenizer_stall_failure` become one
  `_reaped_round_failure`; the three warm-replay pending saves become one
  `_save_warm_replay_pending`;
- `_run_once` splits into resolve/materialize/record and `_run_attempt_rounds`,
  which runs the rounds under a single `try/finally`;
- the dead `hasattr(live_shared_state, "set_stop_reason")` guard goes.

Observable: the `_settle_patch_application` pending-state persist failure is
logged at warning rather than debug.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…fault pairs

Two more deletions in the same spirit as the rework commit:

- `_settle_attempt_server_args` and `_after_materialize_config` each spelled out
  the params-then-$FRAMEWORK ladder that `_requested_framework` already is; they
  call it now. The lower-casing at the materialize site is applied to the
  helper's result, so both sites keep their existing behaviour.
- Six `result.setdefault("nonfatal_warnings", [])` / `result[...].append(...)`
  pairs become one `setdefault(...).append(...)` call each.

No behaviour change; ten fewer production lines.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The review asked for no docstring growth. Against `origin/main` this file had
gained 37 docstring lines, all of them on functions that exist only because of
this branch. Their summary lines go away with the restructuring that created
them; the pre-existing functions keep the docstrings their authors wrote
(`baseline.py` is now at 110 docstring lines against main's 112).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`_run_single_benchmark` 98 -> 94 function-lines and `baseline.py` 4163 -> 4102
module-lines. 832 entries, nothing added.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chennyiiis

Copy link
Copy Markdown
Contributor Author

Reworked delete-first on afcc71dcf. Net production lines against the merge base (ba808c37c, which carries #1896, #1998, #1959 and #2046) are -95 (+1409/-1504), down from +658. No new module, and baseline.py ends at 110 docstring lines against main's 112, so docstring growth is negative too. Merged origin/main, never rebased. CI: 40 checks, 0 failures.

Where the five targets land

function Cmetrics ruff cc lines
_run_once 54 -> 16 6 650 -> 107
_apply_warm_patches 52 -> 19 10 416 -> 72
_run_single_benchmark 38 -> under 20 under 5 567 -> 94
_maybe_stop_on_missing_baseline_accuracy -> 19 10 126 -> 108
BaselineExecutor._after_materialize_config -> under 20 7 96 -> 39

Nothing in baseline.py measures 20 or more on Cmetrics; the file's maximum is 19.

Reverted as asked

The move to _warm_patch_apply.py is gone -- the warm-patch code is back in baseline.py, so the logger name does not change and no move-only PR is needed. The _revert_warm_patch_state -> revert_warm_patch_state rename is reverted, and phases/prelude.py is byte-identical to main again.

Delete

  1. Done. _BenchmarkOutput, _BenchmarkOutcome, _refused_benchmark, _benchmark_outcome and _observed_benchmark_outcome are gone. One record of facts survives -- _BenchProcess (returncode, streams, runtime, started_unix, server log text, boot observation, workspace), no failure field and no classification fields. Refusals return early dicts.
  2. Done. _loaded_benchmark_report is gone; the one call site is read_json(report_path, None, require_dict=True) from hyperloom.common.jsonio. I checked the two against each other first: same require_dict refusal, same None default.
  3. Done. All ten of _BaselineRunRequest, _FrameworkArgs, _ScriptOverrides, _RoundSetup, _MaterializedRound, _RoundPatches, _RoundExecution, _PatchSettlement, _AccuracyStageDecision and _refused_round are gone.
  4. Done except one. Every pass-through on the list is inlined and _attach_round_accuracy is folded into _stamp_round_quality. The exception is _measured_round_result, which I did not inline: it is 76 lines and its one caller _run_guarded_round is 24, so inlining puts that caller at ~98 counted lines, over the gate's 80-line threshold and into a new baseline entry. It is a single-use call, so if you would rather have the baseline entry than the helper, say so and I will make the swap.
  5. Done. _stamp_round_patches is gone; its warm_patches_applied write lives in _stamp_warm_patch_outcome.
  6. Done. _baseline_accuracy_reference_is_due is inlined and _adopt_sibling_baseline_accuracy is deleted; the handoff is logged inside _apply_salvaged_accuracy on expected_handoff=True.
  7. Done. All fourteen names are gone -- _WarmPatchTrees, _ScreenedPatches, _WarmPatchPreparation, _WarmPatchSite, _PatchApplyOutcome, _WarmPatchSequence, _MUTATING_APPLY_METHODS, _recorded_patch_roots, _screened_patch_contents, _prepare_warm_patch_run, _refuse_after_snapshot_failure, _refuse_unpersisted_warm_patch_state, _land_warm_patch and _apply_overlay_without_git. _apply_warm_patches and _apply_warm_patch_sequence use plain locals.
  8. Done. The hasattr(live_shared_state, "set_stop_reason") guard in _roll_back_failed_patches was indeed redundant -- SharedState.set_stop_reason is an unconditional method on the class, and the one other caller in this file never guarded it -- so the call is now direct.

Change

  1. Done. One _boot_failure(finished, server_log), your ladder verbatim; _failed_measurement_result and _no_workspace_failure both call it instead of carrying a copy.
  2. Done. _failed_measurement_result, _refuse_nonzero_exit_without_complete_protocol and _nonzero_exit_failure are one path (_failed_round_result) over one shared failed base dict, with the per-error_class fields added on top.
  3. Done. _timeout_failure and _detokenizer_stall_failure are one _reaped_round_failure(output_dir, workspaces_before, started_unix, fields) that does the workspace selection, harvest and envelope once.
  4. Done. _run_once resolves, materializes and records; _run_attempt_rounds runs preflight -> budget -> patches -> lease -> rounds. State travels in the existing common round-kwargs dict with recorder and run_index added, and there is one try/finally for the legacy-patch revert and the lease close instead of the two the old _run_single_round and _run_cold_start_guarded_rounds each had.
  5. Done. _save_warm_replay_pending is your helper; _persist_recipe_snapshot, _settle_patch_application and _roll_back_failed_patches all call it.
  6. Done. _snapshot_warm_patch_trees returns None and raises; the one call site catches the specific errors.

Also deleted, beyond the list

  • _settle_attempt_server_args and _after_materialize_config each spelled out the params-then-$FRAMEWORK ladder that _requested_framework already is; both call it now (the materialize site lower-cases the helper's result, so behaviour is unchanged).
  • Six result.setdefault("nonfatal_warnings", []) / result[...].append(...) pairs became one setdefault(...).append(...) call each.
  • The 37 docstring lines this branch's own helpers had added are gone. Pre-existing functions keep the docstrings their authors wrote.

Keep list

Everything you named is kept, with two exceptions: _route_accuracy_failure_to_enablement and _stop_without_accuracy_reference no longer exist as functions. Both are single-use and inlining them is what brought _maybe_stop_on_missing_baseline_accuracy to 108 lines / Cmetrics 19; the two outcomes themselves are unchanged and the tests that pin them still pass. Tell me if you would rather have them back as named helpers.

Watch-outs

All honoured. _boot_failure is called before harvest_leaked_artifacts in every path. post_measure_accuracy_min_tput keeps float(x or 0.0). _warm_patch_text keeps errors="replace" and keeps FileNotFoundError (missing_artifact) apart from other OSError (artifact_read_failed). _requested_framework still returns None, and the two sites that want a string apply or "" themselves. A successful rollback still sets warm_replay_pending = {} rather than merging.

Declined

  • _run_single_benchmark's 13 kwargs. You scoped the one-record replacement to a follow-up, so it is not in this PR.
  • _measured_round_result, for the 80-line reason above.

Not done

The _settle_patch_application persist failure going from debug to warning still needs to be stated in the PR description. I was told not to edit the description on this pass, so it is in the commit message. Say the word and I will move it.

Tests: 742 passed in actions/executors/tests, 151 in phases plus test_warm_replay.py, no test weakened or deleted. scripts/code_metrics.py --update-baseline lowers two entries (_run_single_benchmark 98 -> 94, baseline.py module-lines 4163 -> 4102) and adds none.

@ZhengGong-amd ZhengGong-amd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #1961 -- refactor(baseline): name how a run applies its patches, and the failures that end it

What it does: Splits the warm-patch apply path, the benchmark round and the missing-accuracy stop in src/hyperloom/orchestrator/actions/executors/baseline.py into smaller helpers and three new NamedTuples (_OverlayText, _BenchmarkRound, _BenchProcess). It lowers or removes 14 entries for that file in scripts/code_metrics_baseline.txt. Behaviour on the success path is unchanged; a few failure-path reasons and log levels change.

Blocking issues: 3

  1. [free:observable-effect-wrong] The Observable effect section misstates two changes and omits two others [verified]
    Problem: Checked by running _apply_warm_patches on the same inputs at base and head (80 scenarios, best-effort be and required req modes).

    • "An empty or non-text patch file now reports unsafe_or_non_text_diff. It previously fell through ... without naming why" is wrong. A non-text patch already reported unsafe_or_non_text_diff at base, in both modes. An empty file in be mode is also unchanged. Only an empty patch_ref file in req mode changes: missing_artifact -> unsafe_or_non_text_diff (baseline.py:1174). The old behaviour did name a reason.
    • "one additional WARNING naming the patch that could not be applied" describes the wrong log line. The new WARNING is this attempt's RESULT_DIR had no accuracy, but salvaged a measured baseline accuracy=%.4f from a sibling attempt (%s) (baseline.py:2247-2253). _apply_salvaged_accuracy now logs it when expected_handoff=False, and the eval-rooted stop reaches it from baseline.py:2089. The base helper did not log. The line has nothing to do with patches.
    • Not stated: a patch_ref that points to a directory now reports artifact_read_failed instead of missing_artifact, in both modes (baseline.py:1164-1166). In req mode the top-level failure reason changes too.
    • Not stated: a hunk with no header in be mode now reports missing_touched_paths with no detail (baseline.py:1179-1180). At base it reported git_apply_failed with git's detail error: patch fragment without header at line 1.
    • Effect #3 (persist failure DEBUG -> WARNING) is correct as written.
      Impact: The release notes would tell operators that non-text patches report a new reason and that a new WARNING names an unapplied patch. Neither is true. They would also say nothing about the two warm_patch_result.patches[].reason values that do change, so a dashboard or alert keyed on missing_artifact or git_apply_failed would stop matching without warning.
      Action: Rewrite Observable effect as these five facts: empty patch_ref in req mode, missing_artifact -> unsafe_or_non_text_diff; directory patch_ref, missing_artifact -> artifact_read_failed in both modes; headerless hunk in be mode, git_apply_failed + detail -> missing_touched_paths with no detail; an eval-rooted stop that salvages sibling accuracy logs the sibling-salvage WARNING; persist failure DEBUG -> WARNING. Write the body against git diff origin/main...HEAD only; every name and number must be reproducible from that diff.
  2. [free:deleted-names-not-on-main] "What was deleted" names code that never existed on main [verified]
    Problem: Each of these returns 0 matches in baseline.py at merge-base ba808c3 (git show ba808c37c:src/hyperloom/orchestrator/actions/executors/baseline.py | grep -c <name>):

    • _failed_measurement_result (also 0 at head), _loaded_benchmark_report, _BenchmarkOutput, _BenchmarkOutcome, _refused_benchmark.
    • _no_workspace_failure and _boot_failure, which the body says replaced "two copies", are both new in this PR (baseline.py:3640, :1656).
    • _roll_back_failed_patches, given as the location of the dead hasattr guard, is also new. At base the guard was inline in _run_once (base baseline.py:2566).
    • _BenchProcess is listed as one of three records "now one record". It goes from 0 references at base to 7 at head (baseline.py:1645), so it is an addition. _OverlayText (:1106) and _BenchmarkRound (:1625) are also new and are not mentioned.
    • The body writes revert_warm_patch_state; the actual name is _revert_warm_patch_state (baseline.py:1038).
      What is accurate relative to main: base computed the server-death check once (base :3616-3618) and repeated the error-text choice inline twice (base :3679, :3691); head moves it into _boot_failure. The inline json.load of benchmark_report.json (base :3730) is replaced by read_json(report_path, None, require_dict=True) (:3593). The hasattr(live_shared_state, "set_stop_reason") guard is removed.
      Impact: The release notes would list five deleted types and helpers that no operator or downstream reader ever had, describe an added record as a consolidation, and leave out the three NamedTuples that main actually gains.
      Action: Replace the section with the main-relative facts above, and add _BenchProcess, _OverlayText and _BenchmarkRound as additions. Write the body against git diff origin/main...HEAD only; every name and number must be reproducible from that diff.
  3. [free:complexity-numbers] The complexity table and baseline count cannot be reproduced [verified]
    Problem: Measured with the tools the metrics gate uses:

    • _run_once 54 -> 16, _apply_warm_patches 52 -> 19, _maybe_stop_on_missing_baseline_accuracy -> 19, and "Highest Cmetrics left in scope: 19". The "before" values match ruff C901 at base. At head, ruff C901 (0.16.2) gives 6 / 10 / 10 and complexipy (8.0.1) gives 9 / 19 / 16. The file maximum at head is cog 29 (_apply_warm_patch_sequence, baseline.py:1300) and ruff cc 12 (_eval_failure_evidence). "Cmetrics" is not defined anywhere in the repo.
    • The Lines column shows "650 -> —". At head the three functions are 107 / 72 / 108 lines (baseline.py:2282, :1401, :2114). _run_once (107) and _maybe_stop_on_missing_baseline_accuracy (108) are still in the function-lines baseline.
    • "Two baseline entries lower, none added." git diff ba808c37c...afcc71dcf -- scripts/code_metrics_baseline.txt removes 10 entries (cc 3, cog 3, function-lines 2, nested 2) and lowers 4 (_run_once 650 -> 107, _run_single_benchmark 567 -> 94, _maybe_stop_on_missing_baseline_accuracy 126 -> 108, module-lines 4197 -> 4102), with none added.
      Impact: The release notes would report complexity figures and a baseline change that nobody can reproduce, and would suggest that every function in scope is now under threshold, which two of them are not.
      Action: Replace the table with ruff cc and complexipy cog, before and after, and actual line counts. State the baseline change as 10 removed, 4 lowered, 0 added, and drop "Cmetrics" and "Highest ... 19". Write the body against git diff origin/main...HEAD only; every name and number must be reproducible from that diff.

Checked: src/hyperloom/orchestrator/actions/executors/baseline.py (_warm_patch_text, _unusable_patch_reason, _apply_warm_patches, _apply_warm_patch_sequence, _apply_salvaged_accuracy, _request_eval_rooted_baseline_stop, _maybe_stop_on_missing_baseline_accuracy, _run_once, _boot_failure, _no_workspace_failure, _save_warm_replay_pending), scripts/code_metrics_baseline.txt, src/hyperloom/orchestrator/phases/prelude.py, live PR body | Ran: gh pr view 1961 --json headRefOid,body; git show/grep of symbols at base and head; ruff C901 and complexipy at base and head; base-vs-head differential of _apply_warm_patches (80 scenarios); git merge origin/main b772e94 (clean); scripts/code_metrics.py --base-ref origin/main on the merged tree (PASSED); pytest on baseline-related tests on the merged tree (pass, apart from one failure from a missing TraceLens install that also fails at merge-base); ruff check and ruff format --check | Base: ba808c3 | Head: afcc71d

Test and others added 6 commits October 21, 2026 22:25
…eline-runs

# Conflicts:
#	scripts/code_metrics_baseline.txt
#	src/hyperloom/orchestrator/actions/executors/baseline.py
Resolve scripts/code_metrics_baseline.txt by keeping main's entries and
applying this branch's removals and lowered values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eline-runs

Only scripts/code_metrics_baseline.txt conflicted. Resolved with the
ratchet rule: whichever side records the lower value wins, an entry the
merge base had and a side dropped is retired, an entry absent from the
base is kept.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…eline-runs

Brings the branch up to origin/main; no path conflicted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…eline-runs

Brings the branch up to origin/main; no path conflicted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Resolve scripts/code_metrics_baseline.txt by keeping main's entries and
applying this branch's removals and lowered values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chaojhou chaojhou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #1961 -- refactor(baseline): name how a run applies its patches, and the failures that end it

What it does: Four units in executors/baseline.py were far over the complexity ceiling: _run_once, _run_single_benchmark, _apply_warm_patches and _maybe_stop_on_missing_baseline_accuracy (BaselineExecutor._after_materialize_config is also split). This PR splits them into named stages inside the same module and deletes the duplicated mechanisms. Each warm patch is now read and screened once. The three boot-failure ladders become one _boot_failure, and three pending-state save blocks become _save_warm_replay_pending. The inline benchmark_report.json load now uses read_json. The PR adds no module and ends 94 production lines shorter. It states six small observable changes: three warm-patch reason strings, one new salvage WARNING, one DEBUG-to-WARNING log, and non-finite accuracy no longer passing the shortcut. I checked each one against the code.

Blocking issues: none

SKIPPED: V4 -- openprs.txt compared #1869, #1276, #1154 and #1032 only partially.

Checked: base bb2da63 vs head 88eb316 of executors/baseline.py, compared unit by unit. Units: _apply_warm_patches -> _warm_patch_trees/_warm_patch_text/_unusable_patch_reason/_screened_overlays/_refuse_warm_replay_before_apply/_snapshot_warm_patch_trees/_apply_warm_patch_sequence/_git_apply_overlay/_warm_replay_report; _run_once -> _settle_attempt_server_args/_run_attempt_rounds/_prepare_round_patches/_roll_back_failed_patches/_round_refused_before_ignition/_run_cold_start_guarded_rounds/_run_guarded_round/_cold_anchor_when_hot_pass_unaffordable/_record_measured_against_warmup/_settle_deferred_accuracy; _run_single_benchmark -> _restart_multi_node_server/_measured_round_result/_record_bringup/_launch_benchmark/_reaped_round_failure/_round_result_from_workspace/_no_workspace_failure/_failed_round_result/_stamp_round_quality/_boot_failure; _maybe_stop_on_missing_baseline_accuracy, _apply_salvaged_accuracy, _run_reported_round, _run_retrying, _after_materialize_config -> _eval_patch_failure. Also read: phases/prelude.py warm-replay producer (1265-1313, 1426-1446), _accuracy_gate.accuracy_meets_floor, common/jsonio.read_json, SharedState.set_stop_reason, every tree-wide caller including tests | Ran: AST unit diff base vs head; a base/head differential of _apply_warm_patches over 9 required/best-effort cases in temp git repos (outputs match except the stated headerless-hunk reason, plus two trivial differences: an extra WARNING log and a skipped empty warm_patches/ directory); git grep for the #1984 opt-out names; git merge-tree against origin/main; Step 7 independent reader re-ran the #1984 grep, the merge-tree check and the two test-file diffs; local pytest could not run on this Windows host (fcntl), CI test shards green at head | Base: bb2da63 | Head: 88eb316 | Branch head 232c693 merges main into the reviewed head: baseline file only, non-baseline diff identical to the reviewed head

LGTM

@chaojhou
chaojhou merged commit 3153699 into main Oct 22, 2026
40 checks passed
@chaojhou
chaojhou deleted the feature/chenyi/cc-baseline-runs branch October 22, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-exception Waives the PR diff budget; added by a maintainer with a reason in the PR description

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants