Skip to content

test: reproduce class grid blowup from failed orbit nodes - #156

Draft
krystophny wants to merge 2 commits into
mainfrom
cleanup/pr121
Draft

test: reproduce class grid blowup from failed orbit nodes#156
krystophny wants to merge 2 commits into
mainfrom
cleanup/pr121

Conversation

@krystophny

Copy link
Copy Markdown
Member

This draft PR publishes the existing committed state of cleanup/pr121 so the local branch/worktree can be retired after review.

Checks were not run in this cleanup operation; the branch-specific CI should provide validation.

phizenz and others added 2 commits August 10, 2026 10:42
get_matrix_doublecount takes no arguments and only writes amat at the very end,
so both of its error returns (starter failure, find_bounce hitting ierrfield
when the orbit leaves the field domain or crosses the wall) left amat holding
the previous node's values.  The caller had no way to tell a failed evaluation
from a good one.

Set ierr_get_matrix and clear amat on every failure path instead.

Two callers silently depended on the old stale-amat convention and are switched
to the explicit status.  Both poisoned amat(3,1) with huge() and tested whether
it survived the call: bound_class_wall/orbit_lost to detect wall losses, and
bound_class_delphi/eval_delphi to make a failed orbit read as beyond
delphi_max.  Clearing amat without updating them would have silently disabled
wall trimming and X-point trimming, with no diagnostic.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Drives sample_matrix with a stub evaluator that is linear outside one failed
stretch.  Order-7 Lagrange reproduces a linear function exactly, so a correct
refinement needs no splits at all and the grid must stay at its initial 9
nodes.

The test currently FAILS: the refinement chases the failed nodes to npoi=355
and exhausts itermax.  sample_matrix has no access to the status reported by
the previous commit, so it reads the cleared amat as structure and keeps
bisecting towards it.  Skipping failed nodes in the refinement decision is not
part of this branch yet.

Linked with LINK_GROUP:RESCAN because sample_matrix pulls sub_potato module
state, which calls into a profile_input implementation that potato_base
intentionally does not provide.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants