Skip to content

Commit c2ee651

Browse files
sbryngelsonclaude
andcommitted
Guard run_restart against degenerate t_step_stop ≈ t_step_start
When t_step_stop - t_step_start < 2, the midpoint equals t_step_start and Phase 1 computes t_step_save = 0, violating the min: 1 constraint. Add an early MFCException to catch this case with a clear error message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d2a33be commit c2ee651

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

toolchain/mfc/test/case.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ def run(self, targets: List[Union[str, MFCTarget]], gpus: Set[int]) -> subproces
146146
def run_restart(self, targets, gpus):
147147
"""Run a restart roundtrip: simulate to midpoint, then restart to end."""
148148
mid_step = (self.params['t_step_start'] + self.params['t_step_stop']) // 2
149+
if mid_step <= self.params['t_step_start']:
150+
raise common.MFCException(
151+
f"run_restart: t_step_stop ({self.params['t_step_stop']}) is too close "
152+
f"to t_step_start ({self.params['t_step_start']}) for a restart roundtrip "
153+
f"(need t_step_stop - t_step_start >= 2)."
154+
)
149155
orig = dict(self.params)
150156

151157
try:

0 commit comments

Comments
 (0)