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

Separate RTS Builds (Incremental and Non-Incremental GC) #3913

Merged
merged 847 commits into from May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
847 commits
Select commit Hold shift + click to select a range
5298a6a
Adjust test result
luc-blaeser Feb 23, 2023
24e5d8c
Adjust test result
luc-blaeser Feb 23, 2023
255065b
Adjust timer tests for slower incremental GC (in `force-gc` mode)
luc-blaeser Feb 24, 2023
c9a5651
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Feb 24, 2023
c4f7be0
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Feb 24, 2023
5e22983
Merge branch 'luc/incremental-preparation' into luc/incremental-mark-…
luc-blaeser Feb 24, 2023
088767c
Make test more stable for generational GC, especially `ic-ref-run`
luc-blaeser Feb 24, 2023
8ab5ee8
Unstable test results for `ic-ref-run` and incremental GC
luc-blaeser Feb 24, 2023
dca97e0
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Feb 24, 2023
39c1b9d
Skip ic-ref-run in timer test
luc-blaeser Feb 24, 2023
f75cce1
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Feb 28, 2023
736be28
Reenable base tests
luc-blaeser Feb 28, 2023
593f4aa
Update rts/motoko-rts/src/stream.rs
luc-blaeser Feb 28, 2023
9b4fe19
Improve comment
luc-blaeser Feb 28, 2023
2f96966
Unify heap base alignment
luc-blaeser Feb 28, 2023
e21907c
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Feb 28, 2023
70f92a4
Resolve merge conflicts
luc-blaeser Feb 28, 2023
e1d1152
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 1, 2023
4655ced
Adjust merge
luc-blaeser Mar 1, 2023
2ed4a94
Adjust test for uniform heap alignment
luc-blaeser Mar 1, 2023
7fd7e97
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 1, 2023
1ac0792
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 1, 2023
3a9520f
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 1, 2023
d30d9c6
Improving code comment
luc-blaeser Mar 1, 2023
88c9972
Adjust comment
luc-blaeser Mar 1, 2023
e63a76d
Merge branch 'luc/forwarding_pointer' of https://github.com/dfinity/m…
luc-blaeser Mar 1, 2023
a0851d7
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 1, 2023
b3c71e3
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 1, 2023
2f88dff
Improve comment and format
luc-blaeser Mar 2, 2023
e7d6d68
Optimization: Progress update on non-sliced array
luc-blaeser Mar 6, 2023
fa4bb32
Bug fix: Consider object moving during allocation increments
luc-blaeser Mar 7, 2023
ebb4bb7
Update benchmark result
luc-blaeser Mar 7, 2023
db9a14e
Switch for disabling force GC in certain tests
luc-blaeser Mar 7, 2023
eec88df
Bug fix: Consider object moving during allocation increments
luc-blaeser Mar 7, 2023
3586dea
Adjust benchmark results
luc-blaeser Mar 7, 2023
a5058ed
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 7, 2023
cf295f4
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 7, 2023
60fdc91
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 7, 2023
d2f5d94
Extra forwarding sanity checks for field accesses
luc-blaeser Mar 7, 2023
7e43553
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 7, 2023
f298706
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 7, 2023
80adc3c
ic-ref-run too slow for some timer tests with incremental GC
luc-blaeser Mar 7, 2023
d91c28c
Correct comment
luc-blaeser Mar 7, 2023
ce0016a
Stricter forward check (to be relaxed on higher PR)
luc-blaeser Mar 7, 2023
27c946c
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 7, 2023
2bf11ce
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 7, 2023
ca7889e
Revert "Stricter forward check (to be relaxed on higher PR)"
luc-blaeser Mar 7, 2023
1b67786
Bug fix in tabulate - and code comments
luc-blaeser Mar 8, 2023
f7f07e5
Rename iterate function
luc-blaeser Mar 8, 2023
e4deedc
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 8, 2023
2d8d787
Update benchmark result
luc-blaeser Mar 8, 2023
ca21038
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 8, 2023
c451d14
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 8, 2023
487a9a3
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 8, 2023
88a41d4
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 8, 2023
0a9e90c
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 10, 2023
96613d2
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 10, 2023
f0317f6
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 10, 2023
1b472d6
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 15, 2023
52fb919
Merge variant optimization for forwarding pointers
luc-blaeser Mar 15, 2023
b57e1b5
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 15, 2023
ec59c3a
Adjust mutbox write for allocation increments
luc-blaeser Mar 15, 2023
b5e8afc
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 15, 2023
fbc98d1
Improve comment
luc-blaeser Mar 17, 2023
fd2c35a
Refactor static write barrier elimination
luc-blaeser Mar 17, 2023
2c0f3e5
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 22, 2023
b176e9c
Squashed commit of the following:
luc-blaeser Mar 22, 2023
8c1a44a
Squashed commit of the following:
luc-blaeser Mar 22, 2023
0e83545
Adjust test run script
luc-blaeser Mar 23, 2023
f830c98
Postpone allocation increment
luc-blaeser Mar 23, 2023
a2465c2
Update benchmark results
luc-blaeser Mar 23, 2023
96995f9
Use the specific GC for drun tests
luc-blaeser Mar 23, 2023
f43b897
Tune the allocation increment factor
luc-blaeser Mar 23, 2023
017b10f
Postpone allocation increments
luc-blaeser Mar 23, 2023
0625fc0
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 23, 2023
9049280
Update benchmark results
luc-blaeser Mar 23, 2023
974b45d
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 23, 2023
d62ea71
Adjust benchmark results
luc-blaeser Mar 23, 2023
4383bff
Squashed commit of the following:
luc-blaeser Mar 23, 2023
12fa14d
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 23, 2023
301b8fe
Adjust benchmark results
luc-blaeser Mar 23, 2023
ed9b1c5
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 28, 2023
8600573
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 28, 2023
ad1fd57
Additional merge changes: Array index refactoring
luc-blaeser Mar 28, 2023
f4a7457
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 28, 2023
52935f0
Use two WASM functions for the forwarding check
luc-blaeser Mar 28, 2023
f037531
Prevent time overflow on large GC increments
luc-blaeser Mar 28, 2023
dd5782b
Refactor allocation barrier
luc-blaeser Mar 28, 2023
7e2d1cc
Refactor allocation barrier
luc-blaeser Mar 28, 2023
22289a7
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 28, 2023
040e909
Reformat
luc-blaeser Mar 28, 2023
1a68b8e
Use two WASM functions for the forwarding check
luc-blaeser Mar 28, 2023
4c9aec3
Update benchmark results
luc-blaeser Mar 28, 2023
4e8e363
Family of shared functions for heap allocation
luc-blaeser Mar 28, 2023
cafb090
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 28, 2023
9497da8
Update benchmark results
luc-blaeser Mar 28, 2023
2c0dcf6
Update benchmark results
luc-blaeser Mar 28, 2023
ff67a78
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 28, 2023
2235319
Protect against an accidental restart of a stopped GC
luc-blaeser Mar 28, 2023
f15dc6d
Add an assertion that the GC is not stopped
luc-blaeser Mar 28, 2023
294db87
Refactor memory initialization
luc-blaeser Mar 28, 2023
f98d3a9
Simplify pre-write barrier
luc-blaeser Mar 29, 2023
d9201cd
Improve mark bitmap iterator
luc-blaeser Mar 29, 2023
a17a170
Adjust comment
luc-blaeser Mar 29, 2023
55b896c
Provide rationale for partition size
luc-blaeser Mar 29, 2023
c710a9e
Provide rationale for survival rate threshold
luc-blaeser Mar 29, 2023
26d0172
Introduce constant for max memory size
luc-blaeser Mar 29, 2023
7bc5824
GC-dependent RTS builds
luc-blaeser Mar 30, 2023
1e919de
Fix typo
luc-blaeser Mar 30, 2023
39563e0
Compile with GC-dependent header layout
luc-blaeser Mar 30, 2023
8a14869
Adjust RTS dependency in compiler pipeline
luc-blaeser Mar 30, 2023
e7e5d57
Adjust RTS environment variables
luc-blaeser Mar 31, 2023
ce799bd
Update .gitignore
luc-blaeser Mar 31, 2023
c223674
Lazy evaluation of header size
luc-blaeser Mar 31, 2023
c9e74c3
Update benchmark results
luc-blaeser Mar 31, 2023
c1bf592
Adjust tests
luc-blaeser Mar 31, 2023
35dbfba
Adjust test
luc-blaeser Mar 31, 2023
a95e318
Code refactoring
luc-blaeser Mar 31, 2023
0272bd2
Remove wasm files
luc-blaeser Mar 31, 2023
64a2dec
Code refactoring
luc-blaeser Mar 31, 2023
4d0fa2a
Adjust test
luc-blaeser Mar 31, 2023
1e95bc3
Update benchmark results
luc-blaeser Mar 31, 2023
f1f2b68
Code refactoring
luc-blaeser Mar 31, 2023
dde737e
Performance optimization
luc-blaeser Mar 31, 2023
4aa623b
Update benchmark results
luc-blaeser Mar 31, 2023
c1e54ec
Performance optimization
luc-blaeser Mar 31, 2023
e892f2f
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 31, 2023
b677559
Update benchmark results
luc-blaeser Mar 31, 2023
71a1fc1
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 31, 2023
f83aa3e
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 31, 2023
db8f6c6
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser Mar 31, 2023
41268ff
Update default.nix
luc-blaeser Mar 31, 2023
f575886
Fix bug in script
luc-blaeser Mar 31, 2023
4c271c0
Fix comment
luc-blaeser Apr 5, 2023
edc5e73
Fix comment
luc-blaeser Apr 5, 2023
a3e954d
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 5, 2023
9cfef91
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 5, 2023
a2d849f
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 5, 2023
4585ccc
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser Apr 5, 2023
d39bcd6
Adjust comment
luc-blaeser Apr 5, 2023
0b05f6e
Guarantee progress on time advance
luc-blaeser Apr 5, 2023
5164da3
Improve debug assertion for mark stack
luc-blaeser Apr 5, 2023
d52662c
Simplify large partition lookup
luc-blaeser Apr 5, 2023
2b054c2
Add debug assertion
luc-blaeser Apr 5, 2023
1e05c58
Explain the allocation partition switch
luc-blaeser Apr 5, 2023
b573e01
Simplify collection heuristics
luc-blaeser Apr 5, 2023
51f2a76
Rename the allocation pointer for bitmap
luc-blaeser Apr 5, 2023
b3977d3
Refactoring: Remove superfluous condition
luc-blaeser Apr 5, 2023
15b5c57
Adjust test case
luc-blaeser Apr 5, 2023
6ce31fa
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 6, 2023
5b8683c
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 6, 2023
9899479
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 6, 2023
46f7298
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser Apr 6, 2023
cec6db1
Correct the variable declaration type
luc-blaeser Apr 6, 2023
564d0d7
Refactoring: Reduce double map into a single map
luc-blaeser Apr 6, 2023
e0cd563
Code refactoring
luc-blaeser Apr 6, 2023
41161eb
Code refactoring
luc-blaeser Apr 6, 2023
eee41e9
Code refactoring
luc-blaeser Apr 6, 2023
15aa49b
Code refactoring
luc-blaeser Apr 6, 2023
9de640f
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 6, 2023
d678852
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser Apr 6, 2023
d5549f8
Adjust tests for forwarding pointer
luc-blaeser Apr 6, 2023
4395b48
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 6, 2023
1925d03
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 6, 2023
6480160
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser Apr 6, 2023
5bd4da2
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 11, 2023
497baa8
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 11, 2023
d070ab2
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 11, 2023
2937ce3
Fix typo in comment
luc-blaeser Apr 11, 2023
65297d6
Improve comment
luc-blaeser Apr 11, 2023
921c9cb
Improve comment
luc-blaeser Apr 11, 2023
e5cf26a
Improve comment
luc-blaeser Apr 11, 2023
61bab8d
Improve comment
luc-blaeser Apr 11, 2023
f4e7ed6
Fix typo in comment
luc-blaeser Apr 11, 2023
04b0158
Use --force-gc in tests explicitly
luc-blaeser Apr 11, 2023
2f035b7
One more case with `--force-gc`
luc-blaeser Apr 11, 2023
9228bc1
Using a sentinel for empty mark stack
luc-blaeser Apr 11, 2023
80c9a5e
Limit evacuations to available free space
luc-blaeser Apr 12, 2023
59449d5
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 12, 2023
dff7277
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 12, 2023
242b2e4
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 12, 2023
a640762
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser Apr 12, 2023
3e6fb1c
review: incremental gc suggestions (#3927)
crusso Apr 12, 2023
20a2dba
Reformat
luc-blaeser Apr 12, 2023
a347d5d
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 12, 2023
9fe83ae
Reformat
luc-blaeser Apr 12, 2023
6cfa3fb
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 12, 2023
d4494b7
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser Apr 12, 2023
cf10be8
Improve comment
luc-blaeser Apr 12, 2023
a6d4c72
Fix units in bitmap iterator
luc-blaeser Apr 12, 2023
72af011
Revert unnecessary changes
luc-blaeser Apr 12, 2023
033c263
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 12, 2023
fd5bc9e
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 12, 2023
0c8a0ff
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser Apr 12, 2023
58d733c
Reformat
luc-blaeser Apr 12, 2023
6f915ff
Adjust memory check to new mark stack sentinel
luc-blaeser Apr 12, 2023
e1e82d3
Memory check: Invalidate tag in original object
luc-blaeser Apr 12, 2023
687b843
Refactor main incremental GC run function
luc-blaeser Apr 13, 2023
0513c82
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 13, 2023
47d20ee
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 13, 2023
e5e2d2f
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 13, 2023
1150cd9
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser Apr 13, 2023
2a7c11d
Bug fix in RTS test
luc-blaeser Apr 14, 2023
2159789
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser May 1, 2023
910eb1a
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 1, 2023
43b2dfa
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 1, 2023
01c0f8f
Updating nix hashes
github-actions[bot] May 1, 2023
2e7d7f3
Refactoring: Improve quicksort
luc-blaeser May 1, 2023
442eb15
Adjust tests for different stack size
luc-blaeser May 1, 2023
98dce2c
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 1, 2023
c7ba335
Refactoring: Stack size test cases
luc-blaeser May 1, 2023
b680ecc
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 1, 2023
e52ae23
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 1, 2023
fcb4e94
Revert "Updating nix hashes"
luc-blaeser May 1, 2023
33c14d7
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 1, 2023
2e956e2
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser May 2, 2023
d1365d6
Reformat Makefile
luc-blaeser May 2, 2023
d43e865
Reformat Makefile
luc-blaeser May 2, 2023
5331ee2
Refactor code generator
luc-blaeser May 2, 2023
a584af6
Code refactoring in compiler backend
luc-blaeser May 3, 2023
5a50f43
Refactor code generator
luc-blaeser May 3, 2023
80530f3
Refactor code generator
luc-blaeser May 3, 2023
7007955
Refactor code generator
luc-blaeser May 3, 2023
52b8d29
Refactor code generator
luc-blaeser May 3, 2023
ec81ca2
Refactor code generator
luc-blaeser May 3, 2023
3c55910
Enable assertion check for forwarding pointer field
luc-blaeser May 3, 2023
94af66f
Merge branch 'luc/separate-rts-builds' of https://github.com/dfinity/…
luc-blaeser May 3, 2023
eee7e7f
Use GC procedure macros in RTS unit tests
luc-blaeser May 3, 2023
f08c7f4
Fix assertion in compiler
luc-blaeser May 3, 2023
83cc04e
Use `--force-gc` again by default in tests
luc-blaeser May 4, 2023
09510f7
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser May 4, 2023
ed82364
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 4, 2023
4ba783a
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 4, 2023
949f102
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser May 4, 2023
ffb137e
Tuning the GC for the critical heap limit
luc-blaeser May 10, 2023
8d65545
More tuning of the critical GC memory limit
luc-blaeser May 10, 2023
647d517
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser May 10, 2023
0bba417
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 10, 2023
97afe73
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 10, 2023
b0efe6a
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser May 10, 2023
bb76ecf
Use structural equality in OCaml
luc-blaeser May 11, 2023
5cbc805
Use structural equality in OCaml
luc-blaeser May 11, 2023
00ba7ee
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser May 11, 2023
0457f54
Add GC random test
luc-blaeser May 11, 2023
ce3d393
Prepare `Changelog.md`
luc-blaeser May 11, 2023
cf2f0e0
Document the incremental GC option as beta testing
luc-blaeser May 12, 2023
b1b1e7f
Merge branch 'master' into luc/incremental-gc
luc-blaeser May 12, 2023
2918a2f
Merge branch 'luc/incremental-gc' into luc/separate-rts-builds
luc-blaeser May 12, 2023
50c9172
Merge branch 'master' into luc/separate-rts-builds
luc-blaeser May 12, 2023
be1a4e5
Downscale tests for copying GC
luc-blaeser May 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 10 additions & 5 deletions bin/wrapper.sh
Expand Up @@ -18,7 +18,7 @@ declare -A envs # list of expected environment variables with paths to products
# Define build products here
real[moc]=src/moc
hint[moc]="make -C $rel_root/src moc"
envs[moc]="MOC_RTS MOC_DEBUG_RTS"
envs[moc]="MOC_NON_INCREMENTAL_RELEASE_RTS MOC_NON_INCREMENTAL_DEBUG_RTS MOC_INCREMENTAL_RELEASE_RTS MOC_INCREMENTAL_DEBUG_RTS"
real[mo-ld]=src/mo-ld
hint[mo-ld]="make -C $rel_root/src mo-ld"
real[mo-doc]=src/mo-doc
Expand All @@ -30,11 +30,16 @@ hint[deser]="make -C $rel_root/src deser"
real[candid-tests]=src/candid-tests
hint[candid-tests]="make -C $rel_root/src candid-tests"

real[MOC_RTS]=rts/mo-rts.wasm
hint[MOC_RTS]="make -C $rel_root/rts"
rts_hint="make -C $rel_root/rts"

real[MOC_DEBUG_RTS]=rts/mo-rts-debug.wasm
hint[MOC_DEBUG_RTS]="make -C $rel_root/rts"
real[MOC_NON_INCREMENTAL_RELEASE_RTS]=rts/mo-rts.wasm
real[MOC_NON_INCREMENTAL_DEBUG_RTS]=rts/mo-rts-debug.wasm
real[MOC_INCREMENTAL_RELEASE_RTS]=rts/mo-rts-incremental.wasm
real[MOC_INCREMENTAL_DEBUG_RTS]=rts/mo-rts-incremental-debug.wasm

for var in ${envs[moc]}; do
hint[$var]=$rts_hint
done

# This is the command we want to run
exe=$(basename "$0")
Expand Down
7 changes: 7 additions & 0 deletions default.nix
Expand Up @@ -259,6 +259,8 @@ rec {
mkdir -p $out/rts
cp mo-rts.wasm $out/rts
cp mo-rts-debug.wasm $out/rts
cp mo-rts-incremental.wasm $out/rts
cp mo-rts-incremental-debug.wasm $out/rts
'';

# This needs to be self-contained. Remove mention of nix path in debug
Expand All @@ -269,6 +271,11 @@ rec {
-t ${rtsDeps} \
-t ${rustStdDeps} \
$out/rts/mo-rts.wasm $out/rts/mo-rts-debug.wasm
remove-references-to \
-t ${nixpkgs.rustc-nightly} \
-t ${rtsDeps} \
-t ${rustStdDeps} \
$out/rts/mo-rts-incremental.wasm $out/rts/mo-rts-incremental-debug.wasm
'';

allowedRequisites = [];
Expand Down
2 changes: 2 additions & 0 deletions rts/.gitignore
@@ -1,3 +1,5 @@
mo-rts.wasm
mo-rts-debug.wasm
mo-rts-incremental.wasm
mo-rts-incremental-debug.wasm
_build
85 changes: 64 additions & 21 deletions rts/Makefile
Expand Up @@ -111,7 +111,7 @@ CLANG_FLAGS = \

.PHONY: all

all: mo-rts.wasm mo-rts-debug.wasm
all: mo-rts.wasm mo-rts-debug.wasm mo-rts-incremental.wasm mo-rts-incremental-debug.wasm

_build:
mkdir -p $@
Expand Down Expand Up @@ -172,9 +172,6 @@ $(MUSL_WASM_A): $(MUSL_WASM_O)
# The rust code code of the RTS
#

RTS_RUST_WASM_A=_build/wasm/libmotoko_rts.a
RTS_RUST_DEBUG_WASM_A=_build/wasm/libmotoko_rts_debug.a

# This relies on bash and globstar, see https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make
RTS_RUST_FILES=$(shell ls **/*.rs)
RTS_CARGO_FILES=$(shell ls **/Cargo.toml)
Expand Down Expand Up @@ -221,23 +218,54 @@ $(TOMMATH_BINDINGS_RS): | _build
# Note that bindgen can't generate Rust macros or functions for CPP macros, so
# macros like `mp_get_u32` and `mp_isneg` need to be manually implemented.

RTS_DEPENDENCIES=$(TOMMATH_BINDINGS_RS) $(RTS_RUST_FILES) $(RTS_CARGO_FILES) | _build/wasm
RTS_BUILD=cd motoko-rts && cargo build --target=wasm32-unknown-emscripten -Zbuild-std=core,alloc
RTS_DEBUG_BUILD=$(RTS_BUILD)
RTS_RELEASE_BUILD=$(RTS_BUILD) --release
RTS_DEBUG_TARGET=motoko-rts/target/wasm32-unknown-emscripten/debug/libmotoko_rts.a
RTS_RELEASE_TARGET=motoko-rts/target/wasm32-unknown-emscripten/release/libmotoko_rts.a

RTS_RUST_NON_INCREMENTAL_WASM_A=_build/wasm/libmotoko_rts.a
RTS_RUST_NON_INCREMENTAL_DEBUG_WASM_A=_build/wasm/libmotoko_rts_debug.a

RTS_RUST_INCREMENTAL_WASM_A=_build/wasm/libmotoko_rts_incremental.a
RTS_RUST_INCREMENTAL_DEBUG_WASM_A=_build/wasm/libmotoko_rts_incremental_debug.a

$(RTS_RUST_NON_INCREMENTAL_WASM_A): $(RTS_DEPENDENCIES)
$(RTS_RELEASE_BUILD)
cp $(RTS_RELEASE_TARGET) $@

$(RTS_RUST_WASM_A): $(TOMMATH_BINDINGS_RS) $(RTS_RUST_FILES) $(RTS_CARGO_FILES) | _build/wasm
cd motoko-rts && cargo build --release --target=wasm32-unknown-emscripten -Zbuild-std=core,alloc
cp motoko-rts/target/wasm32-unknown-emscripten/release/libmotoko_rts.a $@
$(RTS_RUST_NON_INCREMENTAL_DEBUG_WASM_A): $(RTS_DEPENDENCIES)
$(RTS_DEBUG_BUILD)
cp $(RTS_DEBUG_TARGET) $@

$(RTS_RUST_DEBUG_WASM_A): $(TOMMATH_BINDINGS_RS) $(RTS_RUST_FILES) $(RTS_CARGO_FILES) | _build/wasm
cd motoko-rts && cargo build --target=wasm32-unknown-emscripten -Zbuild-std=core,alloc
cp motoko-rts/target/wasm32-unknown-emscripten/debug/libmotoko_rts.a $@
$(RTS_RUST_INCREMENTAL_WASM_A): $(RTS_DEPENDENCIES)
$(RTS_RELEASE_BUILD) --features incremental_gc
cp $(RTS_RELEASE_TARGET) $@

$(RTS_RUST_INCREMENTAL_DEBUG_WASM_A): $(RTS_DEPENDENCIES)
$(RTS_DEBUG_BUILD) --features incremental_gc
cp $(RTS_DEBUG_TARGET) $@

#
# The test suite
#

TEST_DEPENDENCIES=$(TOMMATH_WASM_A) $(TOMMATH_BINDINGS_RS)
TEST_BUILD=cd motoko-rts-tests && cargo build --target=wasm32-wasi
TEST_RUN=wasmtime --disable-cache motoko-rts-tests/target/wasm32-wasi/debug/motoko-rts-tests.wasm

.PHONY: test
test: $(TOMMATH_WASM_A) $(TOMMATH_BINDINGS_RS)
cd motoko-rts-tests && cargo build --target=wasm32-wasi
wasmtime --disable-cache motoko-rts-tests/target/wasm32-wasi/debug/motoko-rts-tests.wasm

test: test-non-incremental test-incremental

test-non-incremental: $(TEST_DEPENDENCIES)
$(TEST_BUILD)
$(TEST_RUN)

test-incremental: $(TEST_DEPENDENCIES)
$(TEST_BUILD) --features incremental_gc
$(TEST_RUN)

#
# Putting it all together
Expand All @@ -260,30 +288,45 @@ EXPORTED_SYMBOLS=\
fmod \
log \

mo-rts.wasm: $(TOMMATH_WASM_A) $(MUSL_WASM_A) $(RTS_RUST_WASM_A)
WASM_A_DEPENDENCIES=$(TOMMATH_WASM_A) $(MUSL_WASM_A)
LINKER_OPTIONS=\
--import-memory --shared --no-entry --gc-sections \
$(EXPORTED_SYMBOLS:%=--export=%) \
--whole-archive

mo-rts.wasm: $(RTS_RUST_NON_INCREMENTAL_WASM_A) $(WASM_A_DEPENDENCIES)
$(WASM_LD) -o $@ \
--import-memory --shared --no-entry --gc-sections \
$(EXPORTED_SYMBOLS:%=--export=%) \
--whole-archive \
$(LINKER_OPTIONS) \
$+

mo-rts-debug.wasm: $(RTS_RUST_DEBUG_WASM_A) $(TOMMATH_WASM_A) $(MUSL_WASM_A)
mo-rts-debug.wasm: $(RTS_RUST_NON_INCREMENTAL_DEBUG_WASM_A) $(WASM_A_DEPENDENCIES)
$(WASM_LD) -o $@ \
--import-memory --shared --no-entry --gc-sections \
$(EXPORTED_SYMBOLS:%=--export=%) \
--whole-archive \
$(LINKER_OPTIONS) \
$+

mo-rts-incremental.wasm: $(RTS_RUST_INCREMENTAL_WASM_A) $(WASM_A_DEPENDENCIES)
$(WASM_LD) -o $@ \
$(LINKER_OPTIONS) \
$+

mo-rts-incremental-debug.wasm: $(RTS_RUST_INCREMENTAL_DEBUG_WASM_A) $(WASM_A_DEPENDENCIES)
$(WASM_LD) -o $@ \
$(LINKER_OPTIONS) \
$+

format:
cargo fmt --verbose --manifest-path motoko-rts/Cargo.toml
cargo fmt --verbose --manifest-path motoko-rts-tests/Cargo.toml
cargo fmt --verbose --manifest-path motoko-rts-macros/Cargo.toml

clean:
rm -rf \
_build \
mo-rts.wasm \
mo-rts-debug.wasm \
mo-rts-incremental.wasm \
mo-rts-incremental-debug.wasm \
motoko-rts/target \
motoko-rts-tests/target \
motoko-rts-macros/target \
motoko-rts/cargo-home
31 changes: 31 additions & 0 deletions rts/motoko-rts-macros/src/lib.rs
Expand Up @@ -136,3 +136,34 @@ pub fn ic_mem_fn(attr: TokenStream, input: TokenStream) -> TokenStream {
)
.into()
}

/// Feature macro for incremental GC features, in particular forwarding pointers.
/// Equivalent to using the attribute `#[cfg(feature = "incremental_gc")]`.
#[proc_macro_attribute]
pub fn incremental_gc(attr: TokenStream, input: TokenStream) -> TokenStream {
assert!(attr.is_empty());
let block = syn::parse_macro_input!(input as syn::Item);
quote!(
#[cfg(feature = "incremental_gc")]
#block
)
.into()
}

/// Feature macro for non-incremental GC features, in particular forwarding pointers.
/// Equivalent to using the attribute `#[cfg(not(feature = "incremental_gc"))]`.
#[proc_macro_attribute]
pub fn non_incremental_gc(attr: TokenStream, input: TokenStream) -> TokenStream {
assert!(attr.is_empty());
let block = syn::parse_macro_input!(input as syn::Item);
quote!(
#[cfg(not(feature = "incremental_gc"))]
#block
)
.into()
}

#[proc_macro]
pub fn is_incremental_gc(_item: TokenStream) -> TokenStream {
"cfg!(feature = \"incremental_gc\")".parse().unwrap()
}
1 change: 1 addition & 0 deletions rts/motoko-rts-tests/Cargo.lock

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

4 changes: 4 additions & 0 deletions rts/motoko-rts-tests/Cargo.toml
Expand Up @@ -4,10 +4,14 @@ version = "0.1.0"
authors = ["dfinity <sdk@dfinity.org"]
edition = "2018"

[features]
incremental_gc = ["motoko-rts/incremental_gc"]

[dependencies]
byteorder = "1.4.3"
fxhash = "0.2.1"
libc = { version = "0.2.139", default_features = false }
motoko-rts = { path = "../motoko-rts/native" }
oorandom = "11.1.3"
proptest = { version = "1.0.0", default-features = false, features = ["std"] }
motoko-rts-macros = { path = "../motoko-rts-macros" }