Skip to content

Feature: no-simd#2

Open
Owanesh wants to merge 5 commits intoWebCryptomining:mainfrom
Owanesh:feature/no_simd
Open

Feature: no-simd#2
Owanesh wants to merge 5 commits intoWebCryptomining:mainfrom
Owanesh:feature/no_simd

Conversation

@Owanesh
Copy link

@Owanesh Owanesh commented Mar 6, 2026

Support for no SIMD environment

  • Added RANDOMX_NO_SIMD CMake option to compile WebRandomX with baseline-only WASM instructions (no SIMD128, bulk-memory, sign-extension, non-trapping
    float-to-int). SIMD intrinsics are replaced by scalar equivalents — hash output is bit-identical to the standard build.
  • Fixed HEAPU8 is undefined #1: newer Emscripten versions don't expose Module.HEAPU8 by default, breaking wrapper.js at init. Added EXPORTED_RUNTIME_METHODS to link flags.
  • Re-enabled auth handshake in miner.js (was commented out, so the server never sent jobs).
  • Added NormalModuleReplacementPlugin in webpack config to handle node: prefixed imports from Emscripten output.

What changed

  • CMakeLists.txtRANDOMX_NO_SIMD option, conditional compile/link flags, EXPORTED_RUNTIME_METHODS
  • src/cpp/rx_vec_i128.h — new C header: scalar union type + xor/load/store
  • src/cpp/intrin_wasm.h — scalar rx_* ops behind #ifdef RANDOMX_NO_SIMD
  • src/cpp/intrin_wasm_simd.hpp — scalar shuffle, unpack, mulu
  • src/cpp/blamka-round-simd.h — scalar BLAKE2 round (rotr, fBlaMka, G1/G2, DIAG/UNDIAG)
  • src/cpp/argon2_simd.c — scalar fill_block using rx_vec_i128
  • Makefile.noscimd — build wrapper
  • test_simd_comparison.sh — feature audit, correctness, hash equivalence, benchmark
  • README_NOSIMD.md — PoC docs
  • src/js/miner.js — uncommented auth send
  • webpack/webpack.config.common.jsnode: prefix plugin

Test plan

  • make -f Makefile.noscimd builds clean
  • ./test_simd_comparison.sh — all checks pass (identical hashes)
  • Standard SIMD build still works

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.

HEAPU8 is undefined

1 participant