feat: add threadman worker for Node.js multi-threading support#184
Draft
Kolezhniuk wants to merge 7 commits intofeature/sharedArrayBuffersfrom
Draft
feat: add threadman worker for Node.js multi-threading support#184Kolezhniuk wants to merge 7 commits intofeature/sharedArrayBuffersfrom
Kolezhniuk wants to merge 7 commits intofeature/sharedArrayBuffersfrom
Conversation
- Introduced `threadman_worker.js` to handle worker tasks using workerpool. - Updated `utils.js` to remove unnecessary global BigInt comment. - Refactored algebra tests to use Vitest framework, improving test structure and readability. - Converted all test files to use Vitest for assertions and lifecycle methods. - Added Vite configuration for building both Node.js and browser-compatible versions. - Implemented clean-up plugin in Vite to remove stale build artifacts before each build. - Enhanced test cases for various fields (Zq, Rat, Scalar) to ensure correctness and consistency.
- Deleted `threadman_thread.cjs` and `threadman_worker.cjs` as part of the transition to ESM. - Updated `threadman.node.js` to use a build-time injected worker path instead of relying on `__dirname`. - Modified `vite.config.js` to inject `__BUILD_WORKER_PATH__` during the build process, ensuring correct worker path resolution.
… in engine_fft.js - Fixed the assignment of `pr` in `bn128.js` to use the correct property from `bn128wasmPrebuilt`. - Enhanced the FFT implementation in `engine_fft.js` to utilize a fast WASM path when input format matches the native stride, falling back to a JS implementation otherwise. - Updated `wasm_curve.js` to return a sliced copy of the input array in `toJacobian` when the byte length matches the expected size, ensuring immutability.
- Implemented thread management logic in threadman_thread.cjs, including WebAssembly support for task execution. - Created thread function to handle memory allocation and task execution in a multi-threaded environment. - Added worker entry-point in threadman_worker.cjs to integrate with workerpool for Node.js. - Enabled task registration and execution within worker threads, ensuring compatibility with WebAssembly tasks.
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.
threadman_worker.jsto handle worker tasks using workerpool.utils.jsto remove unnecessary global BigInt comment.