Repository navigation
fix(fault): keep a step direction where a cutting fault leaves no frame gradient - #425
Merged
Merged
Conversation
…me gradient Since #421 a gradient whose tetrahedron still crosses a fault after the refinement is NaN. A fault whose frame is cut by younger faults takes the step direction of apply_to_points from that gradient, so a point on a cutting fault was moved to NaN. A builder that restores a regular grid through such a fault then failed with "Cannot resize the grid" (seen with a chain of cuts: D cut by C, C by B, B by A; 215 of 10890 grid points of D were NaN). Where the frame of a cut fault has a NaN gradient at a finite point, use the gradient of the frame without the cutting faults there; a step only needs a direction. A frame without cutting faults keeps a NaN gradient, so its points stay NaN as before (test_fault_frame_validation). A point with a NaN coordinate is not moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XADRvHhG72666JkYNHtzUx
lachlangrose
added a commit
that referenced
this pull request
Nov 26, 2026
#425 (open against master) keeps a step direction where a cutting fault leaves no frame gradient after #421, so a point on a cutting fault is no longer moved to NaN. The conflict is in apply_to_points: the branch takes the frame gradient from _evaluate_frame; the fallback of #425 follows it. A cut frame always takes the legacy member path, where the NaN comes from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XADRvHhG72666JkYNHtzUx
lachlangrose
added a commit
that referenced
this pull request
Nov 26, 2026
…fter #425 (C-021) #425 moves a point on a cutting fault with the frame direction instead of to NaN. The C-021 capture (master a942177 with #424) had those NaN points in cutting_faults: 1 restored point, 1 value and 2 gradient rows, and one model id that they changed. The 5 changed outputs come from master 315dff4 with #425; the spec branch gives the same bits for all 970 golden arrays. The manifest records the update. On this branch a frame without faults takes the shared grid lookup, which does not call evaluate_gradient, so the #425 test of the NaN rule turns the lookup off to reach the member calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XADRvHhG72666JkYNHtzUx
lachlangrose
added a commit
that referenced
this pull request
Nov 26, 2026
…fter #427 (C-021) #427 restores a cutting fault before the fault it cuts. In cutting_faults the frame of fault_1 is faulted by fault_0, so fault_0 is now restored first and the frame of fault_1 makes no nested restoration. The 5 changed outputs of cutting_faults (group_0 value and gradient, the surface at 50 and the unit boundary distances; the model ids do not change) come from master 315dff4 with #425 and #427; the spec branch gives the same bits for all 970 golden arrays. The counts of cutting_faults follow: evaluate_model 2 fault calls (22), group_0 gradient 9 (29), none nested; the value call keeps one batch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XADRvHhG72666JkYNHtzUx
lachlangrose
added a commit
that referenced
this pull request
Nov 26, 2026
…o feat/003-fault-evaluation-performance The branch already had the same fixes as merges of their PR branches. Two conflicts: _fault_segment.py keeps the branch's placement of the #425 fallback (after the frame gradient of _evaluate_frame), and test_cut_fault_step_direction.py keeps the branch's version that turns the shared frame lookup off for the NaN-rule test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XADRvHhG72666JkYNHtzUx
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since #421, a gradient whose tetrahedron still crosses a fault after the refinement is NaN ("a point on a fault has no single gradient"). A fault whose frame is cut by younger faults takes the step direction of
apply_to_pointsfrom that gradient, so a point on a cutting fault is moved to NaN coordinates.A builder that restores a regular grid through such a fault then fails in
check_interpolation_geometrywithValueError: Cannot resize the grid(the grid bounds become NaN). Found while building a benchmark model with a chain of cutting faults (D cut by C, C by B, B by A): 215 of the 10 890 grid points of D were NaN, and the next group could not be built. It happens on master315dff43and on the spec 003 branch (#391).Fix
In
FaultSegment.apply_to_points, where the frame of a cut fault has a NaN gradient at a finite point, use the gradient of the frame without the cutting faults (interpolator.evaluate_gradient) at that point. A step only needs a direction.Unchanged:
test_fault_frame_validation::test_zero_gradient_protection_remains_effective[nan]checks).Tests
tests/unit/modelling/test_cut_fault_step_direction.py(under 1 s): a real cut pair (OLDcut byYOUNG) with NaN frame gradients on every other point. The cut frame still moves every point, about as far as before (2 tests fail before the fix, pass after); a frame without cutting faults keeps the NaN (passes before and after).pytest tests: 2914 passed, 31 skipped.🤖 Generated with Claude Code
https://claude.ai/code/session_01XADRvHhG72666JkYNHtzUx