Skip to content

perf(check): cut repeated per-probe work on big TypeScript and Rust diffs - #4607

Merged
EffortlessSteven merged 14 commits into
mainfrom
claude/check-perf-big-repos-b2bq5q
Sep 29, 2026
Merged

EffortlessSteven merged 14 commits into
mainfrom
claude/check-perf-big-repos-b2bq5q

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

Before: ripr check on a vite commit took 8.0 s and on a ripr commit 11.3 s (warm, main 6048b5a plus its build fix, 4 vCPU Linux).

After: the same checks take 4.0 s and 7.8 s. On all 12 measured commits the JSON and stderr are byte-identical.

Three hot spots, each found by stack sampling a real run, each fixed without changing any verdict:

  • TypeScript (~64% of the vite run). Related-test selection called same_package_root per (owner, test), which walks the directory tree looking for package.json twice. OwnerPackageScope resolves the owner once and each test directory once per owner. All three candidate passes (direct, same-module entry from fix(typescript): relate tests that reach a private helper through a same-module export or factory product #4526, heuristic) share it.
  • Rust (~16% of the ripr run). The derived-tuple admission reparsed the owner's whole file for every probe. It now first checks that the file spells the three parameter names canonical_owner_roles requires; without them the answer was already false.
  • Rust (~12%, the efficiency thread's perf(check): scan each related test file's imports once per run #4498 follow-up). value_facts_for_test depends only on (test, owner) but ran for every probe. TestValueFacts memoizes it on the run-scoped RelatedTestCandidateIndex, keyed by the test's and owner's slots in that index. A test or owner that is not an element of the bound index is computed fresh and never cached. Test-name token matching also stops allocating two strings per (test, token).

The Python line index (~79% of Django runs) was dropped from this PR: #4580 owns it (overlap ruling from the open-PR drain).

Ported fix for red main. Main at 6048b5a does not compile: #4593's computed-title path calls the free line_for_offset, which #4635 made test-only. cargo fmt --check also fails on typescript/mod.rs. This PR carries the same two-line fix as #4739 (pass SourceText to title_argument, reorder the mod line). Both hunks no-op once #4739 lands.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Governing issue or accepted claim: 0.11 release hunt, "check speed on big repos" (project thread above); continues #4498.
Acceptance delta (one sentence): check is materially faster on large TypeScript and Rust repositories with byte-identical output.

Candidate Relationships

Candidate branch: claude/check-perf-big-repos-b2bq5q. Builds on #4498 (merged). #4580 owns the Python line index. #4739 owns the main build and fmt repair; this PR ports it.

Scope

Scope classification: one production behavior (check latency), no output change.

Non-goals: no caches that outlive a run, no parallelism, no change to any relation, verdict or JSON field.

Support-tier Impact

  • none (CHANGELOG entry only)

Policy Impact

  • none (one #[allow(clippy::too_many_arguments, reason = ...)] on the memo-taking activation entry point)

Proof

cargo xtask precommit                                   # pass
cargo clippy -p ripr  --all-targets -- -D warnings      # pass
cargo clippy -p xtask --all-targets -- -D warnings      # pass
cargo test -p ripr --lib typescript                     # 726 passed
# byte-identity: main 6048b5a (+ the #4739 build fix) vs head 1411148,
# release builds, `ripr check --base HEAD~1 --format json` in worktrees
# of 12 real commits, 2 runs each binary: every stdout and stderr identical
Commit JSON bytes main (s) this PR (s)
vite e64a587 993,962 8.0 4.0
vite bbc8812 158,585 2.6 1.9
ripr a47baac 4,682,395 11.3 7.8
ripr 5494c46 5,040,468 7.7 6.7
tokio (4 commits) 1.1-1.6 MB 0.9-1.1 0.8-1.0
django (3 commits) 64-355 KB 4.8-6.4 unchanged (Python moved to #4580)

New equivalence tests, each checked against its old code path. The memo and word-match tests were also shown to fail under a mutation of the new code:

  • owner_package_scope_matches_same_package_root_for_every_pair (nested packages, no-package dirs, absolute and relative paths, cached second round)
  • test_value_facts_memo_matches_fresh_facts_for_every_test_and_owner (fails when the owner is dropped from the key)
  • test_name_has_word_matches_the_padded_substring_rule (every name up to 6 chars over a b _ é; fails with a non-overlapping search)

The positive end-to-end derived-tuple admission stays covered by tests/match_arm_tuple_derived_local.rs.

Review: an independent read-only review pass found no behavior findings (one CHANGELOG nit, fixed). CodeRabbit is rate-limited and Gemini is out of quota, so both reviews are missing, not clean.

Claim Boundary

May claim: faster ripr check on the measured shapes with identical output. Must not claim a general speedup for every repository; the timings come from one machine with a warm cache.

Rollback

Revert the squash commit. No data, schema or cache format changes.

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code or tests.

Gates

  • cargo fmt --check (via precommit)
  • cargo xtask precommit
  • clippy on ripr and xtask, run directly

🤖 Generated with Claude Code

https://claude.ai/code/session_015fB1dGecsPvXwSxSuqCNQQ


Generated by Claude Code

…d Rust diffs

Python source facts looked up each fact's line by scanning the file from
the start, so extraction was quadratic in file size. An IndexedSource
keeps the newline offsets and answers by binary search.

TypeScript related-test selection walked the filesystem for package.json
twice per (owner, test) pair. OwnerPackageScope resolves the owner's
package once and each test directory once per owner.

Rust classification reparsed the whole owner file per probe for the
derived tuple admission even when the file cannot contain the canonical
parameters; the names are now checked first. Per-(test, owner) value
facts are memoized on the run-scoped candidate index, and test-name
token matching no longer allocates two strings per (test, token).

Output is unchanged: check JSON is byte-identical on 12 real commits of
tokio, vite, django and ripr-swarm.

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

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven self-assigned this Sep 29, 2026
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 1 minute.

Check out review usage here.

View limit details

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

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: eaee4820-f249-4e62-9464-15d820095cf9

📥 Commits

Reviewing files that changed from the base of the PR and between 30ee16b and 9791e2e.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • crates/ripr/src/analysis/classifier.rs
  • crates/ripr/src/analysis/classifier/evidence.rs
  • crates/ripr/src/analysis/classifier/evidence/tuple_match/derived_admission.rs
  • crates/ripr/src/analysis/classify/activation.rs
  • crates/ripr/src/analysis/classify/context.rs
  • crates/ripr/src/analysis/classify/mod.rs
  • crates/ripr/src/analysis/classify/related_tests.rs
  • crates/ripr/src/analysis/language/typescript/related_tests.rs
  • crates/ripr/src/analysis/language/typescript/static_limit.rs
  • crates/ripr/src/analysis/language/typescript/tests.rs

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.

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

Copy link
Copy Markdown
Member Author

Overlap note from the crash-hunt lane:


Generated by Claude Code

…hrough OwnerPackageScope

#4580 owns the Python line-start index (SourceText), so this PR no
longer carries IndexedSource. Main's new same-module entry reach used
the removed same_package_root call; it now shares the owner's package
scope with the other candidate passes.

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

#4593 added a computed-title path calling the free line_for_offset,
which #4635 made test-only in favour of SourceText::line_for_offset.
Each merged green alone; together main does not compile.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015fB1dGecsPvXwSxSuqCNQQ
@EffortlessSteven EffortlessSteven changed the title perf(check): cut repeated per-probe work on big Python, TypeScript and Rust diffs perf(check): cut repeated per-probe work on big TypeScript and Rust diffs Sep 29, 2026
…-repos-b2bq5q

# Conflicts:
#	CHANGELOG.md
#	crates/ripr/src/analysis/language/typescript/tests_extract.rs
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 29, 2026 05:34
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T05:37:38.622651Z 9791e2e Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@EffortlessSteven
EffortlessSteven merged commit 6239990 into main Sep 29, 2026
24 of 25 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/check-perf-big-repos-b2bq5q branch September 29, 2026 06:02
EffortlessSteven pushed a commit that referenced this pull request Sep 29, 2026
Conflict in typescript/related_tests.rs: main's OwnerPackageScope (#4607)
filtered owner-call candidates by package; #4552 exempts import-anchored
owner-call arms, so that filter stays off them. The constructor arm's
cross-package check now uses OwnerPackageScope since same_package_root is
test-only on main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqbiiuYkC94scgE9rZ5K8W
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.

2 participants