The discrete-event physics core lives here and is compiled with Emscripten into src/wasm/oracle.js and src/wasm/oracle.wasm (Vite ?url assets; not under public/).
- Install Emscripten (e.g. clone
emsdk,./emsdk install latest,./emsdk activate latest). - In each terminal session where you build:
source /path/to/emsdk/emsdk_env.shFrom the repository root:
npm run build:wasmTo compile with the circuit breaker and verbose pair/quadratic std::cout logging (browser devtools console), enable the CMake option before building:
ORACLE_ZENO_DEBUG=1 npm run build:wasm
# or: npm run build:wasm:debugLeave this off for normal dev and production artifacts; it is only for diagnosing micro-collision / heap churn.
Both commands configure native/build with emcmake and copy artifacts into src/wasm/. After pulling C++ changes (heap purge, peek impact, separation nudge, etc.), run a wasm build again so oracle.wasm exports stay in sync with src/oracleWasm.ts.
include/oracle/— types, min-heap, collision math declarations,OracleEnginesrc/— collision math, engine, Emscripten C bindings
The TypeScript UI loads the module via src/oracleWasm.ts (import … from "./wasm/oracle.js?url").