Skip to content

feat: add threadman worker for Node.js multi-threading support#184

Draft
Kolezhniuk wants to merge 4 commits intofeature/sharedArrayBuffersfrom
feat/esm-migration
Draft

feat: add threadman worker for Node.js multi-threading support#184
Kolezhniuk wants to merge 4 commits intofeature/sharedArrayBuffersfrom
feat/esm-migration

Conversation

@Kolezhniuk
Copy link
Copy Markdown
Contributor

  • 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.

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant