Repository navigation
fix: coordinate and fault-frame correctness, stage S1 (spec 005) - #392
Merged
Merged
Conversation
This was referenced Nov 4, 2026
…p (wave 3) T005: validate the local transform and add BoundingBox.local_enclosure. T006: repair the support resize node count and validate rotation_xy. Regenerate the structured support golden file (27 resize values). T008: add the public world/local conversion methods. T012: keep the requested buffer, the 3D inferred centre, the in-plane slip and one extent row at the centre. Correct two test setups (T003 dimensions, T011 slip row scale).
T009: sample add_inequality_feature at world nodes. T010: sample orthogonal and equality references at world points, install target-local rows, count excluded rows, use the local enclosure for the support, and expand the support for restored points in world space. Correct the T007 affine residual test: compute the exact field without cancellation at large world coordinates. The tolerance is not changed.
… (wave 5) T013: do not project an explicit fault centre, because it is a world point (FR-010). Do not replace the requested fault buffer with the default 0.2 buffer. Correct the T011 test setup: give the SC-003 CG settings through solver_kwargs. The builder ignored the top-level values.
T015: record the golden review. test__fault_builder.py encodes no S1 defect. Record the 27 changed values of the structured support golden file. T016: add the S1 migration notice to COMPAT.md.
…e (wave 7) T017: fill verification.md with the pre-fix failures at ebc7c69, the post-fix results, the backend matrix, the rollback check and the S1 test time.
Copy the fault normal and slip so the array of the caller does not change (T012). Use the world fault centre in FaultSegment.fault_ellipsoid with no second conversion (T013). Add regression tests for both (T011 file). Keep only the 27 FR-014 changes in the structured support golden file (T006). Correct the FR ranges in the verification.md titles (T017).
Record the final checks and the open minor review findings in run-state.json.
The gradient amplifies solver noise by about 1/h, so it needs a looser limit than the value. Report max |dgrad| in the failure message.
2 tasks done
lachlangrose
force-pushed
the
feat/005-coordinate-frame-correctness
branch
from
November 4, 2026 06:16
d8f0b06 to
82ff968
Compare
lachlangrose
changed the base branch from
master
to
chore/lint-baseline-python-checks
November 4, 2026 06:16
…-frame-correctness # Conflicts: # packages/loop_interpolation/tests/golden/test_golden.py
This was referenced Nov 4, 2026
This was referenced Nov 4, 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.
Summary
This pull request implements stage S1 of spec 005 (coordinate and fault-frame correctness). The spec is in
specs/005-coordinate-frame-correctness/. All 17 S1 tasks are done. Stages S2 to S6 are not planned yet (OP1).Modelling observations, reference geometry and public queries stay in world coordinates. Local assembly uses the computational frame. Each boundary converts points and directions one time only.
Changes
loop_common.geometry): newvalidate_rigid_rotationandRigidRotationError.BoundingBox.set_local_transformandStructuredGrid3DGeometry.rotation_xyreject scale, shear, reflection and non-finite matrices, and keep the prior state. NewBoundingBox.local_enclosure.originandmaximumsetters stored a cell count as the node count, so the support lost one cell. They now enclose the requested bounds (FR-014).world_to_local_points,local_to_world_points,world_to_local_vectorsandlocal_to_world_vectorsmethods.builder.excluded_rows. The support uses the local enclosure of the world box, and the restored-point expansion works in world space.fault_centeris a world point; the factory does not project it.ValueError.fault_bufferandforce_mesh_geometryare kept; the factory no longer replaces them with the default 0.2 buffer.fault_ellipsoiduses the world centre.COMPAT.md: a new migration notice.Golden change
packages/loop_common/tests/data/structured_support_reference.npz: 27 resize values change (after_originandafter_maximumnstepsandmaximum). The old values did not enclose the requested bounds. All other keys keep their old values. The full record is inverification.md("Golden review").Test plan
ruff check LoopStructural packages: passpytest(root): 1206 passed, 5 skipped, in 867 s. Before S1: 755 passed, 5 skipped.pytest packages/loop_common/tests packages/loop_interpolation/tests: 912 passed, 47 skipped, 2 xfailedtest_rigid_transform_contract.py(42),test_reference_constraint_frames.py(312),test_fault_frame_analytic.py(55),test_fault_buffer_bounds.py(84). They take about 5 minutes.ebc7c699), the new tests fail as expected, and the rollback tests pass. Seeverification.md.Notes
black --checkreports 2 changed files that are not Black-clean:_fault_segment.pyand_discrete_interpolator.py. Neither file was Black-clean before this change, and only the task lines were changed.specs/005-coordinate-frame-correctness/run-state.json.builder.build()ignores the top-levelrtol,atolandmaxiterarguments and gives no warning (they must go insolver_kwargs). This is not changed here.🤖 Generated with Claude Code
https://claude.ai/code/session_01XADRvJLjMM6vnWTMwVqi61