Repository navigation
Speed up GGV: cheaper cross product, one worker per slice - #164
Merged
Merged
Conversation
np.cross spent most of its time in moveaxis bookkeeping on 3-vectors and 4x3 corner arrays. engines/dynpy/vector.cross uses the same component formulas, so results are bitwise identical. One speed slice drops from 57.5 s to 52.0 s on one core; the full GGV run from 189.2 s to 176.5 s on 4 cores with identical CSVs. The GGV pool was capped at 4 workers for 9 independent slices. It now uses one worker per slice up to the core count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It showed the cross product is bitwise identical to np.cross on the CI runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make lap-eval-qss solved its nine GGV speed slices serially, which was almost all of its wall time. The envelope workflow already solves the same slices in spawned workers through parallel.py, but the lap path caps drive power on both the envelope parameters and the DynPy vehicle, so it could not call generate_ggv_from_vehicle as is. Split parallel.py so callers can hand workers already projected envelope parameters and an event power cap, and route the lap path through it. Worker count stays the envelope rule: one per slice, at most four and at most the CPU count. Slices share no solver state, so the result is bit-identical to the serial solve; a test pins that on a two-speed lap envelope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#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
raorjun
changed the base branch from
main
to
claude/project-thread-srhlvw-parallel-ggv
November 24, 2026 18:55
rhorvath02
approved these changes
Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hread-qin29u after #172 landed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from
claude/project-thread-srhlvw-parallel-ggv
to
main
November 26, 2026 16:53
raorjun
pushed a commit
that referenced
this pull request
Nov 26, 2026
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.
What
GGV generation is about 10% faster per speed slice, and the output is bitwise identical.
np.crosstook 12 s of an 87 s profiled slice, mostly inmoveaxisbookkeeping on 3-vectors and 4x3 corner arrays. The newengines/dynpy/vector.crossuses NumPy's component formulas without that overhead, so results don't change. It replacesnp.crossin dynpy's models, aero and QSS code and inggv_generation.py.parallel.pycapped the GGV pool at 4 workers for 9 independent speed slices. It now runs one worker per slice, up to the core count.How to check
Measured back to back on a 4-core machine, Python 3.13:
make envelope-ggv(4 workers)ggv_first_principles.csv,ggv_track_performance_profile.csvandggv_track_velocity_profile.csvare byte-identical before and after.The worker change makes no difference on 4 cores, so it isn't measured here. On a machine with 9 or more cores, all 9 slices run at once instead of in 3 rounds.
tests/test_dynpy_vector.pychecks thatcrossis bitwise equal tonp.crossacross the shapes dynpy uses, including broadcasting.tests/test_ggv_parallel.pychecks that the worker count follows the core count, capped at the slice count.Notes
ggv_worker_countand kept the cap of 4, so the merge removes the cap there instead (MAX_GGV_WORKERSis gone). Generate lap-evaluation GGVs across worker processes #171'stest_worker_count_caps_at_slices_cpus_and_fouris renamedtest_worker_count_caps_at_slices_and_cpusand now expects 8 and 9 workers on 8 and 32 cores. Both GGV docs now say one process per slice, up to the CPU count. The GGV, parallel, vector and lap provenance tests pass on the merged branch.broadcast_arraysin the tire model (no measurable gain) and 4 instead of 8 steady-state workers on 4 cores (no gain: 410 s vs 404 s). Neither change is included.model.evaluateone point at a time. Batch GGV constraint Jacobians through one vectorized 3DOF evaluation #173 adds the batchedevaluatefor that.