Port wasm solver to C and add regression coverage#218
Open
Soccera1 wants to merge 6 commits intotiagozip:mainfrom
Open
Port wasm solver to C and add regression coverage#218Soccera1 wants to merge 6 commits intotiagozip:mainfrom
Soccera1 wants to merge 6 commits intotiagozip:mainfrom
Conversation
- Convert wasm test scripts to `bun test` - Rename test files to `.test.js` - Keep node and browser solver regression coverage
Author
|
Re-open of #206 since all the commit hashes got fucked, closing branches, thus closing the PR. |
|
make phone happy |
Owner
|
did it end up being faster than the current rust one? |
Author
Only in bun. I'm currently working on resolving this issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
wasm/src/c/src/cap_wasm.c, including SHA-256 hashing, hex-prefix target parsing, nonce formatting, and wasm allocator shims.wasm/src/rustand updated the docs/package metadata to describe the solver as C-based WASM.wasm/src/c/test-regression.cjsbecame a fixed regression suite,wasm/test/node.jsnow asserts expected nonces for the full challenge set, andwasm/test/node_odd_difficulty.jsverifies the odd-length target case.wasm/build.jsso the build runs the regression suite.Commit breakdown
629ed2f: Port wasm from Rust to C978c1f5: Remove Rust codedee457e: Update testsThis was done as the rust implementation had many external dependencies, and rustc is very difficult to bootstrap. This version has no external dependencies; it can be compiled with -ffreestanding.
I have also done some unscientific testing and this is over 13% faster.
Summary by CodeRabbit
New Features
Documentation
Tests
Chores