Skip to content
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

Add parallel garbage collection test runner #6665

Merged
merged 13 commits into from
Oct 25, 2024
Merged

Conversation

JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented Oct 23, 2024

Description

Adds a comprehensive test suite that exercises garbage collection across all language test examples. The test:

  • Runs each example in its own isolated process to prevent cross-contamination
  • Uses rayon for parallel execution, reducing total test time to ~60s for all 267 tests
  • Provides a clear summary of passing/failing tests with specific error cases
  • Continues running all tests even when individual tests fail

The test identified 26 examples that need investigation for proper garbage collection handling, particularly around:

  • Constants and their declarations
  • Module dependencies
  • Type system (arrays, slices, strings)
  • Associated constants
  • References and self implementations

By running tests in isolation, we can now identify all problematic cases rather than stopping at the first failure.

The current projects that have garbage collection failures are:

associated_const_trait_const
references
reexport
main_args
fixing_generic_type
shadowing
far_jumps
str_slice
match_expressions
slice
const_decl_literal
raw_ptr
import_star_name_clash
module_dep_self
module_dep_multiple
self_impl_reassignment
const_decl
associated_const_abi_default
string_slice
fix_opcode_bug
tuple_field_reassignment
const_decl_with_call_path
module_dep
array_basics
u256
associated_const_impl_self_order

Note: I've temporarily disabled the run_all_garbage_collection_tests so this PR can be reviewed and pass CI. Then #6613 can rebase and reenable the test to ensure that PR allows these failing tests to pass.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@JoshuaBatty JoshuaBatty requested a review from a team as a code owner October 23, 2024 03:36
@JoshuaBatty JoshuaBatty self-assigned this Oct 23, 2024
@JoshuaBatty JoshuaBatty added language server LSP server compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Oct 23, 2024
@JoshuaBatty JoshuaBatty marked this pull request as draft October 23, 2024 03:41
Copy link

codspeed-hq bot commented Oct 23, 2024

CodSpeed Performance Report

Merging #6665 will not alter performance

Comparing josh/comprehensive_gc_tests (d739eee) with master (058f4e2)

Summary

✅ 22 untouched benchmarks

@JoshuaBatty JoshuaBatty requested a review from a team October 24, 2024 01:03
@JoshuaBatty JoshuaBatty marked this pull request as ready for review October 24, 2024 01:03
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

Nice work! It'll be good to have tests ensure these type of GC issues are solved once and for all.

@JoshuaBatty JoshuaBatty requested a review from a team October 24, 2024 03:58
Copy link
Member

@ironcev ironcev left a comment

Choose a reason for hiding this comment

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

I love the simplicity and the usefulness of this solution!

@ironcev ironcev merged commit 6b05844 into master Oct 25, 2024
40 checks passed
@ironcev ironcev deleted the josh/comprehensive_gc_tests branch October 25, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen language server LSP server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants