Repository navigation
ripple: depend on the content of files that root paths name, and add ripple why - #344148
Merged
Alexandru Dima (alexdima) merged 2 commits intoOct 25, 2026
Merged
Conversation
A string such as `'src/main.ts'` in a test's fake GitHub tree names an existing module from the repository root, and ripple linked it like a dynamic import: to the node standing for the whole module, which depends on all of it and on everything it loads. So that test depended on all that the Electron main process starts, the agent host included, and #344129, which only changes agent host code, ran it alone in WebKit on macOS. Of the 670 commits of the last week, 175 selected that test this way, and 31 selected `fuzzyScorer.test.ts`, whose `URI.file(...)` fixtures name workbench modules. No module specifier is a path from the repository root, so code reads the file that such a string names, or the string only looks like a path. It now reads the file, like the folders that tests read by path: the code depends on the file's content, also for a module, but not on what the module loads. Relative and path alias strings, such as entry points, still reach what the module loads. On the same 670 commits, 190 select fewer tests and none select more; on 63 of them, the browser test runners have nothing left to run. The README's replay table had drifted since earlier changes; it now shows the current numbers. `ripple why --test PATH --base REV [--head REV]` prints how a change reaches a test that it selects: the path from the test's code to what the change changed, through declarations, whole modules, packages and globals, and the code whose use of a name opened each instance method on the way. It shares the search of `reaches_from`, so it follows the same rules as selection. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed dependency and tracing changes are consistent with their callers and regression coverage, with no unresolved blocking issues.
No open issues 🎉
What changed in this PR
This PR reduces false-positive test selection in Ripple by treating repository-root paths as file-content dependencies rather than transitive module dependencies. It also adds diagnostics for explaining why a change selects a test.
Changes:
- Track root-path file reads without following module dependencies, while preserving relative and alias module behavior.
- Add
ripple whywith labeled dependency paths and method-opening context. - Add regression tests and update documentation, known limitations, and replay statistics.
| File | Description |
|---|---|
build/ripple/src/main.rs |
Registers and implements the why command. |
build/ripple/src/graph.rs |
Generalizes file-read tracking and adds traced dependency searches and labels. |
build/ripple/src/engine.rs |
Integrates readers into selection, exposes change seeds, and adds regression tests. |
build/ripple/README.md |
Documents dependency semantics, diagnostic usage, limitations, and updated statistics. |
Review effort: Balanced
Resolves the conflicts in build/ripple/README.md by keeping both sides: main's integration test selection and this branch's root path reads. Co-authored-by: Copilot <[email protected]>
Alexandru Dima (alexdima)
marked this pull request as ready for review
October 25, 2026 19:58
Alexandru Dima (alexdima)
enabled auto-merge (squash)
October 25, 2026 19:58
Benjamin Christopher Simmonds (benibenj)
approved these changes
Oct 25, 2026
Alexandru Dima (alexdima)
deleted the
agents/improve-ripple-test-selection-logic
branch
October 25, 2026 20:16
Alexandru Dima (alexdima)
added a commit
that referenced
this pull request
Oct 25, 2026
…mization-flaky-tests Resolves the conflicts with #344146 and #344148: a pull request that only disables tests also forces the new selected-node-integration-tests and selected-agent-host-e2e outputs to false, so that the Windows Agent Host E2E job skips too, and ripple's new COMMANDS list includes disables. Co-authored-by: Copilot <[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.
ripple selected
githubFileSystemProvider.test.tsfor #344129, which only changes agent host node code, so macOS ran that browser test alone in WebKit. The test's fake GitHub tree lists{ path: 'src/main.ts' }.Cause
A string that names an existing repository file from the root becomes a
rootspec with aRef::Alledge, like a dynamic import. The linker resolved it like a module specifier, to the surface node ofsrc/main.ts: the node standing for the whole module, which depends on all of its nodes and so on everything the module loads. These are theu32::MAXnodes of the investigation.ripple why(below), with this fix reverted, prints the chain:Fix
No module specifier is a path from the repository root, so code reads the file that such a string names (a grammar, a fixture), or the string only looks like a path. A root path now resolves to a read of the file, through the same non-transitive mechanism as the folders that tests read by path, generalized from folders to files (
Res::DirisRes::Read,Graph::dir_dependentsisGraph::readers). The reader is selected when the file changes, also by a comment, since code that reads a file sees its text, but not when what the module loads changes. Relative and path alias strings, such as the'vs/platform/agentHost/node/agentHostMain'entry point, workers andFileAccessmodule ids, still depend on the module and what it loads.Why only root paths: on
main, 15 root path strings name modules, all of them fake data (this tree, theURI.file('src/vs/workbench/browser/workbench.ts')-style names offuzzyScorer.test.ts, the file lists of component fixtures). 58 relative or path alias strings name modules, nearly all genuine loads in positions that only a repository-specific list could recognize (entryPoint:,VSCODE_ESM_ENTRYPOINT:,esmModuleLocation:,moduleId:,FileAccess.asFileUri(),new URL(),fork()).ripple whyripple why --test PATH --base REV [--head REV]prints how a change reaches a test that it selects: the path from the test's code to what the change changed, with whole modules, packages and globals labeled, the code whose use of a name opened each instance method, and(reads X by path)for file reads. It shares the search ofreaches_fromthrough aconst TRACE: boolparameter, so selection keeps its depth-first search without per-edge checks:select()takes the same time within ±1%.Effect
githubFileSystemProvider.test.tsdrops.ripple planlists 94 unit test files, none of thebrowserorcommonlayers, and the same 30 integration test files. With ci: skip macOS and Windows Browser unit jobs without browser tests, and report a failed ripple plan #344108, the macOS and Windows Browser unit jobs are skipped for it, wheremainalone still runs them for that one test.ripple replayof Oct 18 to 25 (670 first-parent commits): 190 commits select fewer tests, none more. They dropgithubFileSystemProvider.test.ts(175 commits) andfuzzyScorer.test.ts(31). On 63 commits, the browser test runners have nothing left to run. The share of unit test work hardly moves (mean 10.6%, median 2.0%, p90 24.6% before and after): both files are small.fixtureSyntaxHighlighting.test.tsreads by root path,test/package.json, fixture folders (pfs,zip),__snapshots__folders and the keyboard mapper's golden files. A change tostartAgentHostinagentHostMain.tsstill selectsnodeAgentHostStarter.test.tsthrough the entry point string.Trade-off: a comment-only edit of a module that a root path names now selects the code that names it, where it selected nothing before: editing
src/main.tsselectsgithubFileSystemProvider.test.ts. That added no selection in either replay window. The README's known limits describe it, and that a root path never follows the loads of the module it names (the unit tests run the compiled modules inout, which no root path names).main(with ci: skip macOS and Windows Browser unit jobs without browser tests, and report a failed ripple plan #344108 and ci: run only the integration tests a change can affect on macOS and Windows #344146), compared with a build ofmain: a replay of Oct 18 to 25 (668 commits) selects fewer unit tests in 186 commits and more in none, the same integration tests in every commit, and the same commits run everything. The Browser unit jobs are skipped in 61 more commits.How to test
cargo fmt --checkpassed andcargo clippyreports no new warnings. Since this changesbuild/ripple, theRipplecheck runs and this pull request runs every unit test.