brepkit-wasm 3.0.0 → 3.0.2

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
@@ -147,25 +147,30 @@ Layered Cargo workspace. Each crate depends only on the same or lower layers, an
147
147
 
148
148
  ## Performance
149
149
 
150
- Median times from the [brepjs benchmark suite](https://github.com/andymai/brepjs/tree/main/benchmarks) (5 iterations, Node.js, Linux x86_64). WASM is single-threaded. Native benchmarks use criterion.
150
+ Median times from [brepkit-bench](https://github.com/andymai/brepkit-bench), the public repro harness (5 iterations, Node.js, Linux x86_64). WASM is single-threaded. Native benchmarks use criterion. Reproduce the WASM columns yourself:
151
+
152
+ ```bash
153
+ git clone https://github.com/andymai/brepkit-bench && cd brepkit-bench
154
+ npm ci && npm run bench
155
+ ```
151
156
 
152
157
  | Operation | brepkit (WASM) | OCCT (WASM) | Speedup | brepkit (native) |
153
158
  | ------------------------ | -------------- | ----------- | ------- | ---------------- |
154
- | fuse(box, box) (×10) | 0.5 ms | 43.7 ms | 87x | 122 µs |
155
- | cut(box, cylinder) (×10) | 28.3 ms | 64.3 ms | 2.3x | 9.3 ms |
156
- | box + chamfer | 0.2 ms | 5.4 ms | 27x | 46 µs |
157
- | box + fillet | 0.3 ms | 6.2 ms | 21x | 127 µs |
158
- | intersect(box, sphere) (×10) | 0.6 ms | 69.6 ms | 117x | 98 µs |
159
- | multi-boolean (16 holes) | 4.7 ms | 30.1 ms | 6.4x | 2.8 ms |
160
- | mesh sphere (tol=0.01) | 7.1 ms | 51.9 ms | 7.3x | 6.0 ms |
161
- | volume (box) (×100) | 0.18 ms | 8.3 ms | 47x | 56 µs |
162
- | exportSTEP (×10) | 0.9 ms | 14.3 ms | 16x | n/a |
163
-
164
- Every quoted row is output-verified before timing is compared: fuse, chamfer, and sphere volumes match exactly; cut, fillet, and multi-boolean volumes agree within 0.004%; the intersect result matches the closed-form spherical-octant volume (pinned by a regression test). The sphere mesh densities are comparable at equal tolerance (9,800 triangles vs 10,176).
159
+ | fuse(box, box) (×10) | 0.43 ms | 44.9 ms | 103x | 122 µs |
160
+ | cut(box, cylinder) (×10) | 19.2 ms | 64.9 ms | 3.4x | 9.3 ms |
161
+ | box + chamfer | 0.10 ms | 5.6 ms | 55x | 46 µs |
162
+ | box + fillet | 0.33 ms | 6.1 ms | 18x | 127 µs |
163
+ | intersect(box, sphere) (×10) | 0.23 ms | 59.1 ms | 252x | 98 µs |
164
+ | multi-boolean (16 holes) | 4.6 ms | 30.3 ms | 6.6x | 2.8 ms |
165
+ | mesh sphere (tol=0.01) | 6.2 ms | 49.4 ms | 7.9x | 6.0 ms |
166
+ | volume (box) (×100) | 0.18 ms | 9.8 ms | 54x | 56 µs |
167
+ | exportSTEP (×10) | 0.85 ms | 14.3 ms | 17x | n/a |
168
+
169
+ Every row is output-verified before timing, enforced by the harness itself: it refuses to time a row whose result is wrong. Fuse, chamfer, and box volumes must match exactly; cut, fillet, and multi-boolean volumes are checked against closed-form or cross-kernel values (measured fillet agreement: 0.004%); the intersect result must match the closed-form spherical-octant volume (also pinned by a regression test); exported STEP must re-import to the correct volume. The sphere mesh densities are comparable at equal tolerance (9,800 triangles vs 10,176).
165
170
 
166
171
  Booleans preserve analytic surfaces, so face counts stay low across chained operations. A nine-step compound boolean settles at 72 faces while a mesh-based approach would reach roughly 7,000. The same holds for blends: a straight edge filleted between two planar faces keeps an exact cylindrical wall rather than a NURBS approximation of one.
167
172
 
168
- > The OCCT comparison uses [occt-wasm](https://www.npmjs.com/package/occt-wasm), an OpenCASCADE build compiled to WebAssembly. Both kernels run single-threaded in Node.js. Boolean and `exportSTEP` rows are timed as batches of ten operations. WASM figures are medians of `kernel-comparison.bench.test.ts` (5 iterations) against a local `cargo xtask wasm-build` package, hash-verified at the require path. Native figures: `cargo bench -p brepkit-operations --bench cad_operations`, except the mesh-sphere row, which is measured at the same parameters as the WASM row (`tessellate_solid_with_tolerance`, deflection 0.01, angular 0.1 rad) via `crates/operations/examples/perf_probe.rs` — the criterion suite's sphere case meshes per-face and is not comparable. Full benchmark source: [brepjs/benchmarks](https://github.com/andymai/brepjs/tree/main/benchmarks). Boolean and measurement rows measured 2026-08-07 on the released 2.129.13/2.129.14 packages (npm tarball overlay, hash-verified at the require path); the remaining rows are the 2026-08-06 measurements on brepkit main post-2.129.8.
173
+ > The OCCT comparison uses [occt-wasm](https://www.npmjs.com/package/occt-wasm), an OpenCASCADE build compiled to WebAssembly. Both kernels run single-threaded in Node.js through the same [brepjs](https://github.com/andymai/brepjs) adapter layer, so adapter overhead is identical on both sides. Boolean and `exportSTEP` rows are timed as batches of ten operations. Speedups are computed from unrounded medians. WASM figures measured 2026-08-07 via [brepkit-bench](https://github.com/andymai/brepkit-bench) on the released npm packages, exact-pinned in its lockfile: `brepkit-wasm` 3.0.0, `occt-wasm` 3.8.3, `brepjs` 18.120.0. Native figures: `cargo bench -p brepkit-operations --bench cad_operations`, except the mesh-sphere row, which is measured at the same parameters as the WASM row (`tessellate_solid_with_tolerance`, deflection 0.01, angular 0.1 rad) via `crates/operations/examples/perf_probe.rs` — the criterion suite's sphere case meshes per-face and is not comparable.
169
174
 
170
175
  ## Data Exchange
171
176
 
@@ -5202,13 +5202,13 @@ export function __wbg___wbindgen_debug_string_c25d447a39f5578f(arg0, arg1) {
5202
5202
  export function __wbg___wbindgen_throw_344f42d3211c4765(arg0, arg1) {
5203
5203
  throw new Error(getStringFromWasm0(arg0, arg1));
5204
5204
  }
5205
- export function __wbg_error_b87951a6b006ac50(arg0, arg1) {
5205
+ export function __wbg_error_0b7fcb60f8ffab1d(arg0, arg1) {
5206
5206
  console.error(getStringFromWasm0(arg0, arg1));
5207
5207
  }
5208
- export function __wbg_log_63743db7238c93da(arg0, arg1) {
5208
+ export function __wbg_log_68a0a02cf2abd646(arg0, arg1) {
5209
5209
  console.log(getStringFromWasm0(arg0, arg1));
5210
5210
  }
5211
- export function __wbg_warn_86afbbe8a5f6547a(arg0, arg1) {
5211
+ export function __wbg_warn_dc01a74d58066770(arg0, arg1) {
5212
5212
  console.warn(getStringFromWasm0(arg0, arg1));
5213
5213
  }
5214
5214
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
Binary file
@@ -5216,13 +5216,13 @@ function __wbg_get_imports() {
5216
5216
  __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
5217
5217
  throw new Error(getStringFromWasm0(arg0, arg1));
5218
5218
  },
5219
- __wbg_error_b87951a6b006ac50: function(arg0, arg1) {
5219
+ __wbg_error_0b7fcb60f8ffab1d: function(arg0, arg1) {
5220
5220
  console.error(getStringFromWasm0(arg0, arg1));
5221
5221
  },
5222
- __wbg_log_63743db7238c93da: function(arg0, arg1) {
5222
+ __wbg_log_68a0a02cf2abd646: function(arg0, arg1) {
5223
5223
  console.log(getStringFromWasm0(arg0, arg1));
5224
5224
  },
5225
- __wbg_warn_86afbbe8a5f6547a: function(arg0, arg1) {
5225
+ __wbg_warn_dc01a74d58066770: function(arg0, arg1) {
5226
5226
  console.warn(getStringFromWasm0(arg0, arg1));
5227
5227
  },
5228
5228
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "brepkit-wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for brepkit — browser-native B-Rep solid modeling",
5
- "version": "3.0.0",
5
+ "version": "3.0.2",
6
6
  "license": "AGPL-3.0-only",
7
7
  "repository": {
8
8
  "type": "git",