@provablehq/wasm 0.13.0 → 0.14.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,6 +41,65 @@ yarn build
41
41
 
42
42
  This will produce `.js` and `.wasm` files inside of the `dist` folder.
43
43
 
44
+ ### wasm64 build
45
+
46
+ The separate wasm64 build compiles the same Rust sources and snarkVM version as
47
+ wasm32 for `wasm64-unknown-unknown`, with an 8 GiB maximum, shared memory, atomics
48
+ and the existing Rayon pool. The caller still selects the thread count through
49
+ `initThreadPool(threads)`. Its bindings are published as
50
+ [`@provablehq/wasm64`](../wasm64/README.md), versioned in lockstep
51
+ with `@provablehq/wasm`.
52
+
53
+ From the repository root:
54
+
55
+ ```bash
56
+ yarn install --immutable
57
+ yarn build:wasm
58
+ yarn build:wasm64
59
+ yarn build:sdk
60
+ ```
61
+
62
+ Both builds use the toolchain in `rust-toolchain.toml`; the wasm64 build also
63
+ needs its `rust-src` component for `-Zbuild-std`. `yarn build:all` includes both
64
+ WASM variants and the SDK. The wasm64 artifacts are written to
65
+ `wasm64/dist/{testnet,mainnet}/` and `sdk/dist/wasm64/{testnet,mainnet}/`.
66
+ Development builds can set `BUILD_DEBUG=1` for the wasm64 build.
67
+
68
+ The wasm64 build uses Binaryen 125 instead of the wasm32 Binaryen 120, and a
69
+ wasm-bindgen CLI built from source with the same toolchain. It explicitly enables
70
+ the multivalue binding ABI, including for stripped release modules. Set
71
+ `WASM_OPT_BIN` to use a native Binaryen 125 `wasm-opt` executable instead of the
72
+ pinned npm tool.
73
+ Until upstream dependencies support threaded wasm64, the build applies the
74
+ compatibility patches in `build/wasm64/patches/` to checksum-verified crate
75
+ archives under `target/`. These patches implement 64-bit thread/TLS/stack
76
+ addresses and select browser backends in the dependencies. They contain no
77
+ proving diagnostics or changes to proof algorithms. Cargo's shared registry
78
+ sources are never modified. The first build needs network access; subsequent
79
+ builds reuse the prepared dependencies and compiled tools.
80
+
81
+ `build/wasm64/dependencies.js` generates `wasm64/Cargo.toml` from the current
82
+ SDK manifest, pointing at the same library and license-check sources. The
83
+ separate, tracked `wasm64/Cargo.lock` matches `Cargo.lock` except for the
84
+ patched crates, which resolve to the build-local copies. When updating SDK
85
+ dependencies, prepare the manifest with `node wasm/build/wasm64.js --prepare-only`
86
+ from the repository root, update that lockfile intentionally, and test both
87
+ variants. The snarkVM patches are pinned to the snarkVM release in `Cargo.toml`
88
+ and must be regenerated when it changes. The build itself always uses `--locked`;
89
+ it does not resolve or upgrade dependencies during compilation.
90
+
91
+ Run `yarn test:sdk:wasm64` on Node.js 24 after building. It runs the SDK test
92
+ suite against the wasm64 build instead of wasm32. Run
93
+ `yarn workspace @provablehq/sdk test:cjs:pack:wasm64` to pack and install the
94
+ three packages into a clean fixture, then test ESM, CommonJS, wasm64 shared
95
+ memory and Rayon workers on both networks. The local execution check downloads
96
+ public SRS parameters if they are not cached. On a Node.js line without wasm64
97
+ shared memory (before 24), add `--expect-unsupported` to assert instead that the
98
+ wasm64 entry points throw the documented error while the wasm32 entry still
99
+ works. The `runtime compat` jobs in `.github/workflows/sdk.yml` run both forms
100
+ on Node.js 20, 22, 24 and 26 for every pull request. The wasm64 GitHub Actions
101
+ workflow also checks the packages' export maps.
102
+
44
103
  ## Testing
45
104
 
46
105
  Run tests in Node.js
Binary file
@@ -18610,7 +18610,7 @@ function __wbg_get_imports(memory) {
18610
18610
  const ret = getObject(arg0).length;
18611
18611
  return ret;
18612
18612
  },
18613
- __wbg_log_b9601fb81f5cc1ef: function(arg0, arg1) {
18613
+ __wbg_log_f37cd919e7e1109b: function(arg0, arg1) {
18614
18614
  console.log(getStringFromWasm0(arg0, arg1));
18615
18615
  },
18616
18616
  __wbg_new_1dbf7428bba60a42: function(arg0) {
@@ -18636,7 +18636,7 @@ function __wbg_get_imports(memory) {
18636
18636
  const a = state0.a;
18637
18637
  state0.a = 0;
18638
18638
  try {
18639
- return __wasm_bindgen_func_elem_8331(a, state0.b, arg0, arg1);
18639
+ return __wasm_bindgen_func_elem_8267(a, state0.b, arg0, arg1);
18640
18640
  } finally {
18641
18641
  state0.a = a;
18642
18642
  }
@@ -18674,7 +18674,7 @@ function __wbg_get_imports(memory) {
18674
18674
  const a = state0.a;
18675
18675
  state0.a = 0;
18676
18676
  try {
18677
- return __wasm_bindgen_func_elem_8331(a, state0.b, arg0, arg1);
18677
+ return __wasm_bindgen_func_elem_8267(a, state0.b, arg0, arg1);
18678
18678
  } finally {
18679
18679
  state0.a = a;
18680
18680
  }
@@ -18821,7 +18821,7 @@ function __wbg_get_imports(memory) {
18821
18821
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
18822
18822
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
18823
18823
  },
18824
- __wbg_spawnWorker_1e5122f444d8e0b9: function(arg0, arg1, arg2, arg3) {
18824
+ __wbg_spawnWorker_94c0ee65f424ea90: function(arg0, arg1, arg2, arg3) {
18825
18825
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
18826
18826
  return addHeapObject(ret);
18827
18827
  },
@@ -18908,18 +18908,18 @@ function __wbg_get_imports(memory) {
18908
18908
  return addHeapObject(ret);
18909
18909
  },
18910
18910
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
18911
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 271, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18912
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3057);
18911
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 253, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18912
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3039);
18913
18913
  return addHeapObject(ret);
18914
18914
  },
18915
18915
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
18916
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 562, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
18917
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8021);
18916
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 532, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
18917
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_7957);
18918
18918
  return addHeapObject(ret);
18919
18919
  },
18920
18920
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
18921
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 361, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18922
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_7955);
18921
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 335, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18922
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_7891);
18923
18923
  return addHeapObject(ret);
18924
18924
  },
18925
18925
  __wbindgen_generic_0000000000000004: function(arg0) {
@@ -18981,22 +18981,22 @@ function __wbg_get_imports(memory) {
18981
18981
  };
18982
18982
  }
18983
18983
 
18984
- function __wasm_bindgen_func_elem_7955(arg0, arg1) {
18985
- wasm$1.__wasm_bindgen_func_elem_7955(arg0, arg1);
18984
+ function __wasm_bindgen_func_elem_7891(arg0, arg1) {
18985
+ wasm$1.__wasm_bindgen_func_elem_7891(arg0, arg1);
18986
18986
  }
18987
18987
 
18988
- function __wasm_bindgen_func_elem_3057(arg0, arg1, arg2) {
18989
- wasm$1.__wasm_bindgen_func_elem_3057(arg0, arg1, addHeapObject(arg2));
18988
+ function __wasm_bindgen_func_elem_3039(arg0, arg1, arg2) {
18989
+ wasm$1.__wasm_bindgen_func_elem_3039(arg0, arg1, addHeapObject(arg2));
18990
18990
  }
18991
18991
 
18992
- function __wasm_bindgen_func_elem_8331(arg0, arg1, arg2, arg3) {
18993
- wasm$1.__wasm_bindgen_func_elem_8331(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
18992
+ function __wasm_bindgen_func_elem_8267(arg0, arg1, arg2, arg3) {
18993
+ wasm$1.__wasm_bindgen_func_elem_8267(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
18994
18994
  }
18995
18995
 
18996
- function __wasm_bindgen_func_elem_8021(arg0, arg1, arg2) {
18996
+ function __wasm_bindgen_func_elem_7957(arg0, arg1, arg2) {
18997
18997
  try {
18998
18998
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
18999
- wasm$1.__wasm_bindgen_func_elem_8021(retptr, arg0, arg1, addHeapObject(arg2));
18999
+ wasm$1.__wasm_bindgen_func_elem_7957(retptr, arg0, arg1, addHeapObject(arg2));
19000
19000
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
19001
19001
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
19002
19002
  if (r1) {