CPU oracle
Collision, AI, Workers, and Node servers evaluate the authoritative ECMAScript f64 tree.
01 Shared field math for 3D worlds · CPU + TSL + optional TypeGPU
Let CPU collision, buoyancy, forces, and hit tests query procedural fields that Three.js materializes on the GPU—then measure the remaining float drift instead of asserting equality.
02 The split-world problem
CPU physics, AI, servers, and hit tests cannot sample the vertex shader shaping a 3D world. Copying procedural math into JavaScript and shader code creates two authorities that can drift.
Matter Field makes the pure function authoritative and treats each backend as a materialization of it.
03 One expression tree
export function terrain(A, x, z) {
const n = fbm(A, x, z, 0.0016, 2);
return A.mul(
A.sub(n, A.f(0.5)),
A.f(24)
);
}
Collision, AI, Workers, and Node servers evaluate the authoritative ECMAScript f64 tree.
The zero-dependency core accepts the caller’s three/tsl namespace and preserves one adapter-authored tree.
Dual numbers derive normals and tangents from the exact same expression tree.
An optional, separately authored WebGPU port is precompiled for TypeGPU and @typegpu/three, then checked against the canonical fields.
04 Touch the contract
FIELDWORK combines the package into one mission. The focused labs isolate each field and its CPU gameplay consumer.
Recover a survey core while dunes, swell, wind, and a moving breach body all affect one amphibious craft.
Move across GPU-displaced terrain while the CPU collision oracle samples the same function.
One field drives the GPU-rendered swell and its CPU four-point buoyancy response.
GPU particles reveal the same vector field applying force to a CPU gameplay body.
Freely orbit the animated 3D body while a CPU world ray queries its authored spine and changing radius.
Run the same TSL graphs used by the 3D demos on WebGPU or WebGL2 and keep the JSON receipt.
One clean RTX 3070 WebGPU run records adapter-oracle migration, numeric drift, raw u32 hash agreement, and five Three integration smokes.
05 Measured, not asserted
Absolute error in field units decides pass/fail. ULP counts remain diagnostic because they explode near zero crossings.
| Hardware | Backend | Max observed abs | Max ULP | u32 hash | Status |
|---|
06 The honest contract
One committed golden agrees in browser, Worker, and supported Node CI.
Eleven raw u32 vectors agree in the current hardware receipts.
Restricted f32 operations tested against a declared absolute field-unit budget on each receipt.
07 Open fieldwork
The parity claim gets stronger through public measurement, not louder marketing. Run the assay, inspect the JSON, and contribute a missing vendor cell.
Run on this hardware