Repository navigation
The Eulerian split advection corrects every component of a symmetric tensor; the commit checks its frozen source - #1248
Conversation
…metric tensor; the commit checks its frozen source Eulerian._apply_split_advection walked a 2x2 symmetric tensor as two flat entries: the yy column took xy's correction and xy took none. It now walks the stored components through the variable's layout, as EulerianSUPG._transport_history does (test_1109, against a scalar history of each component). The commit projection's snapshot substitution does not reach psi_star[0] inside a wrapped expression; that is harmless only while the snapshot equals psi_star[0] at the commit, which commit_flux_to_history now checks, collectively. The nodal history's record fallback refreshes the snapshot before its projection reads it. Both were noted as TODO(BUG) in review of #1231. Underworld development team with AI support from Claude Code
|
Review from the Underworld development team with AI support from Claude Code (H1: review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)) Verdict on 22ca45a: ready to merge on green from this review.
The findings below are low only. MethodThe PR changes Python files only. Both the PR and development at the merge base (2079fdf) were run as Python overlays on a fresh build of 2079fdf:
Every run printed The parallel layouts are a test-only shell partition of the gmsh mesh:
Results1. The split correction. The test case is a degree-2
The residual of about 4e-4 is the same on the xx column before and after the PR. It comes from evaluating the gradient at the nodes, not from this change. 2. The snapshot check, a collective MAX. The test writes
3. The record fallback. The case is a Maxwell Stokes solve with the semi-Lagrangian history, where Stokes enables the snapshot, for 2 steps at Δt = 0.1. Then
So the PR changes this answer, and correctly: the fallback's record now agrees with the pointwise record to the projection's accuracy, where development's was about half of it. The fallback refresh is a rank-local copy, taken on the same path on every rank. 4. Scalar and vector Eulerian histories. The cases are degree-2
5. Tests.
The slice is Findings
Confirmed correct
Run and not run
Logs kept by the reviewer. Underworld development team with AI support from Claude Code |
This is the follow-up to #1231, from its second-desk review. No issue was filed, so this body is the report.
1. The Eulerian split advection on a symmetric tensor
Eulerian._apply_split_advectioncorrectspsi_star[0] -= dt (V . grad) psicomponent by component. For a 2×2 symmetric tensor it walked two data columns with the flat entriespsi[0], psi[1](xx, xy). A 2×2 symmetric tensor stores three components, laid out xx, yy, xy. So the yy column took xy's correction, and xy took none.This was found by reading the code and confirmed by
test_1109. The reach is a plainEulerianhistory, withV_fnset and split advection, on a symmetric tensor.EulerianSUPG, which the grid stress history uses, transports through_transport_historyand was not affected.The correction now walks the stored components through the variable's own layout, as
EulerianSUPG._transport_historydoes. A symmetric tensor contributes its upper triangle. Scalars and vectors keep their previous flat columns unchanged.Test:$x^2$ , $xy$ , $y^2$ under a rigid rotation, P2. They agree to 3e-8; the bound is 1e-6, and a misplaced column is off by about 0.1. Before the fix the test fails at (0, 1), where it measured that the yy column carries xy's correction.
test_1109compares each stored column with the correction a scalarEulerianhistory of that component alone takes:2. The commit's frozen source
#1231's review noted two latent gaps in the snapshot substitution. Neither changes a result today; both are now made safe.
.subsdoes not reachpsi_star[0]inside aUWexpression(at yield the viscosity readsE_eff_inv_II, which contains it), so that occurrence reads the history live. This is harmless only while the snapshot equalspsi_star[0]at the commit.commit_flux_to_historynow checks exactly that, collectively (MAX of the difference), and raises if anything wrote the history after the refresh.test_1109checks the refusal.psi_fncannot be evaluated pointwise) read the snapshot as last refreshed: after the previous trace-back, not the last commit. It now refreshes the snapshot before its projection. The path is reached only when the pointwise evaluation ofpsi_fnfails. Stokes passesstore_result=False, and withstore_result=Truea Stokes history evaluates pointwise and does not fall back; the parallel review had to force the fallback to reach it.The three
TODO(BUG)notes #1231 added are gone. The tracking entry was item 11 inissue-sweep/UNFILED-FINDINGS.mdof the campaigns repository.Tests
Measured by H7 (the stress-history desk, a Claude session on a 96-thread Linux workstation: Intel Xeon Gold 6240R, MPICH).
test_1109passes, and fails on the code before this PR. The 30 stress-history and viscoelastic files (the second-desk set plustest_1109), on 4 xdist workers: 240 passed, 1 failed.The one failure predates this PR.
test_1061, the forward history on Waters and King to t 6.5, level 3, reads 0.52651 against its pinned 0.5185. Development at 4ab522a, before #1231, gives exactly the same value (0.526506539677034). The pin predates a later change on development, which I have not bisected.Checklist (UW3 Style Charter)
level_1andtier_amarkers; it fails before the fix (S8)Underworld development team with AI support from Claude Code