CPU oracle
Collision, AI, Workers, and Node servers evaluate the authoritative ECMAScript f64 tree.
Procedural field contract · 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.
Drift contrast shows the absolute f64 ↔ f32 difference. Color is normalized to this sampled map and square-root stretched so tiny differences are visible; the readout remains the actual difference in field units.
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 native adapter backend as a materialization of it. The optional TypeGPU lane is a separately assayed port.
Field contract
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.
Live field index
Choose a focused field, inspect the live assay, or follow the production lineage. Each entry names the CPU consumer instead of hiding the work behind a shader.
Drive over GPU-displaced terrain while four CPU contact probes sample the authoritative field.
Pilot a hull whose heave, pitch, and roll come from the same field shaping the GPU water.
Fly through a visible flow volume while the CPU samples that vector field as a gameplay force.
Orbit an animated procedural body while CPU world rays query its authored spine and radius.
Run the TSL field graphs on this browser’s WebGPU or WebGL2 backend and download a device-scoped receipt.
The game where the shared terrain-adapter pattern was pressure-tested before being generalized into Matter Field.
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 |
|---|
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.
Open measurement
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