Phase 1 / Forge / Sequential Impulses contact solver#60
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.6 — Forge 3D: Sequential Impulses contact solver
Seventh core sub-milestone of the M1.1 rigid arc — the velocity-level Sequential Impulses contact solver (Catto lineage, Box2D/Jolt tradition). The FIRST real consumer of the M1.1.3/4 contact manifolds and of the frame-stable
feature_idwarm-start contract. No positional bias of any kind (no Baumgarte, no split impulse); NGS position correction is M1.1.7.Gates (all RED-first on pinnable behaviors)
Bodygainsfriction/restitutionSoA columns (dropped fromBodyDescriptorsince M1.1.0) + stale-safe getters + domain debug asserts;pipeline/integration.zigsplit intointegrateVelocities/integratePositionswithintegratekept as their bit-identical composition (M1.1.5 tests untouched) so the solve sits between the passes.forge_3d/rigid/package: material combine rules, trig-free tangent basis,ContactConstraint+build(canonical broadphase pair keys →collidePair→ sorted by pair key) +prepare(lever arms, world inverse inertias, normal + two independent tangent effective masses,v_n⁻capture, true-zero inverse-mass skip).contact_cache.zig: double-buffered sorted flat cache, full key(pair_key, subshape_id=0, feature_id), binary-search per-feature matching, hit/miss counters,beginTick/endTick.warmStartwith world-space tangent reprojection onto the new basis + circular clamp.solveRange(from,to)(island-additivity seam): normal accumulated clampλn ≥ 0+ restitution bias (approaching-only, threshold-gated,v_n⁻captured before warm start).SolverConfig.μ·λn.Deviations from the frozen brief (recorded in the brief, ratified in review)
|v_n⁻| > threshold→v_n⁻ < −threshold(approaching-only). The|v_n⁻|form applied a negative bias to a capture-time separating contact, under-enforcing non-penetration (Claude.ai spec defect).combineFriction@sqrt(a*b)→@sqrt(a)*@sqrt(b)— identical geometric mean, finite across the whole domain (kills aninf·0 = NaNclamp path).A KB
engine-physics-forge.mdspec patch is pending for both (new Open-decisions bullet inCLAUDE.md).Flags for review
computePairsis moved-driven with fat-AABB hysteresis; the retention rule (retain while the FAT AABBs overlap) is normative for the M1.1.15step()/PhysicsWorld, pinned by the small-hop regression test (pre-merge Codex P1).velocity_solver.zig= 592 lines (over the 500-line Review guideline; brief-mandated single-file solver + inline tests,narrowphase.zig/broadphase.zigprecedent).forge_3d/root.zigexposesrigidas a namespace (pub const rigid).Verification
-Dphysics_f64=true, debug and ReleaseSafe.zig build test(debug + ReleaseSafe) green via the pre-push gate;zig buildclean;zig fmt --checkclean.step, M1.1.3/4/5 precedent).Brief:
briefs/M1.1.6-solver-sequential-impulses.md(Status → CLOSED, Execution log + Recorded deviations + Closing notes filled).Merge strategy: squash-and-merge. Merge and tag (
v0.11.6-solver-sequential-impulses) are Guy's — this PR does neither.🤖 Generated with Claude Code