Phase 1 / Forge / Forge 3D narrowphase fast paths#57
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M1.1.4 — the four analytic per-pair narrowphase fast paths (fifth M1.1 sub-milestone), dispatched from
collideOrderedbefore GJK: sphere/sphere, sphere/box, capsule/capsule, box/box (radius-0 box only; a rounded box falls through to the generic path).Architecture
Each kernel computes only a
ContactSeed { normal (A→B), core closest points, base_penetration }fed to the unchangedgenerateManifold— so the feature_id producers, supporting-face clipping, ≤4 reduction, per-point penetration, order-independence and frame-stability are all inherited by construction. The fast path replaces only the GJK descent + EPA polytope expansion.fastSeed— 3-state dispatcher (not_handled/separated/contact);separatedmirrorsgjk.zig(conv_k=16,coord_scale=|Δpos|+coreExtent).closestSegSeg) — fixes box/box P1d and bypasses the M1.1.3 deep-rotated EPA frame-dependence for box/box.closestSegSeg→ 3 regimes viagenerateManifold(crossed via the E1 generator fix; collinear/parallel radial normal, never axial).segment × segmentnon-parallel → single witness.Threshold-class discipline (hardened across a 5-round external review, all RED-first in-milestone)
floatMin, never a geometric scale).max−min) — translation + scale + anisotropy invariant.k·floatEps·coordScale.Defects closed RED-first: degenerate-segment closest points, SAT separating-axis completeness, collinear-capsule normal, and the length-threshold class (fast_paths + the shared
manifold.ziggenerator).Validation
Differential vs
collideOrderedGeneric(gated on oracle self-consistency), closed-form P1d / extreme-aspect, oracle-free deep+rotated box/box (order-independence + inline-SAT MTV + frame-invariance), feature_id producer×pair×order matrix, and a scale×translation×anisotropy×decentre×order invariance matrix. Full suite green at f32 and-Dphysics_f64=true, debug + ReleaseSafe. Bench (ReleaseFast, dispatched/generic): 0.55 ss / 0.27 sb / 0.27 bb / 0.12 cc. Nogjk.zig/epa.zigtouched.Tracked (out of scope)
m1.1.3-hf-epa-frame-dependence; residual exposure: capsule/box + sphere/capsule stay on the generic path.generateManifoldprecision characteristic).🤖 Generated with Claude Code