Skip to content

perf(xtask): build ripr once and invoke the binary directly in fixtures and dogfood (#2110) - #2176

Merged
EffortlessSteven merged 3 commits into
mainfrom
codex/fixture-shared-binary
Jul 22, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
codex/fixture-shared-binary

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Implements #2110 option 2: every fixture and dogfood scenario paid a cargo run -p ripr spawn plus link check (~20 dogfood scenarios + the full fixture suite per run).

  • fixtures_impl and dogfood_impl build the debug binary once per invocation (cargo build -p ripr — incremental, cheap when fresh).
  • run_fixture_check invokes the worktree-absolute binary directly (EXE_SUFFIX-aware for Windows). The absolute path avoids the stale-../-binary trap; the lazy fallback builds only when the binary is missing, so a stale binary is never served after a source change.

Option 1 (a batch check-all-fixtures CLI surface) and option 3 (parallelism) remain available on top; this removes the per-scenario cargo/link cost with the smallest change.

Closes #2110

Validation

  • cargo xtask fixtures — exit 0
  • cargo xtask goldens check — exit 0
  • cargo xtask dogfood — exit 0
  • cargo test -p xtask — 1211 pass
  • cargo clippy -p xtask --all-targets -- -D warnings — clean
  • cargo xtask precommit — exit 0

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8c308357-37d5-4c22-b4c0-e48d775d6d60

📥 Commits

Reviewing files that changed from the base of the PR and between b47abee and 4c0866a.

📒 Files selected for processing (1)
  • xtask/src/main.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • EffortlessMetrics/ripr (auto-detected)
  • EffortlessMetrics/perl-lsp (auto-detected)
  • EffortlessMetrics/unsafe-review (auto-detected)
  • EffortlessMetrics/ub-review (auto-detected)

Summary by CodeRabbit

  • Performance

    • Improved fixture and dogfood checks by building the debug executable once and reusing it across scenarios.
    • Reduced repeated build overhead during workflow runs.
  • Reliability

    • Improved discovery and execution of the debug executable across platforms and custom build output directories.
    • Ensured the workflow runs the expected prebuilt executable for each scenario.
  • Tests

    • Added coverage to verify executable path resolution when using a routed target directory.

Walkthrough

The xtask workflow builds the ripr debug binary once per fixture or dogfood invocation, resolves its platform-specific path, and executes it directly for each scenario. A unit test verifies configured and default target-directory resolution.

Changes

Binary execution workflow

Layer / File(s) Summary
Binary preparation and path resolution
xtask/src/main.rs
Fixture and dogfood commands build ripr upfront; helpers honor CARGO_TARGET_DIR and resolve the debug executable path.
Scenario invocation and path validation
xtask/src/main.rs
Fixture checks invoke the resolved binary directly, with a unit test covering target-directory path construction.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Poem

I’m a bunny with a binary bright,
Built once before the checks take flight.
No cargo loops from dawn till dusk,
Direct paths hop through debug’s husk.
CI carrots bloom—what lovely luck!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes summary and validation, but omits most required template sections like scope, proof, rollback, and traceability. Fill in the template sections for scope, source links, proof, rollback, traceability, policy impact, and claim boundary.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the core change: building ripr once and invoking the binary directly in fixtures and dogfood.
Linked Issues check ✅ Passed The code builds ripr once and invokes the debug binary directly in fixtures and dogfood, matching #2110 option 2.
Out of Scope Changes check ✅ Passed Changes stay within the xtask performance fix and supporting test/helper refactor, with no unrelated surfaces introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fixture-shared-binary

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
xtask/src/main.rs

ast-grep timed out on this file


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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a596c4e78e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread xtask/src/main.rs Resolved
@codecov

codecov Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.91304% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
xtask/src/main.rs 73.91% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • ripr_fixture_binary hardcodes target/debug and ignores CARGO_TARGET_DIR. Fix direction: use the existing ripr_debug_binary() helper (which already honors CARGO_TARGET_DIR per AGENTS.md L288-L290) before making the path absolute, then validate with CARGO_TARGET_DIR=/tmp/ripr-target cargo xtask fixtures boundary_gap.
  • ripr_fixture_binary hard-codes target/debug and ignores CARGO_TARGET_DIR. Routed-rust CI sets CARGO_TARGET_DIR (workflows/routed-rust.yml:120) and runs cargo xtask fixtures (line 192); a stale or non-default target dir will either trigger the lazy rebuild under the wrong path or serve a stale default-target binary. Smallest fix: route the helper through the existing target-dir resolution used elsewhere in xtask before std::path::absolute.
  • ripr_fixture_binary() hardcodes target/debug and ignores CARGO_TARGET_DIR, so routed-rust CI (which sets CARGO_TARGET_DIR) will see a missing binary even after the lazy fallback build. Reuse the existing ripr_debug_binary() CARGO_TARGET_DIR logic before absolutizing the path.
  • ripr_fixture_binary must honor CARGO_TARGET_DIR (use existing ripr_debug_binary() helper) before absolutizing; otherwise the per-invocation build in fixtures_impl/dogfood_impl also writes to the wrong target and fixtures fail on self-hosted runners. Reopen codex P1.

Confirmed findings

  • ripr_fixture_binary hardcodes target/debug and ignores CARGO_TARGET_DIR, breaking fixtures in routed-rust CI which sets CARGO_TARGET_DIR.
  • CARGO_TARGET_DIR mismatch: routed-rust.yml sets CARGO_TARGET_DIR but ripr_fixture_binary() hardcodes target/debug/ripr. Reopened P1 from prior thread.
  • artifact-verifier failed with exit code Some(2) on a source-ub diff — receipt should be re-run or explained; for tests-red-green the substantive artifact-verifier concerns are out of scope but the failure should be acknowledged in the gate.
  • fixtures_impl, dogfood_impl, and ripr_fixture_binary each invoke cargo build -p ripr independently. For the smallest complete fix, funnel all three through the new helper so target-dir resolution, EXE_SUFFIX, and lazy rebuild live in exactly one place; today the lazy path duplicates the eager-path build command.

Verification questions

  • Confirm no test asserts the new direct-binary path differs from prior cargo run -p ripr; only end-to-end exit-0 of cargo xtask fixtures/dogfood goldens and cargo test -p xtask reported.
  • Confirm prior thread already raised the CARGO_TARGET_DIR concern; current diff does not reopen it — diff adds ripr_fixture_binary without target-dir awareness, so concern is live, not resolved.
  • Confirm fixtures_impl and dogfood_impl each invoke cargo build -p ripr unconditionally before the lazy per-scenario fallback; redundant double-build when scenarios also trigger fallback path.

Verification questions

Refuted

[review body truncated; see review artifacts]

[review body truncated; see review artifacts]

Comment thread xtask/src/main.rs Resolved
Comment thread xtask/src/main.rs Resolved
Comment thread xtask/src/main.rs Resolved
Comment thread xtask/src/main.rs Resolved
…es and dogfood (#2110)

Every fixture and dogfood scenario paid a cargo run spawn plus link
check. fixtures_impl and dogfood_impl now build the debug binary once
per invocation and run_fixture_check invokes the worktree-absolute
binary directly (EXE_SUFFIX-aware; the lazy path builds only when it is
missing, so a stale binary is never served after a source change).
Review (P1): the routed CI jobs set CARGO_TARGET_DIR, so cargo build
writes the binary there — a hardcoded target/debug path would resolve a
missing or stale binary. The path now comes from CARGO_TARGET_DIR with
target as the default, verified by running fixtures with
CARGO_TARGET_DIR pointed at a fresh directory.
@EffortlessSteven
EffortlessSteven force-pushed the codex/fixture-shared-binary branch from 5fa9785 to b47abee Compare July 22, 2026 01:15

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@xtask/src/main.rs`:
- Around line 81482-81483: Remove the duplicate #[test] attribute from the
affected test declaration, leaving exactly one #[test] attribute so the test
remains registered without triggering duplicate macro attribute warnings.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 87b533d2-6085-4ceb-aa7c-18e49f76dc82

📥 Commits

Reviewing files that changed from the base of the PR and between a6e5f07 and b47abee.

📒 Files selected for processing (1)
  • xtask/src/main.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • EffortlessMetrics/ripr (auto-detected)
  • EffortlessMetrics/perl-lsp (auto-detected)
  • EffortlessMetrics/unsafe-review (auto-detected)
  • EffortlessMetrics/ub-review (auto-detected)

Comment thread xtask/src/main.rs Resolved
)

Review round: the fixture binary helper duplicated target-dir logic that
ripr_debug_binary() already owns, and the conflict-resolution edit left
a duplicated #[test] attribute. ripr_fixture_binary now reuses
ripr_debug_binary (factored with a pure ripr_debug_binary_in so the
target-dir behavior is testable without unsafe env mutation), and the
duplicate attribute is removed.
@EffortlessSteven
EffortlessSteven merged commit a55ac77 into main Jul 22, 2026
34 of 35 checks passed
@EffortlessSteven
EffortlessSteven deleted the codex/fixture-shared-binary branch July 22, 2026 01:48
EffortlessSteven added a commit that referenced this pull request Aug 10, 2026
…3097) (#3109)

* fix(xtask): route eval-sweep through the shared ripr binary resolver (#3097)

eval-sweep resolved the ripr binary with a private hardcoded
target/debug path and its own build helper, so under a custom
CARGO_TARGET_DIR it looked for a binary cargo never wrote there.

Production delta: eval_sweep obtains the binary only through
ripr_fixture_binary(), inheriting CARGO_TARGET_DIR handling (#2176)
and the memoized unconditional build (#3054). The private
ripr_binary_path() and build_ripr() are deleted, and the resolution
stays behind the will_run short-circuit so a manifest with no runnable
checkouts remains build-free. Sweep semantics, manifest format, and
recorded measures are unchanged.

Evidence: new binary_resolution_honors_cargo_target_dir test pins the
delegated resolver contract against the pure target-dir parameter;
verified behaviorally with CARGO_TARGET_DIR pointed at a scratch dir,
where the sweep built, resolved, and spawned the scratch binary.

* fix(xtask): share the --repo selection and pin the resolver delegation seam (#3097)

Review repair on the #3109 candidate:

- will_run now iterates selected_repos, the same --repo-filtered
  iterator the run loop consumes, so a checkout belonging to an
  excluded repo can no longer trigger a build by itself (coderabbit).
- The resolver delegation is extracted into sweep_binary_in, a seam
  the tests drive with a probe resolver: a runnable sweep resolves
  through it, a checkout-less sweep never touches it, and a build
  failure propagates. This replaces the previous test, which pinned
  only the shared resolver's CARGO_TARGET_DIR behavior and could not
  catch eval_sweep re-growing a private path helper (codex, coderabbit).

cargo test -p xtask (1568), clippy -D warnings, fmt, precommit green.

---------

Co-authored-by: Test <test@example.com>
EffortlessSteven pushed a commit that referenced this pull request Sep 25, 2026
* fix(xtask): find the dogfood packet-index binary under CARGO_TARGET_DIR

The report-packet-index dogfood family built ripr with `cargo build` and
then looked for it at a hardcoded `target/debug/ripr`. With
CARGO_TARGET_DIR set, cargo writes the binary elsewhere, so every one of
the seven cases failed with "build reported success but target/debug/ripr
is absent" and 60 follow-on group/count errors. Route the lookup through
the existing `ripr_debug_binary()` helper, which already honors
CARGO_TARGET_DIR (#2176) and is pinned by
`ripr_debug_binary_honors_cargo_target_dir`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK

* fix(xtask): resolve the built ripr under CARGO_TARGET_DIR in evidence-promotion and eval-sweep

Review follow-up on the dogfood fix: my census of hardcoded
`target/debug/ripr` lookups was cut short by a `head`, so two more
runners that `cargo build -p ripr` and then look for the binary at a
fixed path were missed. evidence_promotion's pinned-external runner and
eval_sweep's `ripr_binary_path` now use `ripr_debug_binary()` too. The
remaining `target` joins in xtask are cwd-relative report directories,
the release packager's `target/<triple>/release` copy, and a test-only
worktree resolver.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

perf(xtask): dogfood and fixtures spawn a fresh cargo run -p ripr per scenario — no shared binary or batch entry point

1 participant