Skip to content

fix: reject invalid current requests without partial updates - #24

Open
yeseorizi wants to merge 1 commit into
IOES-Lab:mainfrom
yeseorizi:fix/current-validation-20261022
Open

yeseorizi wants to merge 1 commit into
IOES-Lab:mainfrom
yeseorizi:fix/current-validation-20261022

Conversation

@yeseorizi

@yeseorizi yeseorizi commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Make ocean-current update requests all-or-nothing with respect to validation, and timestamp current messages with simulation time. Reproduced on main at 0d19c3f.

Previously, a request with a valid speed but an invalid angle could change the speed and then return success=false. NaN could also pass the model's range comparisons.

  • Reject non-finite mean/model parameters before mutating a Gauss-Markov model.
  • Validate speed and both angles on model copies before committing a constant or stratified update.
  • Check the stratified database, model count and model-row length before indexing a requested layer.
  • Use UpdateInfo.simTime for both current message timestamps instead of a node clock that can be wall time.

This preserves the existing stochastic/physical formulas. “All-or-nothing” here describes validation semantics, not a new cross-thread synchronization guarantee.

Reproduction and validation

  • New model tests cover 15 non-finite parameter combinations, rejection without state changes, and valid boundary behavior.
  • Independently rebuilt this branch's world/ROS packages against the unmodified main workspace with UBSan / float-cast-overflow enabled; all 3 model cases passed in 10 repeats (30 case executions).
  • Independent real-service rerun: constant-current 4/4 and stratified-current 8/8 passed after the fix, including invalid second/third fields, NaN and invalid layers; the stratified baseline failed 4 of those 8 checks.
  • Both current message types carried increasing simulation-scale timestamps in the independent scene run; cleanup left no simulator processes.
  • Changed-file pre-commit checks passed.
colcon build --packages-select posim_gz_world_plugins posim_ros_gz_plugins \
  --cmake-args -DBUILD_TESTING=ON
ctest --test-dir build/posim_gz_world_plugins --output-on-failure \
  -R '^test_current_model$' --repeat until-fail:10

Scope / limitations

Tested in Ubuntu 26.04 ARM64 Docker on an Apple Silicon Mac, ROS 2 Lyrical / Gazebo Jetty 10.5.0. Service integration used the local diagnostic ros_gz_bridge shutdown overlay; its shutdown behavior is a separate dependency issue. No new current model, WGPU change, real-ocean accuracy or native-host validation is claimed.

The existing locally patched asv_wave_sim dependency also remained installed during scene checks. Neither that renderer teardown patch nor the bridge overlay is included in this PR; successful scene cleanup is not attributed to this change alone.

Checklist

  • Forked the repository and kept the change focused.
  • Added model regression tests and ran targeted functional tests plus changed-file pre-commit.
  • Signed commits with DCO and disclosed AI assistance.
  • Entire repository colcon test is clean. The earlier full audit also reports pre-existing ament cpplint/uncrustify/copyright failures; no tests were disabled here.
  • Remote formatting CI passed. Docker jobs are intentionally skipped for fork PRs; this is not a Docker build result.

Assisted-by: OpenAI Codex (implementation, tests and PR preparation).

Assisted-by: OpenAI Codex
Signed-off-by: Kwon Yeseol <172019512+yeseorizi@users.noreply.github.com>

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.

1 participant