Expand description
Typed WGSL geometry kernels with deterministic CPU oracles.
These kernels complement WGSL Forge without pretending that branch-heavy exact topology edits belong on the GPU. Parallel broad phases run here; uncertain predicates are explicitly returned to the robust CPU/WASM path.
§P1.9 — orient3d and incircle GPU batches
Added Orient3dF32 and IncircleF32 kernels, each with:
- A WGSL shader that computes the filtered determinant in f32 and flags
GPU_ORIENTATION_UNCERTAINwhen near the error bound. - A CPU/WASM oracle (
evaluate_orient3d_batch_f32,evaluate_incircle_batch_f32) that runs the full filtered → compensated → exact ladder.
The GPU is the fast broad phase; uncertain lanes fall back to the CPU oracle’s exact path. On the no-adapter path, the CPU oracle is the deterministic fallback (identical results, no GPU needed).
Structs§
Enums§
Constants§
- GPU_
ORIENTATION_ UNCERTAIN - GPU_
OVERLAP_ NO - GPU candidate-generation result flag: the pair is definitely not overlapping.
- GPU_
OVERLAP_ UNCERTAIN - GPU candidate-generation result flag: uncertain (near-boundary), needs CPU verification.
- GPU_
OVERLAP_ YES - GPU candidate-generation result flag: the pair is a definite overlap.
Functions§
- emit_
geometry_ wgsl - Deterministically emit a typed computational-geometry shader.
- evaluate_
aabb_ overlap_ batch_ f32 - CPU/WASM oracle for packed AABB pairs (12 f32s per pair). Returns exact overlap results: 1 = overlap, 0 = no overlap.
- evaluate_
incircle_ batch_ f32 - CPU/WASM oracle for packed
(ax,ay, bx,by, cx,cy, dx,dy)f32 quadruples (8 f32s per quad). Runs the full filtered → compensated → exact ladder viaincircle. - evaluate_
orient3d_ batch_ f32 - CPU/WASM oracle for packed
(ax,ay,az, bx,by,bz, cx,cy,cz, dx,dy,dz)f32 quadruples (12 f32s per quad). Runs the full filtered → compensated → exact ladder viaorient_3d. - evaluate_
orientation_ batch_ f32 - CPU/WASM oracle for packed
(ax, ay, bx, by, cx, cy)f32 triples. - gpu_
candidate_ box_ join - Generate candidate pairs from a BVH overlap query using GPU-style broad-phase filtering, then merge with CPU exact verification.
- gpu_
filter_ incircle_ f32 - GPU filter result for a single incircle quadruple (f32).
- gpu_
filter_ orient3d_ f32 - GPU filter result for a single orient3d quadruple (f32).
Returns +1 / -1 /
GPU_ORIENTATION_UNCERTAIN. - merge_
aabb_ overlap_ results - Deterministic merge: combine GPU candidate results with CPU verification.