Skip to content

fix(deck): overridden waves and current rows keep no stale values; validator checks the effective row - #128

Merged
SMI-Lab-Inha merged 3 commits into
devfrom
fix/overridden-wave-rows
Nov 8, 2026
Merged

SMI-Lab-Inha merged 3 commits into
devfrom
fix/overridden-wave-rows

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Two native parser bugs and a validator mismatch, all about OPTIONS rows that a later row overrides.

  • Stale gamma. An airy or stream waves row after a jonswap row inherited the stale gamma. jonswap 3 10 2000 0 waves followed by airy 2 8 0 waves was refused with "gamma <= 1e3". The airy/stream row now resets gamma to 1.
  • Stale current velocity. A profile current row after a uniform row inherited the stale velocity and was refused with "at most 1e3 m/s". The profile row now zeroes it.
  • Validator. It checked the wave and current magnitude bounds on every row, but the native parser checks only the row in effect, the last one. A deck the solver runs (airy 2000 8 0 waves followed by none waves) was therefore refused. The validator keeps the per-row rules on every row and applies the magnitude bounds to the effective row only; set_option keeps the full check.

The physics is unchanged, since neither stale value was read on those paths.

Tests.

  • test_deck_driver gains 4 overridden-row decks and 2 effective-row refusals. It had 3 mismatches before the fix.
  • 20 parity cases run against the validator (12 failed before) and against the driver.
  • CTest 368/368 on the default and Prescott kernels; pytest passes.

Found by the option sweep of an input-robustness fuzz campaign (18,357 cases).

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T18:00:40.974578Z 99c8500 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: bd76d5d8dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@read-the-docs-community

read-the-docs-community Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableDyn | 🛠️ Build #35737198 | 📁 Comparing 99c8500 against latest (e8f88f5)

  🔍 Preview build  

10 files changed · ± 10 modified

± Modified

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: f2f1654e09

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The last waves row and the last current row are the ones in effect, and the
reader checks the magnitude bounds of a regular, stream or JONSWAP waves row
(height, period, gamma) and of a current row (speed, profile depth) once
OPTIONS is read, on that row alone. Two values of an overridden row survived
into that check:

- an Airy or stream waves row kept the gamma of an earlier JONSWAP row, so
  "jonswap 3 10 2000 0 waves" followed by "airy 2 8 0 waves" was refused for
  a gamma above 1e3 that the Airy wave does not have;
- a profile current row kept the velocity of an earlier uniform row, so
  "uniform 2000 0 0 current" followed by a profile row was refused for a
  speed above 1e3 m/s.

Both rows now reset what the earlier row set. The physics is unchanged: a
regular wave never reads gamma and a profile current never reads the uniform
velocity.

The Python deck validator applied those magnitude bounds to every row as it
read it, and so refused a deck whose out-of-range row a later row overrides
(for example "airy 2000 8 0 waves" followed by "none waves"), which the solver
runs. It now checks the row rules (positive height and period, gamma >= 1,
distinct profile depths, every spectral and wavetrain row) on every row and
the magnitude bounds on the waves and current rows in effect, as the native
reader does. Editing a waves or current row keeps the full check.

Tests: test_deck_driver runs four overridden-row decks and refuses an
out-of-range effective row; the parity tests check twenty override cases
against the validator and, with the driver, against the native verdict.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The [Unreleased] entries of the open changes are added together in one
change, so that they do not conflict with each other.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
mypy (strict) refused the loop variable key, which the END CONNECTIONS
check of the same function uses as a tuple.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@SMI-Lab-Inha
SMI-Lab-Inha force-pushed the fix/overridden-wave-rows branch from f2f1654 to 99c8500 Compare November 8, 2026 17:59
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 99c850001d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SMI-Lab-Inha
SMI-Lab-Inha merged commit 45693e7 into dev Nov 8, 2026
22 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/overridden-wave-rows branch November 9, 2026 08:55
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