Repository navigation
fix(builder): rotate data vectors through the faults in restore order - #428
Merged
Merged
Conversation
lachlangrose
added a commit
that referenced
this pull request
Nov 26, 2026
…nto feat/003-fault-evaluation-performance Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XADRvHhG72666JkYNHtzUx
The builder rotated each data vector (normal, gradient, tangent) by every fault at its present-day position, with no restored_through. A fault frame displaced by younger faults then restored the vector's tetrahedron through its whole chain of cutting faults at each step, so building a fault deep in a chain cost about (chain length)^2 x steps fault applications: the deepest fault of a 5-deep chain made 1661 fault calls and took 9.6 s, and deeper faults of a 94-fault model took up to 920 s each. Each vector is now rotated by each fault at its position restored so far, youngest fault first (the order restore_through uses), and each fault is told which faults are already restored. The same build takes 1.0 s with 12-14 fault calls per fault. With one fault, or faults that do not move each other's data, the rotation is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XADRvHhG72666JkYNHtzUx
lachlangrose
force-pushed
the
fix/rotate-vectors-in-restore-order
branch
from
November 26, 2026 22:28
362d3f1 to
915adaf
Compare
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 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
Before a feature is interpolated, its builder rotates each data vector (normal, gradient, tangent) through its faults with
FaultSegment.apply_to_vectors, which restores a small tetrahedron around each data point. It did this for every fault at the present-day position and withoutrestored_through. A fault frame displaced by younger faults then restored the tetrahedron through its whole chain of cutting faults at each of its steps, so building a fault deep in a cutting chain cost about (chain length)² × steps fault applications.Profile of building the deepest fault of a 5-deep chain: 9.6 s, of which 8.85 s in
apply_to_vectors, 1661 fault calls (the youngest fault applied 664 times). In a 94-fault model the deeper faults took 12 s, 88 s, 418 s, 920 s each to build.Fix
Rotate each vector by each fault at its position restored so far, youngest fault first (the order
restore_throughmoves the points), and tell each fault which faults are already restored. The frame is then read at the restored position, without restoring it again.restored_through).Tests
tests/unit/modelling/test_fault_vector_rotation.py: building a frame in a 3-fault chain does not nest fault applications (depth 1; 2 before the fix); with one fault the builder passes the data positions and norestored_through(unchanged behaviour).pytest tests: 2917 passed, 31 skipped. Ruff: no new findings.🤖 Generated with Claude Code
https://claude.ai/code/session_01XADRvHhG72666JkYNHtzUx