Skip to content

Debug fv3 - #126

Merged
pletzer merged 4 commits into
masterfrom
debug_fv3
Aug 21, 2026
Merged

Debug fv3#126
pletzer merged 4 commits into
masterfrom
debug_fv3

Conversation

@pletzer

@pletzer pletzer commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Cause B is now fully fixed, with all tests green (109 passed, ~44s — back to baseline speed).

What changed (src/vmtCellLocator.h, src/vmtCellLocator.cpp):

setCubedSphere(bool) — a new, explicit flag on the locator, threaded down only from grids where fixLonAcrossDateline && averageLonAtPole (the flags that already meant "gnomonic cubed sphere" on Grid_t, just never passed to the locator before). Wired into mnt_vectorinterp_buildLocator only — deliberately not into PolylineIntegral/RegridEdges, since their line-intersection code (collectIntersectionPoints) does its own independent flat-straight-line math that a spherical containsPoint would put out of sync with — that's a separate, deeper fix (great-circle arc intersection) I've documented at both call sites rather than half-applying.
Spherical bilinear patch (sphericalBilinearMap, invertSphericalBilinearPatch, containsPointCubedSphere) — for a cubed-sphere face, containment and parametric coordinates now come from one consistent model (double-slerp patch + Gauss-Newton inverse), instead of pairing an accurate spherical containment test with vtkQuad::EvaluatePosition's unrelated flat model — which is what caused the interpolation blow-ups.
Performance: each face's XYZ corners/centroid/radius are precomputed once in BuildLocator, and a cheap centroid-distance pre-filter (proven safe — 2× margin above the measured worst case) rejects the large majority of candidate cells before ever running Newton. Net: the originally-reported test went from 2s → 928s (suite) → back to 2s / 44s suite-wide.

Verified: target test passes with 0 bad cells; full suite (109 tests) passes with no regressions; the earlier catastrophic RegridEdges/PolylineIntegral blow-ups are gone because those locators now simply keep their original, unmodified flat behavior.

Background shell failed
python -m pytest mint/tests/ -q > /private/tmp/claude-502/-Users-apletzer-work/7041a9d5-c242-44a7-a484-486318749792/scratchpad/full_test_run.log 2>&1

That's a stale notification from the pre-performance-fix run I kicked off earlier (killed, exit 137) — superseded by the rerun I did after adding the caching/pre-filter fix, which completed cleanly (full_test_run2.log: 109 passed in 44s). Nothing to act on here; the current state is the one I already reported: cause B fully fixed, full suite green, performance back to baseline.

ta440 and others added 4 commits August 21, 2026 19:43
… down only from grids where fixLonAcrossDateline && averageLonAtPole (the flags that already meant "gnomonic cubed sphere" on Grid_t, just never passed to the locator before). Wired into mnt_vectorinterp_buildLocator only — deliberately not into PolylineIntegral/RegridEdges, since their line-intersection code (collectIntersectionPoints) does its own independent flat-straight-line math that a spherical containsPoint would put out of sync with — that's a separate, deeper fix (great-circle arc intersection) I've documented at both call sites rather than half-applying.

Spherical bilinear patch (sphericalBilinearMap, invertSphericalBilinearPatch, containsPointCubedSphere) — for a cubed-sphere face, containment and parametric coordinates now come from one consistent model (double-slerp patch + Gauss-Newton inverse), instead of pairing an accurate spherical containment test with vtkQuad::EvaluatePosition's unrelated flat model — which is what caused the interpolation blow-ups.
Performance: each face's XYZ corners/centroid/radius are precomputed once in BuildLocator, and a cheap centroid-distance pre-filter (proven safe — 2× margin above the measured worst case) rejects the large majority of candidate cells before ever running Newton. Net: the originally-reported test went from 2s → 928s (suite) → back to 2s / 44s suite-wide.
@pletzer
pletzer merged commit 738da3a into master Aug 21, 2026
6 checks passed
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