Skip to content

feat: enable cycle estimation and allocation exclusion by default#461

Draft
not-matthias wants to merge 1 commit into
mainfrom
cod-2950-enable-cycle-estimationexclude-allocators-in-runner-for
Draft

feat: enable cycle estimation and allocation exclusion by default#461
not-matthias wants to merge 1 commit into
mainfrom
cod-2950-enable-cycle-estimationexclude-allocators-in-runner-for

Conversation

@not-matthias

Copy link
Copy Markdown
Member

Summary

Graduate --cycle-estimation and --exclude-allocations out of the experimental flag set so both simulation behaviors are enabled for everyone by default.

  • Both are now normal (non-experimental) options with default_value_t = true.
  • They remain toggleable escape hatches: --cycle-estimation=false / --exclude-allocations=false (or env CODSPEED_CYCLE_ESTIMATION, CODSPEED_EXCLUDE_ALLOCATIONS) disable them.
  • Dropped from the Experimental help heading and no longer trigger the experimental-flags warning.
  • --experimental-fair-sched is intentionally left untouched (still experimental, default off).

Changes

File Change
src/cli/shared.rs Add cycle_estimation / exclude_allocations toggleable bools (default true, require_equals) to ExecAndRunSharedArgs
src/cli/experimental.rs Remove both from ExperimentalArgs; only experimental_fair_sched remains
src/cli/run/mod.rs, src/cli/exec/mod.rs Read the new shared fields
src/executor/config.rs OrchestratorConfig::test() defaults both true

Behavior note

Runner.exclude_allocations in upload metadata now serializes true on every simulation run (previously omitted via skip_serializing_if). This is the intended signal, just always present now.

Verification

  • cargo build, cargo fmt --check, cargo clippy --all-targets clean.
  • Verified via the built binary: --cycle-estimation, --cycle-estimation=false, and --exclude-allocations=false all parse; help lists both as normal options.
  • Pre-existing Unsupported system valgrind-executor test failures are environment-gated (unsupported valgrind host) and unrelated to this change.

Graduate --cycle-estimation and --exclude-allocations out of the
experimental flag set. They are now normal, default-on options that
can be disabled with --cycle-estimation=false / --exclude-allocations=false
(env: CODSPEED_CYCLE_ESTIMATION, CODSPEED_EXCLUDE_ALLOCATIONS).

--experimental-fair-sched remains experimental.
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown

Greptile Summary

This PR makes cycle estimation and allocation exclusion default-on runner options. The main changes are:

  • Adds shared run/exec flags for cycle_estimation and exclude_allocations.
  • Removes the matching experimental fields and warning entries.
  • Passes the new shared values into orchestrator config.
  • Updates test config defaults to enable both behaviors.

Confidence Score: 4/5

The changed CLI and upload metadata paths need fixes before merging.

  • Existing experimental flag names can break current CI invocations.
  • Existing experimental env overrides can be ignored after the default flip.
  • excludeAllocations now changes upload hashes for all runs without a metadata migration.

src/cli/shared.rs, src/cli/experimental.rs, src/upload/interfaces.rs

Important Files Changed

Filename Overview
src/cli/shared.rs Adds default-on shared flags, but needs compatibility handling for the old experimental names and metadata-hash impact.
src/cli/experimental.rs Removes the experimental fields and warning entries, which makes old flag names unavailable.
src/cli/run/mod.rs Passes the new shared defaults into run orchestrator config.
src/cli/exec/mod.rs Passes the new shared defaults into exec orchestrator config.
src/executor/config.rs Updates test defaults to match the new default-on behavior.

Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
src/cli/shared.rs:117-126
**Old Cycle Flag Breaks**

Existing jobs that still pass `--experimental-cycle-estimation` now fail argument parsing because the old field was removed without an alias or hidden compatibility option. Existing jobs that set `CODSPEED_EXPERIMENTAL_CYCLE_ESTIMATION=false` are worse: the env var is ignored and the new default enables cycle estimation anyway.

### Issue 2 of 3
src/cli/shared.rs:129-138
**Old Allocation Override Ignored**

Existing jobs that still pass `--experimental-exclude-allocations` now fail argument parsing because the old field was removed without an alias or hidden compatibility option. Existing jobs that set `CODSPEED_EXPERIMENTAL_EXCLUDE_ALLOCATIONS=false` are silently changed to the new default, so uploads send `excludeAllocations: true` even though the job asked to keep allocation time included.

### Issue 3 of 3
src/cli/shared.rs:132
**Upload Hash Changes Globally**

Defaulting `exclude_allocations` to `true` makes `Runner.excludeAllocations` serialize for every run, so the upload metadata hash changes for the same benchmark invocation even when users did not opt in. The upload metadata contract treats this field as an opt-in serialized signal, so this needs a metadata-version migration or another compatibility path to avoid mixing old and new hash semantics.

Reviews (1): Last reviewed commit: "feat: enable cycle estimation and alloca..." | Re-trigger Greptile

Comment thread src/cli/shared.rs
Comment on lines +117 to +126
#[arg(
long,
env = "CODSPEED_CYCLE_ESTIMATION",
default_value_t = true,
default_missing_value = "true",
num_args = 0..=1,
require_equals = true,
action = clap::ArgAction::Set
)]
pub cycle_estimation: bool,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Old Cycle Flag Breaks

Existing jobs that still pass --experimental-cycle-estimation now fail argument parsing because the old field was removed without an alias or hidden compatibility option. Existing jobs that set CODSPEED_EXPERIMENTAL_CYCLE_ESTIMATION=false are worse: the env var is ignored and the new default enables cycle estimation anyway.

Knowledge Base Used: CLI Commands

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/shared.rs
Line: 117-126

Comment:
**Old Cycle Flag Breaks**

Existing jobs that still pass `--experimental-cycle-estimation` now fail argument parsing because the old field was removed without an alias or hidden compatibility option. Existing jobs that set `CODSPEED_EXPERIMENTAL_CYCLE_ESTIMATION=false` are worse: the env var is ignored and the new default enables cycle estimation anyway.

**Knowledge Base Used:** [CLI Commands](https://app.greptile.com/codspeed/-/custom-context/knowledge-base/codspeedhq/codspeed/-/docs/cli-commands.md)

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Codex

Comment thread src/cli/shared.rs
Comment on lines +129 to +138
#[arg(
long,
env = "CODSPEED_EXCLUDE_ALLOCATIONS",
default_value_t = true,
default_missing_value = "true",
num_args = 0..=1,
require_equals = true,
action = clap::ArgAction::Set
)]
pub exclude_allocations: bool,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Old Allocation Override Ignored

Existing jobs that still pass --experimental-exclude-allocations now fail argument parsing because the old field was removed without an alias or hidden compatibility option. Existing jobs that set CODSPEED_EXPERIMENTAL_EXCLUDE_ALLOCATIONS=false are silently changed to the new default, so uploads send excludeAllocations: true even though the job asked to keep allocation time included.

Knowledge Base Used:

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/shared.rs
Line: 129-138

Comment:
**Old Allocation Override Ignored**

Existing jobs that still pass `--experimental-exclude-allocations` now fail argument parsing because the old field was removed without an alias or hidden compatibility option. Existing jobs that set `CODSPEED_EXPERIMENTAL_EXCLUDE_ALLOCATIONS=false` are silently changed to the new default, so uploads send `excludeAllocations: true` even though the job asked to keep allocation time included.

**Knowledge Base Used:**
- [CLI Commands](https://app.greptile.com/codspeed/-/custom-context/knowledge-base/codspeedhq/codspeed/-/docs/cli-commands.md)
- [Upload flow](https://app.greptile.com/codspeed/-/custom-context/knowledge-base/codspeedhq/codspeed/-/docs/upload.md)

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Codex

Comment thread src/cli/shared.rs
#[arg(
long,
env = "CODSPEED_EXCLUDE_ALLOCATIONS",
default_value_t = true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Upload Hash Changes Globally

Defaulting exclude_allocations to true makes Runner.excludeAllocations serialize for every run, so the upload metadata hash changes for the same benchmark invocation even when users did not opt in. The upload metadata contract treats this field as an opt-in serialized signal, so this needs a metadata-version migration or another compatibility path to avoid mixing old and new hash semantics.

Knowledge Base Used: Upload flow

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/shared.rs
Line: 132

Comment:
**Upload Hash Changes Globally**

Defaulting `exclude_allocations` to `true` makes `Runner.excludeAllocations` serialize for every run, so the upload metadata hash changes for the same benchmark invocation even when users did not opt in. The upload metadata contract treats this field as an opt-in serialized signal, so this needs a metadata-version migration or another compatibility path to avoid mixing old and new hash semantics.

**Knowledge Base Used:** [Upload flow](https://app.greptile.com/codspeed/-/custom-context/knowledge-base/codspeedhq/codspeed/-/docs/upload.md)

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Codex

@codspeed-hq

codspeed-hq Bot commented Jul 20, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 43.06%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 16 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation sleep 1 126.3 µs 221.8 µs -43.06%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cod-2950-enable-cycle-estimationexclude-allocators-in-runner-for (92f25c7) with main (6794d28)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant