Skip to content

fix(explore): judge a baseline restatement against the stack it launches on - #1918

Merged
chaojhou merged 1 commit into
mainfrom
fix/explore-noop-filter-per-stack
Oct 19, 2026
Merged

chaojhou merged 1 commit into
mainfrom
fix/explore-noop-filter-per-stack

Conversation

@zoroyihan7

@zoroyihan7 zoroyihan7 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator
  • Description: what and why

    The baseline-noop filter from fix(explore): skip a variant or warm replay that only restates the baseline launch #1903 judges every variant once, before the round, against the observed launch of the stack the round opens on. Variants stack within a round, so after a KEEP changes a setting, a later variant that restated that setting's observed value is a real change to the stack it launches on (observed --kv-cache-dtype fp8; grid auto then fp8: fp8 was dropped even after auto KEEPed). This keeps the filter's verdict but applies it where the round already grades each variant, at the variant's turn against the stack as it stands then, next to fix(explore): do not re-measure a variant the session already judged on the same stack #1916's measured-variant check and using the same stack record (stack_of_measured(_measured_against())):

    • a variant ahead of every other variant that survives the grid-shaping filters (multi-node, aiter, compatibility, skip list) can only launch on the opening stack, so a restatement there is still dropped before the round and before the serving lease (an all-restatement grid, even one preceded by a filtered-out variant, is still explore_grid_exhausted and takes no serving lease);
    • every other variant is judged at its turn by the same filter_baseline_noop_variants, against the current stack_*. The observed launch is trimmed by observed_launch_after: the observed value of a setting, env, removal or unset that a KEEP has changed (added, changed or cleared; a boolean flag and its --no- spelling count as one setting) no longer counts, and every other observed value still does. A restatement is therefore released only by a KEEP that changed what it restates; behind an unrelated KEEP (--max-num-seqs 256) it is still skipped as baseline_noop, and a switch of the stack to replace mode releases nothing by itself: args are compared as the stack actually launches them, so only the settings a KEEP changed stop being trusted;
    • a round whose every runnable variant was either already measured (fix(explore): do not re-measure a variant the session already judged on the same stack #1916) or a restatement of the current stack is answered (succeeded), not failed: one tally counts both turn-time skips;
    • in-round duplicates are judged at their turn against the fingerprints this round actually launched, so a restatement listed twice whose first copy was only skipped still runs after a KEEP releases it.
  • Linked issue(s): Fixes Explore drops a variant that restates the opening stack even after a KEEP has moved the stack #1917

  • Tests: added/updated? commands run?

    Added to test_explore_executor.py (executor-level, real filter, observed launch stubbed to --kv-cache-dtype fp8):

    • test_a_variant_that_was_the_stack_runs_once_a_keep_has_moved_the_stack -- auto then fp8: both launch and both have ledger rows. Fails at fix(explore): do not re-measure a variant the session already judged on the same stack #1916's head.
    • test_a_restatement_stays_skipped_after_a_keep_on_an_unrelated_setting -- the reviewer's case: a KEEP of --max-num-seqs 256 ahead of fp8 while fp8 is observed; fp8 is still skipped as baseline_noop. (Passes at fix(explore): do not re-measure a variant the session already judged on the same stack #1916's head, where the up-front filter drops it; it fails on the earlier version of this PR, which released it.)
    • test_a_variant_that_is_the_stack_is_skipped_while_the_stack_has_not_moved -- a leading restatement and one behind a REVERT are both skipped as baseline_noop; only the real change launches.
    • test_a_grid_that_only_restates_the_stack_is_exhausted_before_the_round -- nothing launches and the grid reports exhausted.
    • test_a_restatement_dropped_up_front_does_not_claim_a_later_identical_variant -- fp8, auto, fp8: auto and the last fp8 launch. Fails at fix(explore): do not re-measure a variant the session already judged on the same stack #1916's head.
    • test_a_restatement_that_repeats_a_launch_of_this_round_is_a_round_dup -- after a KEEP, fp8 runs once; a second fp8 is a round_dup. Fails at fix(explore): do not re-measure a variant the session already judged on the same stack #1916's head.
    • test_a_restatement_stays_skipped_after_a_keep_that_switches_the_stack_to_replace_mode -- a removal KEEP that moves the stack to replace mode, followed by an unrelated fp8 restatement while fp8 is observed: fp8 is still skipped as baseline_noop.
    • test_a_restatement_runs_after_a_keep_in_replace_mode_that_removes_what_it_restates -- a replace-mode KEEP that removes --kv-cache-dtype: the fp8 restatement is now a real change and launches.
    • test_a_restatement_twin_that_was_only_skipped_has_not_claimed_the_launch -- seqs, fp8, auto, fp8: the second fp8 runs after auto KEEPs. Fails on the previous version.
    • test_a_round_of_measured_and_restated_variants_is_answered_not_failed -- round 1 measures --max-running-requests 48; round 2 is [mrr_48, fp8] with fp8 observed: nothing measured, succeeded. Fails on the previous version.
    • test_restatements_left_leading_by_a_filter_are_dropped_before_the_serving_lease -- a skip-listed variant ahead of two restatements: no serving lease, explore_grid_exhausted. Fails on the previous version.
    • test_a_restatement_left_leading_by_the_skip_list_is_skipped_at_its_turn -- the operator skip list removes auto after the up-front drop, so fp8 meets the unmoved stack and is skipped at its turn.
    • test_observed_launch_after_drops_only_what_the_stack_changed -- the helper: unrelated setting, changed setting, removed setting, env, unset, cleared removal/unset, a negated boolean spelling, args mode.

    Mutations, each killed by at least one test: observed launch never trimmed; observed launch always emptied; removals ignored; env changes ignored; no turn-time check; no up-front drop of leading restatements; every restatement dropped up front; the stack read at its opening instead of now.

    pytest -n 8 over the 44 test files that reference the explore executor, the delegate path, explore_search, the baseline-noop filter, the orchestration prompt or the intent router (1897 passed; test_kernel_request_handlers_and_tracelens_analysis_atom_paths_in_sync fails here only because TraceLens is not installed in my environment), plus ruff check, ruff format --check and lint-imports.

  • Size/complexity triggers crossed: split, or why the shape is right:

    ExploreExecutor.__call__ gains a per-turn check (a closure like _measured_against, one if ...: continue) and the leading-drop lines; it has to sit in the loop to see the stack as each KEEP advances it, the same reason as fix(explore): do not re-measure a variant the session already judged on the same stack #1916's check. The observed_launch_after helper is its own function. Labelled baseline-raise for the units that grow, which include fix(explore): do not re-measure a variant the session already judged on the same stack #1916's.

  • If this simplifies or refactors: n/a

  • Observable effect: what an operator will now see, and what the old behaviour cost them (if none, why the change is unobservable):

    A variant that restated the opening stack but sits behind a KEEP that changed what it restates now runs and gets a verdict. Before, that experiment was silently skipped as baseline_noop, so the round never measured reverting a setting the KEEP had changed. A restatement behind a REVERT or behind a KEEP of an unrelated setting is skipped as baseline_noop, now logged and listed in skipped_dup at its turn rather than before the round. A variant repeating a launch this round already made is a round_dup at its turn. The explore grid log line's leading baseline_noop count covers only the drops before the round; skipped_dup in the result records every skip.

  • Breaking changes: no

  • PR addresses single concern: yes

  • Root cause is upstream (Magpie/TraceLens/GEAK/IntelliKit/AgentKernelArena), ticket filed: no, root cause is in Hyperloom (fix(explore): skip a variant or warm replay that only restates the baseline launch #1903).

@xiaofei-zheng could you review? This is a follow-up to #1903.

🤖 Generated with Claude Code

@zoroyihan7
zoroyihan7 requested a review from a team as a code owner October 15, 2026 12:59
@zoroyihan7 zoroyihan7 added the type:bug Something is broken or not working as expected label Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Code metrics gate: PASSED with waived findings (baseline-raise)

Judged: the 3 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 1 0 69 +0
Cognitive complexity fails > 30 0 1 0 275 +0
Function length (lines) fails > 80 0 1 0 414 +0
Nested block depth fails > 5 0 0 0 26 +0
Parameter count fails > 5 0 0 0 95 +0
Module length (lines) warns > 800, fails > 1200 0 1 0 51 +0
Duplicated lines per file fails > 0 0 0 0 97 +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

Worse than the baseline (waived by the baseline-raise label): 4

Unit Dimension Baseline Now
src/hyperloom/orchestrator/actions/executors/explore.py:807 ExploreExecutor.__call__ Cognitive complexity 369 386
src/hyperloom/orchestrator/actions/executors/explore.py:807 ExploreExecutor.__call__ Cyclomatic complexity 76 83
src/hyperloom/orchestrator/actions/executors/explore.py:807 ExploreExecutor.__call__ Function length (lines) 1124 1164
src/hyperloom/orchestrator/actions/executors/explore.py:1 Module length (lines) 1880 2060

How to fix

  • New or worse: split the unit (extract a function, a class, a module) until it is back under the limit, or no worse than its recorded value. The baseline cannot absorb a new violation: CI refuses any baseline entry added or raised relative to the base branch.
  • Baseline out of date: something improved. Run python scripts/code_metrics.py --update-baseline and commit scripts/code_metrics_baseline.txt; the command only lowers or removes entries.
  • Override: the baseline-raise PR label waives new, worse and baseline-growth findings and the failing design checks (they stay listed here). Use it only with the reason in the PR description; it waives nothing else.
  • Tools for a local run: pip install ruff==0.16.2 complexipy==8.0.1 vulture==2.16 and npm install -g jscpd@5.4.1 (or point CODE_METRICS_JSCPD at another jscpd command, such as npx --yes jscpd@<version>).

Already over at the base (backlog, not this change's): 1

Unit Dimension Base Now
src/hyperloom/orchestrator/actions/executors/explore.py:585 filter_baseline_noop_variants Function length (lines) 112 112
101 findings in files this change does not touch

Outside this change (informational): 101

Unit Dimension Baseline Now
src/hyperloom/orchestrator/enablement/recipe/projections.py project_launch_evidence Cognitive complexity absent 36
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/hyperloom_kb/schema.py FieldDeclaration.__post_init__ Cognitive complexity absent 32
src/kernelforge/cli/forge_loop_command.py _prepare_measurement_driver Cognitive complexity absent 36
src/kernelforge/cli/forge_loop_command.py _read_kb_warm_start Cognitive complexity absent 40
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 111
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/cli/__init__.py _resume_session Function length (lines) absent 170
src/hyperloom/inference_optimizer/cli/__init__.py _seed_fresh_session Function length (lines) absent 170
src/hyperloom/inference_optimizer/multi_node/cli.py _restart_multinode Function length (lines) absent 107
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/cli/forge_loop_command.py _RunReporter.build_result Function length (lines) absent 91
src/kernelforge/cli/forge_loop_command.py _prepare_measurement_driver Function length (lines) absent 136
src/kernelforge/cli/forge_loop_command.py _read_kb_warm_start Function length (lines) absent 149
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 184
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._run_supervisor_review Function length (lines) absent 88

...and 76 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.

@zoroyihan7

Copy link
Copy Markdown
Collaborator Author

@ZhengGong-amd could you review this one too? It fixes a gap left by #1903: a restatement of the starting stack is judged against the stack each variant launches on, so after an in-round KEEP it is no longer dropped as a no-op. It overlaps #1916 in explore.py; whichever lands second I will rebase.

@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 #1918 -- fix(explore): judge a baseline restatement against the stack it launches on

What it does: the baseline-noop filter from #1903 drops a variant that restates the observed launch before the round; this PR keeps that verdict only while the stack has not moved. A restatement with no variant ahead of it is still dropped up front, and any other restatement is decided at its turn by the new BaselineNoopPlan (_baseline_noop_plan.py): skipped as baseline_noop while the stack equals the opening one, otherwise run unless another variant of the round launches the same fingerprint.

Blocking issues: 1

  1. [free:any-keep-releases-restatement] A KEEP on an unrelated setting releases every later restatement, which then measures a launch identical to its stack [verified]
    Problem: turns treats the stack as moved when any of extra_server_args, extra_envs, remove_args, unset_envs, args_mode differs from the opening stack (src/hyperloom/orchestrator/actions/executors/_baseline_noop_plan.py:86), and runs the restatement. Every KEEP rewrites stack_extra_args, so with an observed --kv-cache-dtype fp8 and grid [--max-num-seqs 256 (KEEP), --kv-cache-dtype fp8] the fp8 variant runs after the max-num-seqs KEEP although the stack it launches on still uses fp8, so its launch resolves to the stack's own. Base dropped it as baseline_noop. The tests cover only a KEEP on the restated setting itself (auto then fp8).
    Impact: a full decision round is spent measuring the stack against itself whenever a restatement follows an unrelated KEEP; the description's "Restatements that cannot meet a moved stack are skipped exactly as before" and the log line "a KEEP has moved it" do not hold for that case.
    Action: release a restatement only when a KEEP so far changed a setting, env, removal or unset that the restatement names (or re-judge it with the filter against the stack it launches on), and add a test with an unrelated KEEP ahead of a restatement.

Checked: _baseline_noop_plan.py (slot, drop_leading, turns); explore.py dedup, grid-shaping filters and the variant loop; filter_baseline_noop_variants; the new tests in test_explore_executor.py; scripts/code_metrics_baseline.txt | Ran: git show / git grep at head and base, gh api for checks and comments | Base: d49e019 | Head: 0c178b6

@chaojhou

Copy link
Copy Markdown
Collaborator

Follow-up to my change request, after triaging #1917 on main 7e57b1e8f:

@zoroyihan7
zoroyihan7 force-pushed the fix/explore-noop-filter-per-stack branch from 0c178b6 to 7d9e2a8 Compare October 18, 2026 12:45
@zoroyihan7 zoroyihan7 added the baseline-raise Waives new, worse and baseline-growth code-metrics findings; reason required in the PR description label Oct 18, 2026
@zoroyihan7

Copy link
Copy Markdown
Collaborator Author

Reworked (head 7d9e2a8), now on top of #1916's branch (the diff includes that commit until it merges; the description says so).

  • Admission rule. A restatement is released only by a KEEP that changed what it restates. The up-front drop is kept only for restatements ahead of every other variant; every other variant is judged at its turn by the same filter_baseline_noop_variants against the current stack_*, with the observed launch trimmed by a new helper observed_launch_after: the observed value of a setting, env, removal or unset that a KEEP added, changed or cleared (a boolean flag and its --no- spelling count as one setting) no longer counts, every other observed value still does. Regression test as requested: a KEEP of --max-num-seqs 256 ahead of an fp8 restatement while fp8 is observed leaves fp8 skipped as baseline_noop; it fails on the previous version of this PR. auto KEEP then fp8 still runs.
  • No separate bookkeeping. BaselineNoopPlan / _baseline_noop_plan.py and its slot/turns are removed. The decision is made per turn against the current stack, in the same loop position and from the same stack record (stack_of_measured(_measured_against())) as fix(explore): do not re-measure a variant the session already judged on the same stack #1916's measured-variant check, the way filter_context_copy_drafts does. A restatement now takes part in the up-front in-round dedup like any variant (so one listed twice is a round_dup of its first occurrence).
  • Ordering. Rebased on current main and on fix(explore): do not re-measure a variant the session already judged on the same stack #1916; fix: judge explore variants and warm recipes by what they change about the running launch #1908 is still open and not waited for.

Tests: 8 executor/helper tests added (new ones fail on #1916's head or on the earlier version of this PR as noted in the description), 8 mutants of the new logic each killed; 44 test files around explore/delegate/prompt/router: 1897 passed (one unrelated failure: TraceLens is not installed in my environment); ruff and lint-imports clean. The code-metrics gate reports the explore.py / intent_router.py units as worse than the baseline (shared with #1916), so I added baseline-raise.

@chaojhou please take another look.

@zoroyihan7
zoroyihan7 requested a review from chaojhou October 18, 2026 12:45
@zoroyihan7

Copy link
Copy Markdown
Collaborator Author

Follow-up (head 439bdfc): a native KEEP that adds or clears a removal or unset can persist the stack's launched args and switch its args mode to replace. The first version of the per-turn check then trusted none of the observed launch, so a later restatement of an unrelated opening value ran instead of being skipped as baseline_noop.

The opening and the current stack are now compared with their args composed as launched (the recipe's inherited args, the removals and the args mode applied), so the mode switch alone moves nothing and only what the KEEP actually changed is released. New tests drive the real KEEP path: a removal KEEP that flips the stack to replace followed by an unrelated fp8 restatement is still skipped as baseline_noop, and a KEEP that removes --kv-cache-dtype releases the fp8 restatement; the first fails on the previous head. 44 related test files: 1899 passed (the one unrelated TraceLens failure aside), ruff and lint-imports clean.

Known limit, unchanged: a restatement listed twice in one grid is deduplicated to its first occurrence before the round, so if the first copy is skipped at its turn the second is not retried after a later KEEP.

@zoroyihan7
zoroyihan7 force-pushed the fix/explore-noop-filter-per-stack branch from 7d9e2a8 to 439bdfc Compare October 18, 2026 13:08

@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 #1918 -- fix(explore): judge a baseline restatement against the stack it launches on

What it does: stacked on #1916. A restatement of the opening launch ahead of every other variant is still dropped up front; every other variant is checked at its turn, just before #1916's already_measured check and from the same stack record, by filter_baseline_noop_variants against the current stack, with the observed launch trimmed by observed_launch_after so only what a KEEP actually changed (a --x / --no-x pair counts as one setting; args compared as launched, so a switch to replace mode alone moves nothing) is no longer trusted. My previous items are fixed: an unrelated KEEP no longer releases a restatement (pinned by the new test), BaselineNoopPlan is gone and the decision is made per turn against the current stack, and the PR is ordered after #1916.

Blocking issues: 1

  1. [D] A restatement skipped at its turn turns a round #1916 settles as succeeded into failed [verified]
    Problem: #1916 marks a round answered (status succeeded) when every runnable variant was skipped as ALREADY_MEASURED (answered = bool(runnable) and ... == len(runnable)). Before this PR every restatement was dropped before runnable was built; now only the leading ones are (explore.py:1041-1044). A restatement after any other variant stays in runnable, is skipped as baseline_noop at its turn (:1273-1275), and is not counted, so answered is False, nothing was measured, and the status falls through to failed. src/hyperloom/orchestrator/actions/executors/explore.py:2008
    Impact: reproduced. Round 1 measures --max-running-requests 48; round 2 runs [mrr_48 (same launch), --kv-cache-dtype fp8] with fp8 observed on the stack. Head: status=failed, error_class=None, skipped mrr_48 already_measured, v_fp8 baseline_noop. #1916's head on the same input: succeeded. A failed explore is unpromotable, so the round goes through handle_unpromotable_result, records a failed attempt and a last_action_failures entry, and its explore_search_update is not promoted, for a round that had nothing left to measure.
    Action: decide answered over the variants that reached the measured check: count a turn-time baseline_noop skip with ALREADY_MEASURED, or keep one runnable-vs-skipped tally both checks feed. Take the up-front "leading" drop after the grid-shaping filters (multi-node, aiter, compatibility, skip list) rather than on the raw grid, so a restatement left leading by those filters is still dropped before the lease. Add an executor test for this grid.

Non-blocking:

  • The disclosed limit: a restatement listed twice is recorded as round_dup of a twin that never launched (grid [seqs, fp8_a, auto, fp8_b]: after the auto KEEP, fp8_b is a real change but never runs). In-round dedup that blocks only fingerprints launched this round would remove it.
  • The narrowed release frees only settings a KEEP named; a KEEP that changes how the engine resolves another setting (spec-decode or dp-attention moving cuda_graph_max_bs / chunked_prefill_size) leaves that opening observed value trusted.
  • "an all-restatement grid is still explore_grid_exhausted and takes no serving lease" holds only when no other variant precedes the restatements in the raw grid; same root cause as item 1.

Checked: observed_launch_after and _launched_stack; the turn-time check's position and stack record relative to _already_measured; the up-front leading drop; answered and the status fall-through; writeback's handling of a failed explore; the previous blocker and both follow-up items | Ran: pytest on the restatement tests at head (34 pass; the one failure is the Windows-only overlay-path test this PR does not touch); executor probes for an unrelated KEEP, same-setting KEEP, --no- spelling, removal and unset KEEPs, env KEEP, replace-mode switch, a duplicated restatement, and the measured-plus-restatement round on head and #1916's head | Base: 4cebf50 (#1916 head) | Head: 439bdfc

…hes on

The baseline-noop filter judged every variant once, before the round, against
the launch observed when the round opened. Variants stack within a round, so
after a KEEP changed a setting, a later variant restating that setting's
observed value is a real change to the stack it launches on, and was dropped.

A variant ahead of every other one can only launch on the opening stack and is
still dropped before the round. Every other variant is judged at its turn
against the stack as it stands then: the observed value of a setting, env,
removal or unset that a KEEP changed no longer counts, and every other
observed value still does, so a restatement behind an unrelated KEEP is still
skipped as baseline_noop.

Builds on the per-turn measured-variant check of the previous change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@zoroyihan7
zoroyihan7 force-pushed the fix/explore-noop-filter-per-stack branch from 439bdfc to a8c4aac Compare October 19, 2026 10:40
@zoroyihan7

Copy link
Copy Markdown
Collaborator Author

Thanks for the re-review. Rebased onto main (#1916 is in it) and pushed a8c4aac; CI is green.

  1. [D] Fixed. answered is now decided over the variants that reached the measured check: a turn-time baseline_noop skip and an already_measured skip feed one tally, so your grid (round 1 measures --max-running-requests 48; round 2 [mrr_48, --kv-cache-dtype fp8] with fp8 observed) settles succeeded with nothing measured. The up-front drop of leading restatements now runs after the multi-node, aiter, compatibility and skip-list filters, so a restatement left leading by them is still dropped before the serving lease. New executor tests: test_a_round_of_measured_and_restated_variants_is_answered_not_failed and test_restatements_left_leading_by_a_filter_are_dropped_before_the_serving_lease (no lease, explore_grid_exhausted). Both fail on the previous head, for the status and the lease respectively.
  2. Third bullet (all-restatement grid behind a filtered-out variant): same root cause as [D], fixed by the same move and covered by the second test above.
  3. First bullet (duplicated restatement): fixed. In-round duplicates are judged at their turn against the fingerprints this round actually launched, so a twin that was only skipped no longer claims the launch. test_a_restatement_twin_that_was_only_skipped_has_not_claimed_the_launch ([seqs, fp8_a, auto, fp8_b]: fp8_b runs after the auto KEEP) fails on the previous head.
  4. Second bullet (a KEEP that changes how the engine resolves another setting, e.g. spec-decode or dp-attention moving cuda_graph_max_bs / chunked_prefill_size): not implemented, out of scope here. Knowing which settings a KEEP moves implicitly needs the engine's own resolution rules per framework and model, which this filter does not have; any table I wrote here would be a guess that goes stale with the engine. The filter judges what a KEEP named; a restatement of an implicitly moved value stays skipped, which costs one re-measure of a no-op at worst. It would be a separate change if we want to take it on.

@zoroyihan7
zoroyihan7 requested a review from chaojhou October 19, 2026 10:48
@zoroyihan7

Copy link
Copy Markdown
Collaborator Author

Description fixed: it no longer says an args-mode switch distrusts every observed value. It now states the current behaviour (a switch to replace mode releases nothing by itself; args are compared as the stack launches them, so only settings a KEEP changed stop being trusted), and the test list includes the two replace-mode tests (test_a_restatement_stays_skipped_after_a_keep_that_switches_the_stack_to_replace_mode, test_a_restatement_runs_after_a_keep_in_replace_mode_that_removes_what_it_restates). No code change.

On simplifying the up-front drop: it is kept only so a grid that does nothing but restate the stack (after the grid-shaping filters) is exhausted before it takes a serving lease; the turn-time check alone would decide the same variants correctly but after the lease is acquired. If you prefer the single turn-time path, I can fold it in a follow-up.

@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 #1918 -- fix(explore): judge a baseline restatement against the stack it launches on

What it does: the baseline-noop filter from #1903 ran once before the round against the opening observed launch, so a variant that restated the opening stack was dropped even after an in-round KEEP had changed the restated setting, and a second copy was deduplicated against a first copy that never launched. In ExploreExecutor.__call__, this PR now drops only the restatements that still lead the grid after the shaping filters, before the serving lease is taken. Every other variant is judged at its turn against the current stack (observed_launch_after trims from the observed launch what a KEEP changed). In-round dedup now runs at the turn against fingerprints this round actually launched. A round answered entirely by already-measured or restated variants is counted as succeeded.

Blocking issues: 0

The [X2] description blocker from the previous pass is resolved. The PR body now states that a switch to replace mode releases nothing by itself: args are compared as the stack launches them, so only the settings a KEEP changed stop being trusted. That matches observed_launch_after (_launch_restatement.py:65-93). The test list now includes test_a_restatement_stays_skipped_after_a_keep_that_switches_the_stack_to_replace_mode and test_a_restatement_runs_after_a_keep_in_replace_mode_that_removes_what_it_restates, and their listed behaviour matches the test bodies. Code is unchanged (head still a8c4aac).

On keeping the up-front drop: the reason given holds. A grid that only restates the stack has to be exhausted before the serving lease is taken, and the turn-time check runs after the lease. No change is needed here.

The three blockers from the review at 439bdfc remain resolved at this head:

  • The answered tally now counts both turn-time skips (explore.py:2009), and the leading drop runs after the skip, aiter, compatibility and multi-node filters (explore.py:1079). Probe: round 2 [fp8, mrr_48, fp8, mrr_48] after mrr_48 was measured returns succeeded with no launch. With a skip-listed leader, no lease is taken and explore_grid_exhausted is True.
  • In-round dedup is now keyed on launched_fps (explore.py:1266, 1327). Grid [seqs, fp8, auto, fp8] launches [seqs, auto, fp8], so both cases in #1917 hold.
  • The branch is now one commit on main tip ef93838. git merge-tree against current main 330d322 is still clean, and CI at a8c4aac shows 33 pass, 7 skipping, 0 failed.

Not blocking: on the scope reply to the implicitly moved settings (spec-decode / dp-attention resolving cuda_graph_max_bs or chunked_prefill_size), leaving it out of this PR is reasonable, but the stated cost is reversed. After such a KEEP, the engine no longer runs at the observed value, so a variant that restates it would change the launch. Skipping it as baseline_noop drops a real candidate unmeasured; it does not "re-measure a no-op". The skip is visible in skipped_dup, so it is not silent. Worth a follow-up issue rather than a change here.

SKIPPED: V4 -- openprs.txt is PARTIAL for #2004, #1907 and #1869 (only their first 100 files were compared), and only the newest 100 open PRs were compared. Overlap there is unchecked.

Checked: explore.py at a8c4aac (leading drop 1079-1100, _launched_stack/_restates_stack 1155-1197, the turn loop 1259-1327, answered 2009, explore_grid_exhausted 2045), observed_launch_after (_launch_restatement.py:65-93), filter_baseline_noop_variants, _already_measured, issue #1917, tree-wide git grep for skipped_dup / session_budget_untested / observed_launch_after | Ran: 39 restatement/stack tests from test_explore_executor.py on an exported head tree (38 pass; the 1 failure is the Windows-only overlay-path test, which also fails on base); the same tests on base ef93838 (7 new tests fail); 2 executor probes (measured + restated round -> succeeded; failed launch + restatement + twin -> failed with round_dup); ruff C901/PLR0913 at head and base (__call__ 79 -> 83, already over at base, baseline-raise with reason); git merge-tree --write-tree origin/main a8c4aacba; gh pr checks 1918 | Base: ef93838 | Head: a8c4aac

LGTM

chennyiiis pushed a commit that referenced this pull request Oct 20, 2026
…lore

Carries #1918 and #1984 into the rewritten round by hand rather than by
taking either side of the conflict.

#1918 judges a baseline restatement against the stack it launches on, and
the rewrite had restructured exactly that code. In the round's new shape:
the grid keeps only the restatements ahead of every other variant
(``_past_the_opening_restatements``), each later variant is judged at its
turn against the stack a KEEP has moved (``_ExploreRound.restates_the_stack``,
over ``observed_launch_after``), an in-round duplicate is one whose
fingerprint this round actually launched (``launched_already`` /
``record_launch``), and a round whose variants were all answered without
measuring succeeds.

#1984 removes the accuracy-eval opt-out: ``_explore_eval_disabled``, the
``disable_run_eval`` task param, the ``SharedState.eval_disabled`` read and
the forced ``RUN_EVAL=false`` warmup variant are gone; the decision round
still skips eval when a warmup took the score.

``_variant_control_fields``, the fingerprint stamping and the baseline-noop
skip record move to ``_variant_grid``, which owns the variant grid, keeping
``explore.py`` shorter than the base branch's.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

baseline-raise Waives new, worse and baseline-growth code-metrics findings; reason required in the PR description type:bug Something is broken or not working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explore drops a variant that restates the opening stack even after a KEEP has moved the stack

2 participants