You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust test-coverage import resolution rebuilt RustProductionFileIndex for every use specification. On a 648-production-file / 52-test-file workspace, coverage ran for more than 30 minutes at roughly 53,000 newfstatat calls per second.
Literal include!("path.rs") ownership was absent from the Rust dependency graph and direct-test mapping. Textually included implementation files were reported as zero-importer, untested modules even though they compile inside a directly tested owner.
Fix
Cache the immutable production-file index by resolved project root and sorted production scope.
Resolve literal Rust source include! edges in the dependency graph.
Add focused cache, graph, and recursive coverage regressions.
Verification
Focused Rust/coverage tests: 25 passed.
Full suite before the include change: 5,659 passed, 151 skipped; 5 unrelated baseline failures in Bash unused-import and review-prompt tests.
Reproduction workspace: coverage completed in about 30 seconds instead of exceeding 30 minutes. Orphaned Rust files fell from 197 to 1, coverage findings fell from 306 to 158, and the full scan completed successfully.
Reviewed against main alongside #722 — the two PRs are competing implementations of the same perf bug (the RustProductionFileIndex being rebuilt for every use specification). Verdict on the split:
The include!() modeling is unique to this PR and correct — dep-graph edges plus recursive direct-test ownership for textually included files matches Rust's semantics, fixes zero-importer orphan reporting, and has no equivalent in #722 (#722's promote_owner_covered_files is a directory-convention heuristic covering a different case). That commit is worth landing.
The cache commit is superseded by #722, which is more complete: it also caches describe_rust_file and the workspace package index, and eliminates the per-file get_test_files_for_prod loop, which this PR leaves in place (cheapened, not removed). The two PRs also textually conflict in languages/rust/tests/test_test_coverage.py, and both ownership mechanisms would double-fire if stacked.
Recommend: drop the cache commit, rebase the include! commit onto whichever perf fix lands (#722's Rust-only commits, once split out of that bundle), and undraft. Happy to re-review quickly after that — the include! work is the kind of precise fix this detector needs.
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
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.
Problems
RustProductionFileIndexfor everyusespecification. On a 648-production-file / 52-test-file workspace, coverage ran for more than 30 minutes at roughly 53,000newfstatatcalls per second.include!("path.rs")ownership was absent from the Rust dependency graph and direct-test mapping. Textually included implementation files were reported as zero-importer, untested modules even though they compile inside a directly tested owner.Fix
include!edges in the dependency graph.Verification