Repository navigation
refactor(perf): canonicalize wt-perf prune-fixture layering + completion config - #3548
Merged
Merged
Conversation
…tion config The synthetic and rust-scale prune fixtures (`create_prune_repo_at`, `create_prune_real_repo_at`) both layered the same two populations onto their base repo — `add_diverged_backdrop` for the scanned-but-never-removed backdrop and `add_squash_merged` for the removable candidates. Extract that into `add_prune_populations` so the two fixtures share one layering and can't drift; the base repo (synthetic `create_repo_at` vs. rust clone) stays the only thing they differ in. `completion.rs`'s two inline `RepoConfig` literals were exactly `RepoConfig::branches(50, 0)` (one with `worktrees` overridden), so point them at the canonical preset via struct-update instead of respelling every field. Behavior-preserving: fmt/clippy clean, wt-perf fixture tests and all bench builds pass. Co-Authored-By: Claude Opus 4.8 <[email protected]>
`benches/CLAUDE.md` listed the `wt-perf setup` fixture handles in one section and the bench groups in another, with nothing connecting them — so a bench and its fixture (`full` and `mixed`) read as overlapping names for one thing. Add a mapping table plus the rule that makes it make sense: bench groups are named for what they measure, fixtures for the repo shape, and the relationship is many-to-one (`RepoConfig::typical` alone backs five groups), so the two names structurally cannot match. Also record that renaming a bench group orphans its time series, since criterion-to-jsonl.py keys gist rows by `<group>/<id>`. Co-Authored-By: Claude Opus 4.8 <[email protected]>
max-sixty
marked this pull request as ready for review
July 24, 2026 01:31
worktrunk-bot
approved these changes
Jul 24, 2026
Merged
max-sixty
added a commit
that referenced
this pull request
Jul 25, 2026
…ive (#3584) Follow-up to #3548, which consolidated the `wt-perf` prune fixtures but left the branch *builders* diverged. ## The refactor Three generators had each grown their own way to create a fixture branch. `add_history_spread_branches` pointed a ref at an old commit, `add_diverged_backdrop` hand-rolled ~45 lines of index plumbing, and `create_mixed_repo_at` used `checkout -b` plus a return-to-main for two of its four states. They are the same operation. A branch's state is entirely the pair **(fork point, own-commit count)**: zero commits at an old fork is "behind" and at the tip is "identical"; a positive count from the tip is "ahead" and from anywhere else is two-sided "diverged". `add_branch_with_commits` takes that pair, and the mixed fixture's four-state rotation collapses to a table: ```rust let (fork, commits) = match i % 4 { 0 => (checkpoint, 0), // behind 1 => (base_tip.as_str(), 1 + i % 3), // ahead 2 => (checkpoint, 1 + i % 3), // diverged _ => (base_tip.as_str(), 0), // identical to the tip }; ``` The checkout path is what actually mattered. `git checkout` of an old fork point on rust-lang/rust rewrites the whole tree (minutes per branch), which is why `add_diverged_backdrop` grew plumbing in the first place. Routing the mixed fixture through the same primitive removes the last checkout from fixture construction, so the main worktree is never touched and the fixture is no longer structurally barred from a rust-scale repo. The win is structural. Fixture build time is unchanged: `mixed-8-8` runs 3.25/3.28/3.71s after against 3.33/3.55/3.91s before, and `mixed-24-120` 14.9/15.7s against 15.5/23.5s. That is parity within noise, and the before-side spread swamps the difference. ## The guards These generators had nothing pinning their output. The benchmarks measure one wall-clock number, so a generator change that collapsed (say) "diverged" into "ahead" would keep every bench green while silently measuring a different repo. Three tests now assert the shapes directly, via `merge-base --is-ancestor` exit codes and porcelain status: - the `full` fixture's documented `index % 4` rotation of branch and worktree states - the same fixture's zero-dimension contract (`mixed-W-0` / `mixed-0-B`), which holds only because `0..0` never enters the loop that divides by `branches` - `add_diverged_backdrop`'s own wiring: every member unintegrated, fork depths fanning across history, worktrees dirty only via untracked scratch, and populations that don't follow each other Each was mutation-tested rather than trusted for being green. A clamped divisor gives `left: 1, right: 0`, and a fork spread collapsed onto the tip gives `fork depths must fan out across history: [0, 0, 0, 0]`. ## One thing to look at Writing the guards turned up a docstring overclaim in two places. `history_spread_shas` samples newest-first, so index 0 is the default branch's own tip. That makes `add_diverged_backdrop`'s "the default branch has advanced past every fork" and `add_history_spread_branches`'s "behind-only" both false as written. The first is true in its only caller, where `add_squash_merged` advances the default branch on the very next line. I corrected the docstrings rather than the sampling, and pinned the behavior with `assert_eq!(depths[0], 0, "the newest sample is main's own tip")`. Changing the sampling would shift the workload of every prune and `list` benchmark that uses the spread, moving Criterion's historical series with no rename to signal it, in exchange for one branch out of 24 to 120 gaining fork depth. Happy to flip it if you'd rather; it is documented and asserted either way. ## Verification `hook pre-merge` green (4542 tests), and `cargo bench --bench list full` runs end to end against the rebuilt fixture. Shape verified at benchmark scale rather than only at the test's `N = 8`: a real `mixed-24-120` holds the rotation through `br-0118`. The refactor is content-identical for the backdrop (same blob content, filenames, commit messages, plumbing sequence) and structurally identical for the mixed fixture (same fork points and commit counts, since `0..=(i%3)` and `1 + i%3` agree). > _This was written by Claude Code on behalf of max_
max-sixty
pushed a commit
to max-sixty/tend
that referenced
this pull request
Jul 25, 2026
…#787) ## What Adds a bullet to the `review-reviewers` skill's **Non-issues** list: `tend-review` staying silent on a **draft** PR with no actionable findings is expected skill-designed behavior, not a silent omission — the sibling of the already-documented self-authored-PR case. ## Why GitHub's `state` field reports draft PRs as `OPEN`, so the survey step's negative signal "bot posted no review despite a `tend-review` run completing on an open PR" fires on drafts. The bundled `review` skill's draft-mode explicitly runs a lighter COMMENT-only review and authorizes "Stay silent if there's nothing actionable; don't post a 'looks fine' comment" (GitHub also blocks APPROVE on drafts). So a silent tend-review on a clean draft is correct — but without this in the durable Non-issues list, each analysis run re-derives it via an expensive escalation to session logs. ## Evidence Recurring across analysis runs, and structural (draft PR + nothing actionable → always silent): - **This run** ([29954129033](https://github.com/max-sixty/tend/actions/runs/29954129033)): two `tend-review` runs on max-sixty/worktrunk PRs [#3547](max-sixty/worktrunk#3547) and [#3548](max-sixty/worktrunk#3548) — both `draft: true`, human-authored (max-sixty), zero reviews/comments posted. The survey subagent flagged them as "concerning: no review on open human-authored PR"; I escalated to a session-log investigation, which confirmed the bot correctly detected draft status and applied draft-mode silence in every case. The escalation was only necessary because the pattern wasn't codified. - **Prior run** (recorded in the evidence gist): already tracked a counter "tend-review correct silent exit (draft-nothing-actionable): +2" and verified the same outcome against `review/SKILL.md` — i.e. the pattern was observed and re-derived a window earlier too. This is an **invisible, recurring failure mode**: the wasted session-log escalation never surfaces as a CI failure, so without codification it keeps costing tokens every window a draft PR is open and gets pushed to. ## Gate assessment - **Gate 1 (confidence)**: structural; observed across 2+ analysis runs (prior +2, this run 2 more). Passes. - **Gate 2 (magnitude)**: one bullet added to an existing enumerated list, mirroring the adjacent self-authored bullet — targeted, no structural change. Passes. Evidence log: https://gist.github.com/b923bbc52f3c6606931d59abdae616a3 The target-repo bot behavior this window was otherwise all-clear: three `tend-review` runs correct (draft/re-review), three `tend-notifications` benign, one `tend-ci-fix` skip. No human pushback, no corruption. This PR improves the *analysis* skill, not the target bot. Co-authored-by: tend-agent <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three behavior-preserving canonicalizations of the
wt-perfbenchmark fixtures, from a design pass on "why does prune need its own generator, and can the fixtures consolidate?"Share the prune-population layer.
create_prune_repo_at(synthetic) andcreate_prune_real_repo_at(rust-scale) both layered the same two populations onto their base repo —add_diverged_backdrop(the scanned-but-never-removed backdrop) +add_squash_merged(the removable candidates). Extracted intoadd_prune_populations, so the base repo (syntheticcreate_repo_atvs. rust clone) is now the only thing the two fixtures differ in, spelled out once instead of twice.Canonicalize
completion.rsontoRepoConfig::branches. Its two inlineRepoConfigliterals were exactlyRepoConfig::branches(50, 0)(one withworktreesoverridden), so they now use the canonical preset via struct-update instead of respelling all seven fields.Document the fixture → bench mapping.
benches/CLAUDE.mdlisted thewt-perf setuphandles in one section and the bench groups in another with nothing connecting them, so a bench and its fixture (fullandmixed) read as overlapping names for the same thing. Added a mapping table and the rule behind it.Why this is the whole safe consolidation
The design question was whether prune could drop its bespoke generator for a "standard one with different params" — ideally one diverse repo serving prune and the other benches. The answer is that prune's generator is already a thin composition (
create_repo_at+ two additive layers), and it can't fold into the sharedmixed/fullfixture without breaking three prune-specific invariants: a known/cleanly-separated candidate count (the destructivelivepath re-creates exactly the consumed candidates), untracked-only dirt (thegit reset --mixedindex-heal depends on it —mixed's staged-dirt states violate it), and a provably-unintegrated backdrop. And benchmark fixtures optimize for attribution, not realism: the uniform single-axis fixtures (worktree_scaling, etc.) exist precisely because the diversefullfixture can't localize a regression, so diversifying them would lose that.On the
full/mixednaming specifically: they can't be canonicalized to one name, because fixtures and benches are many-to-one —RepoConfig::typicalalone backs five bench groups (skeleton,worktree_scaling,first_output,picker_preview,remove_e2e), two of which sit in the same file measuring different things.full/mixedonly looks 1:1 by coincidence. Renaming also isn't free:.github/scripts/criterion-to-jsonl.pykeys each time-series row by the criterion output path (<group>/<id>) for the daily gist append, so a rename orphans that series. Documented rather than renamed.Proposed follow-up (not in this PR)
The one remaining real duplication is two implementations of "two-sided-diverged population forked across history depth":
add_diverged_backdrop(plumbing-based, scales to rust) vs. the diverged branch states insidecreate_mixed_repo(checkout-based, synthetic-only). They can't naively merge — the checkout path would makeprune-realtake minutes per branch — but a shared plumbing primitive could back both. That rewrites a carefully-tuned fixture feeding thefullbench with no shape-assertion test to catch drift, so I'd land a fixture-shape test first (count refs by state + assert integration status). Happy to do it if wanted.Verification
fmt
--checkclean;clippy -p wt-perf --all-targetsandclippy --bench completionclean;pre-commitclean on the doc;cargo test -p wt-perfpasses (incl. the prune-fixture testssquash_merged_fixture_is_content_integrated/prune_fixture_state_classifies_lifecycle, which exercisecreate_prune_repo_at→add_prune_populations); all benches build. Table contents verified against the code by grep.🤖 Generated with Claude Code