-
-
Notifications
You must be signed in to change notification settings - Fork 737
refactor(infra): improve conformance runner #14998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
50dc892 to
5cd45c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Damn, I kinda messed up. |
ad12b27 to
61b001d
Compare
| } | ||
|
|
||
| pub fn run_default(&self) { | ||
| self.run_parser(); | ||
| self.run_semantic(); | ||
| self.run_codegen(); | ||
| self.run_formatter(); | ||
| self.run_transformer(); | ||
| // Process each suite sequentially to minimize memory usage and I/O operations | ||
| // Each suite is: 1) walked once, 2) files read once, 3) all tools run, 4) memory freed | ||
| self.process_test262_suite(); | ||
| self.process_babel_suite(); | ||
| self.process_typescript_suite(); | ||
| self.process_misc_suite(); | ||
| self.run_transpiler(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical bug: run_default() no longer runs all test suites. The refactored method is missing:
minifier_node_compattests (fromNodeCompatSuite)estree_acorn_jsxtests (fromAcornJsxSuite)
These test suites were previously executed via run_minifier() and run_estree() but are not included in any of the new process_*_suite() methods.
Fix: Add the missing test suites:
pub fn run_default(&self) {
self.process_test262_suite();
self.process_babel_suite();
self.process_typescript_suite();
self.process_misc_suite();
self.run_transpiler();
// Add missing test suites
let node_compat_files = {
let suite = NodeCompatSuite::<MinifierNodeCompatCase>::new();
DiscoveredFiles::discover(&FileDiscoveryConfig {
test_root: suite.get_test_root(),
filter: self.filter.as_deref(),
skip_test_path: Box::new(|path| suite.skip_test_path(path)),
skip_test_crawl: suite.skip_test_crawl(),
suite_name: "minifier_node_compat",
})
};
NodeCompatSuite::<MinifierNodeCompatCase>::new()
.run_with_discovered_files("minifier_node_compat", self, &node_compat_files);
let acorn_jsx_files = {
let suite = AcornJsxSuite::<EstreeJsxCase>::new();
DiscoveredFiles::discover(&FileDiscoveryConfig {
test_root: suite.get_test_root(),
filter: self.filter.as_deref(),
skip_test_path: Box::new(|path| suite.skip_test_path(path)),
skip_test_crawl: suite.skip_test_crawl(),
suite_name: "estree_acorn_jsx",
})
};
AcornJsxSuite::<EstreeJsxCase>::new()
.run_with_discovered_files("estree_acorn_jsx", self, &acorn_jsx_files);
}| } | |
| pub fn run_default(&self) { | |
| self.run_parser(); | |
| self.run_semantic(); | |
| self.run_codegen(); | |
| self.run_formatter(); | |
| self.run_transformer(); | |
| // Process each suite sequentially to minimize memory usage and I/O operations | |
| // Each suite is: 1) walked once, 2) files read once, 3) all tools run, 4) memory freed | |
| self.process_test262_suite(); | |
| self.process_babel_suite(); | |
| self.process_typescript_suite(); | |
| self.process_misc_suite(); | |
| self.run_transpiler(); | |
| } | |
| pub fn run_default(&self) { | |
| // Process each suite sequentially to minimize memory usage and I/O operations | |
| // Each suite is: 1) walked once, 2) files read once, 3) all tools run, 4) memory freed | |
| self.process_test262_suite(); | |
| self.process_babel_suite(); | |
| self.process_typescript_suite(); | |
| self.process_misc_suite(); | |
| self.run_transpiler(); | |
| // Add missing test suites | |
| let node_compat_files = { | |
| let suite = NodeCompatSuite::<MinifierNodeCompatCase>::new(); | |
| DiscoveredFiles::discover(&FileDiscoveryConfig { | |
| test_root: suite.get_test_root(), | |
| filter: self.filter.as_deref(), | |
| skip_test_path: Box::new(|path| suite.skip_test_path(path)), | |
| skip_test_crawl: suite.skip_test_crawl(), | |
| suite_name: "minifier_node_compat", | |
| }) | |
| }; | |
| NodeCompatSuite::<MinifierNodeCompatCase>::new() | |
| .run_with_discovered_files("minifier_node_compat", self, &node_compat_files); | |
| let acorn_jsx_files = { | |
| let suite = AcornJsxSuite::<EstreeJsxCase>::new(); | |
| DiscoveredFiles::discover(&FileDiscoveryConfig { | |
| test_root: suite.get_test_root(), | |
| filter: self.filter.as_deref(), | |
| skip_test_path: Box::new(|path| suite.skip_test_path(path)), | |
| skip_test_crawl: suite.skip_test_crawl(), | |
| suite_name: "estree_acorn_jsx", | |
| }) | |
| }; | |
| AcornJsxSuite::<EstreeJsxCase>::new() | |
| .run_with_discovered_files("estree_acorn_jsx", self, &acorn_jsx_files); |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
|
This task is really hard to context engineer against, take your time with baby steps. |
61b001d to
f12d2a3
Compare
82451a3 to
c3b4153
Compare
3dc1696 to
2393724
Compare
|
I tried splitting the commit and also wrote some documentation. What do you think? |
|
@re-taro the code AI wrote is not what I have in mind, I suggest we abandon this PR. FYI I tried Claude multiple times but there is just too much code for AI to understand and get this into what I want 😅 |
|
I sincerely apologize. |
Summary
Improved the conformance runner (
tasks/coverage) by introducing a file discovery layer that eliminates redundant directory traversals. This significantly reduces memory usage and I/O operations, improving overall performance.Changes
New File:
file_discovery.rsDiscoveredFilesstruct with configuration supportRefactored
lib.rsPrevious Approach:
test262used by 7 tools → 7 redundant traversalsNew Approach:
process_test262_suite(), etc.)DiscoveredFilesrun_default()by delegating to suite-specific processing methodsUpdated
suite.rsrun_with_discovered_files()methodload_test_cases()to complement existingread_test_cases()Technical Details
File Discovery Flow
Memory Efficiency
Performance Optimization
Impact
run_parser(),run_semantic(), etc.) continue to workrun_default()uses the new optimized approachTesting
Related Issues
close #13991
Checklist