Skip to content

fix: reject mismatched operational acceleration trajectories - #908

Open
Afloat16 wants to merge 2 commits into
petercorke:mainfrom
Afloat16:fix/operational-acceleration-row-counts-20261030
Open

Afloat16 wants to merge 2 commits into
petercorke:mainfrom
Afloat16:fix/operational-acceleration-row-counts-20261030

Conversation

@Afloat16

@Afloat16 Afloat16 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

accel_x iterates q, xd and wrench together. Unequal trajectory row counts can silently truncate the calculation and leave output rows uninitialized.

Reject unequal row counts immediately after normalizing the inputs, before allocating or evaluating operational acceleration.

I used ChatGPT (GPT-6 Astra Pro) to help prepare this patch.

Numerical results and public behavior

Mismatched trajectories now raise ValueError. Valid single-row, multi-row and empty inputs retain their numerical behavior and shapes; public signatures are unchanged.

Regression coverage

All six unequal row-count permutations for Puma560 and Panda, valid single/multiple rows, empty batches, and independent closed-form operational dynamics controls.

On the unchanged original baseline, the 18 new regression cases reported 12 failures and 6 passes; all 18 pass with the fix.

Recorded focused validation

The earlier follow-up run used Linux and Python 3.12.14. The selected suites reported 191 passed, 65 skipped.

PYTHONPATH=src python -m pytest -q tests/test_accel_x_row_counts.py tests/test_DHRobot.py tests/test_coriolis_x.py tests/test_gravload_x.py tests/test_operational_space_closed_form.py

The result above is the previously recorded focused run. The new regression test files passed Ruff lint and formatting, and git diff --check passed. Full local repository, local documentation and local cross-platform runs are outside that result.

Current branch and hosted CI

The branch includes upstream main at 879fb363580840e19ee70b6b175e8cd3543e2b38; current head: 0265bbd7b41bc4b2fb0175e0767e1043b6d90fa0.

Current-head CI is successful, including mypy, core tests, the Linux/macOS/Windows test matrix and the documentation build. The docs-deploy and Dependabot auto-merge checks are skipped in their applicable workflow context.

Checklist

  • I personally read and understood the final diff and ran the core regression tests for unequal accel_x trajectory row counts and valid equal-length inputs.
  • Regression tests cover the affected behavior.
  • Numerical and public behavior changes are stated above.
  • Branch updated from main.
  • Current hosted CI passes.
  • PR is ready for review.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro)
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 10 complexity · 0 duplication

Metric Results
Complexity 10
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke

Copy link
Copy Markdown
Owner

Thank you. The change looks right to me.

Could you read the diff yourself and tick the "personally read, run and understood" box? Then please update the branch from main (that clears the red mypy, now fixed) and mark it ready for review.

@Afloat16
Afloat16 marked this pull request as ready for review November 3, 2026 08:32
@Afloat16

Afloat16 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

I have reviewed the final diff and the validation results. The branch includes main at 879fb363, and the PR is ready for review. CI for 0265bbd7 passes, including mypy, the test matrix and the documentation build. The change remains limited to rejecting unequal trajectory row counts; valid input behavior and public signatures are unchanged.

This branch has not been deployed

No deployments
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.

2 participants