Repository navigation
refactor(wt-perf): place fixtures under target/wt-perf, not the cache dir - #3547
Merged
Merged
Conversation
… dir #3542 moved wt-perf's benchmark/debug fixtures into the per-user cache dir (`~/.cache/wt-perf`) to share the expensive rust clone across worktrees and survive `cargo clean`. Move every fixture back under `<workspace>/target/wt-perf/` instead: one location, reaped by `cargo clean` like any build artifact (criterion already writes `target/criterion`). - `wt_perf_cache_dir()` -> `wt_perf_fixture_dir()`, resolved from the crate's compile-time manifest dir (three levels below the workspace root) rather than the XDG cache dir. Drops the `etcetera` dependency. - `setup <config>` fixtures -> `target/wt-perf/<config>`; the rust clone and prune-real fixtures -> `target/wt-perf/bench-repos/`. - Drops the `WT_PERF_CACHE_DIR` override and the empty-value guard it needed; the benchmarks workflow now caches the deterministic `target/wt-perf/bench-repos` path directly, so there's nothing to pin. Tradeoff (accepted): `target/` isn't shared across git worktrees and is wiped by `cargo clean`, so the ~15 GiB rust clone re-clones per worktree and after every clean. Documented on `wt_perf_fixture_dir`. Cheap for the synthetic fixtures, which rebuild in seconds. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The initial move hardcoded `<workspace>/target/wt-perf` off CARGO_MANIFEST_DIR, so a relocated target dir (a CARGO_TARGET_DIR / build.target-dir override, or cargo-llvm-cov's target/llvm-cov-target/) would strand fixtures in a `target/` cargo never builds into or cleans — defeating the reason for using `target/`. Derive the target dir from the running executable instead: it lives inside whichever dir cargo used (`<target>/debug/wt-perf`, `<target>/release/deps/<bench>`), so the parent of the closest `debug`/`release` profile dir is the real target dir. This honors CARGO_TARGET_DIR, a config-file build.target-dir, and cargo-llvm-cov, none of which a bare env-var read covers. Falls back to `<workspace>/target` if the binary isn't under a profile dir. Co-Authored-By: Claude Opus 4.8 <[email protected]>
max-sixty
marked this pull request as ready for review
July 22, 2026 20:35
worktrunk-bot
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the refactor — the resolution logic is correct and the move is clean. Verified:
target_dir_from_exeholds against the full test matrix: closestdebug/releaseancestor wins (so.../release/proj/target/debug/wt-perf→target, not the strayrelease),release/deps/<bench>and cargo-llvm-cov'sllvm-cov-targetnesting both resolve, and a binary outside any target dir returnsNone→ workspace fallback. Thecargo_target_dirfallback (CARGO_MANIFEST_DIR.nth(3)) lands on the workspace root, sincetests/helpers/wt-perfsits exactly three levels down.- The CI cache path (
target/wt-perf/bench-repos) matches what wt-perf writes — noCARGO_TARGET_DIRis set anywhere in.github/, so the bench binary resolves to<workspace>/targetand the two stay in lockstep. - No dangling references to
wt_perf_cache_dir/WT_PERF_CACHE_DIRremain, andetceteracorrectly stays inCargo.lock— the main crate still uses it (src/config/user/path.rs,src/shell/paths.rs); only wt-perf's edge was dropped. - Dropping the
WT_PERF_CACHE_DIRempty-value guard is safe:cargo_target_dir()always returns an absolute path, so the relative-cwd footgun that guard defended against (an empty override →remove_dir_allof a relative<config>) can no longer arise.
One note per this repo's data-loss-surface review policy (review-pr.md): the diff touches std::fs::remove_dir_all in tests/helpers/wt-perf/src/main.rs (the setup <config> rebuild). It only removes disposable target/wt-perf/<config> fixtures wt-perf itself created, and fires only after parse_config has validated config to a known fixture name — so no user work is at risk here. Flagging it for the record rather than auto-approving; the merge call is yours.
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
Move every
wt-perfon-disk fixture out of the per-user cache dir and under the cargo target dir at<target>/wt-perf/, resolved by a renamedwt_perf_fixture_dir():setup <config>fixtures →<target>/wt-perf/<config>(was~/.cache/wt-perf/<config>).prune-realfixtures →<target>/wt-perf/bench-repos/(was~/.cache/wt-perf/bench-repos/).wt_perf_cache_dir()→wt_perf_fixture_dir(). The target dir is derived from the running executable's own path (it lives inside whichever dir cargo built into —<target>/debug/wt-perf,<target>/release/deps/<bench>), so it honorsCARGO_TARGET_DIR, a config-filebuild.target-dir, and cargo-llvm-cov'starget/llvm-cov-target/— none of which a bareCARGO_TARGET_DIRenv read covers. Falls back to<workspace>/targetif the binary isn't under a recognizable profile dir. Theetceteradependency is dropped.WT_PERF_CACHE_DIRenv override (and the empty-value guard it required) is removed; the benchmarks workflow now caches the deterministictarget/wt-perf/bench-repospath directly.create_repo) are unchanged — they keep usingtempfile::TempDir.This reverses the location decision from #3542, which had moved these into
~/.cache/wt-perf.Why
target/is the conventional home for build/test-generated artifacts — gitignored, reaped bycargo clean, and already where criterion writes (target/criterion). Keeping every wt-perf fixture there gives one predictable location under the repo thatcargo cleanfully resets. Deriving the target dir from the running binary (rather than assuming<workspace>/target) keeps that property intact even when the target dir is relocated.Tradeoff (accepted)
target/is not shared across git worktrees (worktrees don't share it) and is wiped bycargo clean. So the ~15 GiBprune-realrust clone re-clones per worktree and after everycargo clean— the cost #3542 avoided by using the cache dir. This is deliberate and documented onwt_perf_fixture_dir; it's cheap for the syntheticsetupfixtures, which rebuild in seconds.Testing
cargo build -p wt-perf --all-targets,cargo test -p wt-perf— clean.target_dir_from_exe_finds_cargo_targetcovers the resolution logic (relocatedCARGO_TARGET_DIR, bench binary underrelease/deps/, cargo-llvm-cov's nested target, closest-profile-wins, and the outside-any-target fallback).pre-commit run --all-files(fmt, clippy, yaml, typos, cargo-lock, custom hooks) — clean.setup branches-2lands at<worktree>/target/wt-perf/branches-2and writes nothing to~/.cache/; a copy of the binary run from a fake<dir>/debug/wt-perfcorrectly resolves fixtures to<dir>/wt-perf/, proving a relocated target dir is honored.