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

Update rev, remove whitelist and change default plan #102

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions .github/scripts/ci-btest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ echo "============ Bootstrape tests (btest) ($DEBUG_LEVEL) ============="
if test "$DEBUG_LEVEL" == "vanilla"; then
make btest TESTOPTS="-v -j${CI_JOBS}"
else
if test "$DEBUG_LEVEL" == "debug"; then
# One test case in this file is taking too much time to run in debug mode, resulting in timeout.
# It is because the default dynamic heap size does not work well with that pathological use case.
# We simply run it with a fixed heap size and exclude it from the rest of the btests.
TIMEOUT_TEST=../bootstraptest/test_eval.rb
MMTK_GC_TRIGGER=FixedHeapSize:100m make btest RUN_OPTS="--mmtk-plan=$CHOSEN_PLAN" TESTOPTS="-v $TIMEOUT_TEST"
rm $TIMEOUT_TEST
fi
# Some test cases take too much time to run in debug mode, resulting in timeout. It is
# because the default GC trigger (dynamic heap size) does not scale the heap size fast
# enough to keep up with the allocation. We simply run those tests with a fixed heap size
# and exclude them from the rest of the btests.
test_and_delete() {
TEST_NAME=$1
HEAP_SIZE=$2
TEST_PATH=../bootstraptest/test_${TEST_NAME}.rb
MMTK_GC_TRIGGER=FixedHeapSize:${HEAP_SIZE} make btest RUN_OPTS="--mmtk-plan=$CHOSEN_PLAN" TESTOPTS="-v $TEST_PATH"
rm $TEST_PATH
}

test_and_delete eval 100m
test_and_delete thread 400m

# Run other btests in the regular way.
make btest RUN_OPTS="--mmtk-plan=$CHOSEN_PLAN" TESTOPTS="-v -j${CI_JOBS}"
fi
2 changes: 0 additions & 2 deletions .github/scripts/ci-test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ case $DEBUG_LEVEL in
echo "Skipping test-all for $DEBUG_LEVEL..."
;;
release)
TEST_CASES=$(cat $BINDING_PATH/ruby-test-cases.txt | grep -v '#' | ruby -ne 'puts "../#{$_}"' | xargs)
make test-all \
TESTS="$TEST_CASES" \
RUN_OPTS="--mmtk-plan=$CHOSEN_PLAN" \
TESTOPTS="-v --excludes-dir=../test/.excludes-mmtk -j${CI_JOBS}"
;;
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RUBY_PATH=$BINDING_PATH/../ruby
RUBY_BUILD_PATH=$RUBY_PATH/build
RUBY_INSTALL_PATH=$RUBY_BUILD_PATH/install
RUSTUP_TOOLCHAIN=`cat $BINDING_PATH/mmtk/rust-toolchain`
DEFAULT_PLAN=Immix
DEFAULT_PLAN=StickyImmix

CI_JOBS=4

Expand Down
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,28 +251,33 @@ make btest RUN_OPTS="--mmtk-plan=StickyImmix"

### All tests

Note that currently it is not our priority to support Ractor. Some tests
involving Ractors are not enabled. You can get a list of enabled tests in the
file `ruby-test-cases.txt`.
We excluded some tests when testing against MMTk. Those test cases are listed
in `test/.excludes-mmtk` in the [`mmtk/ruby`](https://github.com/mmtk/ruby.git)
repository.

To run the tests
- Test cases that involve Ractors are excluded because it is currently not a
priority to support Ractors.
- Test cases that involve YJIT are excluded because we have not started
working on YJIT support, yet.
- Some tests involve implementation details of CRuby's default GC, such as
compaction and memsize. Those test cases are excluded, too.
- Other excluded tests involve things that are not yet implemented properly in
the MMTk binding.

```bash
TEST_CASES=$(grep -v '#' ../../mmtk-ruby/ruby-test-cases.txt | awk '{print("../"$1)}' | xargs)
make test-all TESTS="$TEST_CASES" RUN_OPTS="--mmtk-plan=StickyImmix"
```

Or in one line:
To run the tests, run the following command.

```bash
make test-all TESTS="$(grep -v '#' ../../mmtk-ruby/ruby-test-cases.txt | awk '{print("../"$1)}' | xargs)" RUN_OPTS="--mmtk-plan=StickyImmix"
make test-all RUN_OPTS="--mmtk-plan=StickyImmix" TESTOPTS="-v --excludes-dir=../test/.excludes-mmtk"
```

That assumes you are in the `build-debug` or `build-release` directory. Adjust
the path `../test/.excludes-mmtk` if you run it in a different directory.

## Current status

Known working:
- Supports MarkSweep, Immix and StickyImmix GC algorithms
- All test cases in `make btest`
- Most test cases in `make btest`
- Most test cases in `make test-all`
- Liquid benchmark (https://github.com/Shopify/liquid/blob/master/performance/benchmark.rb)

Expand Down
4 changes: 2 additions & 2 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2021"
# Metadata for the Ruby repository
[package.metadata.ci-repos.ruby]
repo = "mmtk/ruby" # This is used by actions/checkout, so the format is "owner/repo", not URL.
rev = "8590762fa53459a8f20e26bd8dd19e1760618f6b"
rev = "8c96eaf5cf4bb39610fc03797a42870f7eb8dca2"

[lib]
name = "mmtk_ruby"
Expand Down
130 changes: 0 additions & 130 deletions ruby-test-cases.txt

This file was deleted.