Skip to content

fix(checks): withhold state measurements for empty vectors - #735

Merged
kstonekuan merged 1 commit into
Hebbian-Robotics:mainfrom
Lohith248:fix/empty-motion-vectors
Oct 23, 2026
Merged

kstonekuan merged 1 commit into
Hebbian-Robotics:mainfrom
Lohith248:fix/empty-motion-vectors

Conversation

@Lohith248

@Lohith248 Lohith248 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Empty selected state arrays crash joint_discontinuity and idle_fraction, or produce false stationary/frozen evidence in the trajectory and integrity checks. All five checks now return only their sample count and no intervals for these inputs.

- empty selected vector -> reduction error or fabricated state measurements
+ empty selected vector -> sample count only, no intervals

ROS JointState permits empty state arrays. Unlike #666's zero-message case, these channels contain messages but no components in the selected field. The patch adds one parametrized regression using real MCAP messages and updates the public docstrings.

Evidence

  • Before: all five cases of tests/test_checks_nan_failopen.py::test_empty_position_vectors_withhold_motion_measurements fail against unmodified main at 6cf6e98.
    After: all five pass. A separate real-MCAP comparison confirms identical results for genuinely stationary positions across all five checks.
  • uv run --locked pytest tests/test_checks_nan_failopen.py tests/test_checks.py -q: 107 passed.
  • uv run --locked pytest -q -n 4 -rs: 2,557 passed, 8 skipped on Python 3.14.8. Skips require opt-in network access, MediaPipe/model assets, Docker, or a live bucket.
  • uv run --python 3.11 --locked pytest tests/test_checks_nan_failopen.py -q: 9 passed on Python 3.11.17 in a separate environment.
  • uv run --locked ruff check --fix, uv run --locked ruff format, and uv run --locked ty check: passed.

Validation used WSL Ubuntu 22.04, GCC 11.4.0, and verified FFmpeg/ffprobe 8.1 binaries on PATH.

Merge Danger

Door: two-way.

Reverting restores the previous check behavior without a data migration.

Blast Radius: checks.

Only selected arrays with no components take the new return paths. Public signatures, dependencies, schemas, and transform bytes are unchanged. Applications own their check versions; no transform behavior-version bump is needed.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 18:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions

Copy link
Copy Markdown

👋 Hi @Lohith248 — thank you so much for your first contribution to HFlow!

A maintainer will review your pull request as soon as possible. In the meantime:

💡 Tip: one open pull request per contributor at a time. Before starting an issue, check its sidebar for an assignee or a linked pull request. Either one means somebody is already on it; everything else is fair game.

We are excited to have you here and appreciate your help making the project better! 🙌

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The PR makes five state checks withhold motion and integrity measurements when the selected arrays contain no components.

  • State checks return counts when selected vectors are empty.

Reviews (1) · Last reviewed commit: "fix(checks): withhold state measurements..." · Reviewed by Greptile

@kstonekuan kstonekuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, merging. Thanks for the fix.

@kstonekuan
kstonekuan merged commit 43380ac into Hebbian-Robotics:main Oct 23, 2026
5 checks passed
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