-
Notifications
You must be signed in to change notification settings - Fork 105
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
chore: Upgrade RTS Dependencies #4677
Conversation
* Patch Rust for shared Wasm libraries * Get rid of `musl` * Further simplify Wasm linking * Update benchmark results * No longer need `wasm-ld` patch * Update test result * Add distinction for Linux Ocaml build * Revert "No longer need `wasm-ld` patch" This reverts commit 3d0f34e. * Revert "Update test result" This reverts commit 8fc5c08. * Use patched wasm-ld during Rust build * Table offset must be at least 1 for Rust RTS * Adjust linker test result * Use bulk memory operations * Do not need `wasm-lld` patch with shared targets * Adjust expected test result * Adjust nix build script * Fix nix build script
Size compression is no longer needed for the specific Rust target backends. This is the latest perf diff on CI (locally repeated):
|
According to the GC benchmark, it seems that this upgrade/cleanup even improves performance:
|
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.
LGTM! Heroic work on the dylink0
stuff. Being stuck on clang-13
gave me nightmares...
Nice to see the cycle improvements too. Getting rid of musl
means one less wheel to maintain.
Good work! Added a few Qs...
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.
Great work! Not sure I fully understand the intricacies so 🤞
Adjusting the base library for latest Motoko RTS changes: * Also test enhanced orthogonal persistence with Wasm Memory 64. * Be prepared for the RTS dependency upgrade dfinity/motoko#4677 Changes: The original Musl float formatter has been replaced by the Rust implementation with some subtle format changes: - Numbers are displayed with the actually defined precision, no longer truncating trailing zeros and potentially revealing existing numeric errors. - The exponent is printed with an explicit sign and multiple digits. - NaN is formatted differently, now `NaN`, while the NaN sign bit is omitted. - The hexadecimal float formatter is no longer supported (`Float.format(#hex)`). This is probably acceptable as it is rarely used. Once we have dfinity/motoko#4677 merged in Motoko `master`, then we can remove the backwards compatibility of float formatting in these tests. Backwards compatibility is here needed to make `motoko-base` tests pass with the old Motoko compiler version. --------- Co-authored-by: Claudio Russo <claudio@dfinity.org>
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.
LGTM
Thank you for reviewing, Claudio and Gabor! |
revert default.nix change to adtgen
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.
LGTM!
Adjusting the base library for latest Motoko RTS changes: * Also test enhanced orthogonal persistence with Wasm Memory 64. * Be prepared for the RTS dependency upgrade dfinity/motoko#4677 Changes: The original Musl float formatter has been replaced by the Rust implementation with some subtle format changes: - Numbers are displayed with the actually defined precision, no longer truncating trailing zeros and potentially revealing existing numeric errors. - The exponent is printed with an explicit sign and multiple digits. - NaN is formatted differently, now `NaN`, while the NaN sign bit is omitted. - The hexadecimal float formatter is no longer supported (`Float.format(#hex)`). This is probably acceptable as it is rarely used. Once we have dfinity/motoko#4677 merged in Motoko `master`, then we can remove the backwards compatibility of float formatting in these tests. Backwards compatibility is here needed to make `motoko-base` tests pass with the old Motoko compiler version. --------- Co-authored-by: Claudio Russo <claudio@dfinity.org>
Upgrading Motoko RTS dependencies:
Special aspects:
dylink.0
instead ofdylink
.GOT.mem
for RTS in the Motoko linker.emscripten
: Use custom Rust targets .emscripten
by using custom Rust targets for generating PIC-relocatable Wasm.musl
by using Rust builtins instead.musl
: The output format ofNaN
andinfinity
has changed. Moreover, one particular output format (hexadecimal float) is no longer supported. Updating the documentation and base library is needed.musl
.Note:
nix-shell
crashes with a segmentation fault with this PR, you need to upgradenix
. For this, you need to manually uninstall and re-installnix
.