Skip to content

perf(test): cheap bypass read; fix(perf): identical arms only suspect on a fresh base - #1114

Merged
wenzowski merged 2 commits into
mainfrom
claude/sweet-faraday-6rxhxv
Oct 4, 2026
Merged

wenzowski merged 2 commits into
mainfrom
claude/sweet-faraday-6rxhxv

Conversation

@wenzowski

@wenzowski wenzowski commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes CLOUD-2106
Closes CLOUD-2107

CLOUD-2106 — perf(test). common::batten() ran the full validated batten::config::load to collect [[rule]].bypass_env. nextest runs one process per test, so every spawning case paid for that load: under callgrind, 242M of the 251M instructions in cli::help_leads_with_the_crate_description.

  • bypass_env_vars_in still reads the names from the committed file, through a two-field serde view. The same case now takes 59M instructions (−76%).
  • bypass_scrub::the_cheap_bypass_read_names_what_the_full_load_names checks the cheap read against the full load, on a fixture that declares a hatch and on the committed file.
  • Mutant bypass-read-drops-rows was killed by hand.

CLOUD-2107 — fix(perf). This fixes a regression from CLOUD-2097. The perf gate's identical-arms guard (CLOUD-2060) refused CLOUD-2106's test-only lap after a green suite. The base arm was now the previous lap's kept head, built from the same checkout path, and the binary had legitimately not changed.

  • arms_suspect keeps the refusal only when this run built the base, which is the CLOUD-2060 mechanism's precondition. A cached base that matches the head goes through to the measurement, which reads about 1.0.
  • Test identical_arms_are_suspect_only_when_the_base_was_built_this_run; mutant identical-arms-always-suspect, killed by hand.

All 29 perf unit tests and all 12 perf_pair cases pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFeJfGnT67NjjLWQJ1SgXB

`bypass_env_vars` ran `batten::config::load` over the committed authority to
collect `[[rule]].bypass_env`, and `common::batten()` calls it for every
fixture command. nextest runs a process per case, so the memo saved nothing
across the suite: under callgrind, the load was 242M of
`cli::help_leads_with_the_crate_description`'s 251M instructions at the test
binary's opt-level 0.

`bypass_env_vars_in` still reads the names out of the file, through a
two-field serde view the deserializer skips everything else for. The same
case is now 59M instructions.

`bypass_scrub::the_cheap_bypass_read_names_what_the_full_load_names` holds
the cheap read to the full load, on a fixture that declares a hatch (the
committed config declares none, which would make the comparison vacuous) and
on the committed file. `bypass-read-drops-rows` is killed by hand.

Refs: CLOUD-2106
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: button-inc/batten/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 04756918-a708-4a09-9dd1-2a7ff59f4144
📥 Commits

Reviewing files that changed from the base of the PR and between b9ec2f9 and 6446768.

📒 Files selected for processing (1)
  • crates/batten/src/perf.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: button-inc/batten/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1a7d2d79-e5a7-4ebb-ac15-b23f47d5142d
📥 Commits

Reviewing files that changed from the base of the PR and between c896eb3 and b9ec2f9.

📒 Files selected for processing (2)
  • crates/batten/tests/it/bypass_scrub.rs
  • crates/batten/tests/it/common/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The bypass environment reader now extracts names from rule entries without loading and validating the full configuration. It sorts and deduplicates the names, and returns an empty list if reading or parsing fails. The memoized reader uses this function for the committed configuration. A test compares its results with those from the validated configuration load.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b9ec2

This change only speeds up test helper reads of bypass environment names. It adds a comparison test and shows no concrete merge risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title identifies the cheap bypass read, which is the primary change. It also names a perf-gate fix described in the PR description.
Description check ✅ Passed The description explains the bypass-read change, its performance impact, and related tests. It also describes the perf-gate fix.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

CLOUD-2060's guard refuses a pair whose arms are byte-identical, for one
mechanism: both arms built into the shared directory in the same run, the
second inheriting the first's `batten` units through cargo's mtime
fingerprint. CLOUD-2097 then made the previous lap's head the next lap's
base, built from the same checkout path, so a change that leaves the binary
alone now yields a head identical to its kept base, legitimately. CLOUD-2106's
test-only lap was refused at `perf-gate` on exactly that, after a green suite.

`arms_suspect` keeps the refusal for a base built this run and lets a cached
base equal to the head through to the measurement, which reads ~1.0.

`perf::tests::identical_arms_are_suspect_only_when_the_base_was_built_this_run`;
`identical-arms-always-suspect` is killed by hand.

Refs: CLOUD-2107
@wenzowski wenzowski changed the title perf(test): read the bypass hatches without the validated config load perf(test): cheap bypass read; fix(perf): identical arms only suspect on a fresh base Oct 4, 2026
@wenzowski
wenzowski marked this pull request as ready for review October 4, 2026 00:44
@wenzowski

Copy link
Copy Markdown
Contributor Author

/fast-forward

@wenzowski
wenzowski merged commit 6446768 into main Oct 4, 2026
26 checks passed
@wenzowski
wenzowski deleted the claude/sweet-faraday-6rxhxv branch October 4, 2026 01:08
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