Skip to content

Close GGV boundary equations on every CPU - #172

Merged
raorjun merged 1 commit into
mainfrom
claude/project-thread-srhlvw-qss-polish
Nov 26, 2026
Merged

raorjun merged 1 commit into
mainfrom
claude/project-thread-srhlvw-qss-polish

Conversation

@raorjun

@raorjun raorjun commented Nov 24, 2026

Copy link
Copy Markdown
Member

What

Before: test_boundary_preserves_equilibrium_and_tire_domain[10-lateral-30.0] failed in CI and passed locally. At the lateral limit the car coasts, so total wheel torque sits on zero, exactly where the drive and brake distributions switch. SLSQP's finite differences straddle that kink and float rounding decides how, which left up to 5e-5 rad/s² on the nearly lifted inside rear's spin balance (0.79 N load). The test allows 1e-5, so the runner's CPU decided pass or fail. It was never test order: a 1e-12 nudge to the SLSQP start reproduces CI's number on any machine.

After: every accepted boundary gets a short Newton polish on its equations, run separately on each side of the torque kink, with the boundary value allowed to move by about the residual (it sits on a fold, so the other unknowns alone can't close it). The same nudged starts now close to about 1e-10. Reported lateral limit changes by ~1e-8 m/s². Boundary solves are about 10% slower.

How to check

  • tests/test_qss_algebraic.py::test_lateral_limit_closes_equations_whatever_the_rounding[0|2] nudges every SLSQP start by 1e-12 with a seeded RNG. Without this change those seeds leave 3.3e-5 and 1.2e-5; with it, under 1e-10 (asserted at 1e-7).
  • Two unit tests pin the polish itself: it solves on the side of the kink that has a root, and it never returns a point that breaks an inequality.
  • Full suite python3 -m pytest -n auto tests, ruff check . and make typecheck pass locally.
  • docs/reduced-order-dynamics.md explains the polish next to the GGV solver description.

Notes

#167 and #170 hit this same failure; they should go green once this is on main.


Generated by Claude Code

The lateral limit coasts, so total wheel torque sits on zero, where the
drive and brake distributions switch. SLSQP's finite differences straddle
that kink and float rounding decides how, which left up to 5e-5 rad/s^2 on
the nearly lifted inside rear's spin balance. CI's runners landed past the
test's 1e-5 tolerance while local runs did not.

Polish each accepted boundary with bounded Newton steps on each side of the
kink, letting the boundary value move by about the residual. Seeded 1e-12
start nudges that reproduce CI's failure now close to about 1e-10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raorjun
raorjun marked this pull request as ready for review November 24, 2026 16:35
raorjun pushed a commit that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raorjun pushed a commit that referenced this pull request Nov 24, 2026
#171 kept the envelope's four-worker cap and moved worker choice into
ggv_worker_count. This branch removes that cap, so the merge applies
the uncapped rule there: one process per slice, up to the CPU count.
The #171 worker-count test and both docs now state that rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raorjun pushed a commit that referenced this pull request Nov 24, 2026
Keeps both new imports in ggv_generation.py: the batched Jacobian
helper from this branch and vector.cross from #164.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raorjun pushed a commit that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raorjun pushed a commit that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@rhorvath02 rhorvath02 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current revision; no actionable code findings. Current CI checks pass. Please preserve the stack order: #172 → #171 → #164 → #173.

@raorjun
raorjun added this pull request to stack #175 November 26, 2026 16:35
@raorjun
raorjun merged commit ef98f2f into main Nov 26, 2026
5 checks passed
@raorjun
raorjun deleted the claude/project-thread-srhlvw-qss-polish branch November 26, 2026 16:37
raorjun pushed a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raorjun pushed a commit that referenced this pull request Nov 26, 2026
…hread-qin29u after #172 landed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raorjun pushed a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raorjun pushed a commit that referenced this pull request Nov 26, 2026
…batched-jac after #172 landed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raorjun pushed a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants