Skip to content

toolchain: do not require (xyz)_domain extents on restarts - #1734

Open
sbryngelson wants to merge 1 commit into
masterfrom
fix/restart-domain-extents
Open

toolchain: do not require (xyz)_domain extents on restarts#1734
sbryngelson wants to merge 1 commit into
masterfrom
fix/restart-domain-extents

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

Description

(xyz)_domain%beg and (xyz)_domain%end were required whenever m > 0, in every stage. That is wrong twice over:

  1. The check ran in the wrong place. It lived in check_parameter_types(), which validate_common() calls, so it fired for simulation and post_process too. x_domain/y_domain/z_domain are pre-process-only parameters (_PRE in params/definitions.py); the other two executables never read them.
  2. It ignored restarts. With old_grid = T, pre-process reads the mesh from the existing grid files and sets x_domain%beg/end itself from x_cb (src/pre_process/m_start_up.fpp). The case file must not supply them, which is exactly what the restart instructions in docs/documentation/running.md tell users to do.

The shipped examples/1D_vacuum_restart/restart_case.py fails validation for this reason as well. CI never caught it because the lint job globs examples/*/case.py only, and ./mfc.sh validate reports constraint violations as warnings rather than a nonzero exit.

The requirement moves into a pre-process-only check_domain_extents() that returns early on old_grid = T. It also now covers y and z: only x was checked before, though the grid generator needs the extents of every dimension that has cells.

Closes #1733.

Type of change

  • Bug fix

Testing

  • ./mfc.sh validate examples/1D_vacuum_restart/restart_case.py passes all three stages (it failed all three before).
  • Ran every examples/*/*case*.py through all three stages before and after the change: the only difference is the restart case going from fail to pass. The new y/z requirements break no existing example.
  • New unit tests in params_tests/test_integration.py fail before this change and pass after.
  • ./mfc.sh format and ./mfc.sh precheck clean; toolchain pytest green.

Checklist

  • I added or updated tests for new behavior
  • I updated documentation if user-facing behavior changed

The docs already described the intended behavior; this makes the validator agree with them.

Copilot AI lite review requested due to automatic review settings August 18, 2026 15:21

Copilot AI 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.

Pull request overview

Updates the Python toolchain case validator so (xyz)_domain%beg/end are only required during pre_process grid generation, and are explicitly not required for restarts (old_grid = T) or for simulation/post_process, aligning validation behavior with restart workflows and parameter staging.

Changes:

  • Removed the x_domain%beg/end requirement from check_parameter_types() (which runs for all stages).
  • Added a new pre-process-only check_domain_extents() (skips when old_grid = T) and expanded coverage to y/z when n/p > 0.
  • Added integration tests covering missing extents, restart behavior, and non-pre-process stages.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
toolchain/mfc/case_validator.py Moves domain-extent requirements into a pre-process-only check, skips on restarts, and adds y/z coverage; updates physics-doc metadata.
toolchain/mfc/params_tests/test_integration.py Adds integration tests to prevent regressions for restart and stage-specific domain-extent requirements.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

"check_domain_extents": {
"title": "Domain Extents Specified",
"category": "Domain and Geometry",
"math": r"m > 0 \Rightarrow x_{\mathrm{beg}}, x_{\mathrm{end}} \ \mathrm{set}",
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.59%. Comparing base (55fb1b1) to head (310f4f2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1734   +/-   ##
=======================================
  Coverage   61.59%   61.59%           
=======================================
  Files          84       84           
  Lines       21493    21493           
  Branches     3176     3176           
=======================================
  Hits        13239    13239           
  Misses       6078     6078           
  Partials     2176     2176           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Case validator still requires domain/mesh info on restarts

2 participants