Repository navigation
One convergence reference for every solver: warm starts, the linear floor, the rotated loop (#911, #985, #924) - #1014
Conversation
For Louis's review before any code ("PETSc does not respect the original
residual of the solve when we warm start. We should try to find a DRY
solution"). It covers:
- one reference per solve() call, max(|F(x0)|, |F(0)|), with rules for a
datum-only forcing and a null space;
- the nonlinear target T from the user's tolerances;
- an inexact-Newton absolute floor eta*T on the outer and fieldsplit
linear solves, bounded by the round-off floor;
- one helper on SolverBaseClass, called from _snes_solve_with_retries and
the rotated loop, replacing five separate references;
- the PETSc mechanisms (SNES and KSP atol; UIRNorm not needed; EW kept);
- the issues it settles (#911/#985, #924, #883, #884, and the pressure
rtol overlap);
- the four-arm evidence plan.
It rests on hyperion's inventory on #911 and on a probe of test_0022's
rotated solve.
Underworld development team with AI support from Claude Code
The viscous stress vanishes at zero strain rate for any finite eta(0), so the viscosity cap or regularisation does not enter F(0)'s interior rows; what remains is the forcing, as a cold start measures it today. The one term that carries the cap is a nonzero weakly imposed velocity (gamma mu(0)/h g); for that case the reference leaves the weak boundary terms out. The evidence plan adds the notch, a zg95 viscoplastic run and a weak nonzero velocity, and records |F(x0)|, |F(0)| and the forcing-only norm on each. Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
Every native solve goes through _snes_solve_with_retries, which now calls _apply_convergence_reference: F_ref = max(|F(x0)|, |F(0)|), the SNES atol T = max(rtol F_ref, atol), and the outer KSP atol eta T (eta 0.1), restored after the solve. The saddle-point warm start's tolerance * |F(guess)| atol and its zero-iteration nrichardson pre-solve are gone. The probe's resume anchor takes the larger of its anchor and T. test_0028 (tier B): a nonlinear problem solved cold, then warm after a 1 % change in forcing, stops at the first iterate inside T on the saddle-point and scalar routes. On development the scalar warm solve passed T (9.3e-6 against 2.7e-4) and took one more step. The rotated loop, sub-KSP floors and the remaining references are the next stages; the evidence arms are still to run. Underworld development team with AI support from Claude Code
…e_residual The reference residual is a hook the equation owns, ||F(0)|| with the boundary data in place by default; an equation whose F(0) carries what no iterate measures (a weak nonzero velocity, a datum lift, a projected null space) overrides it. _apply_convergence_reference only measures the solve's own |F(x0)| and applies the rules, the same way on every route. Underworld development team with AI support from Claude Code
… same per-call target Underworld development team with AI support from Claude Code
…orkspace Underworld development team with AI support from Claude Code
…ear floor is relative An equation whose residual carries the last step's answer through a history (DuDt or DFDt) declares a zero reference, so a time step stops at rtol of its own first residual, PETSc's default. Under max(||F(x0)||, ||F(0)||) a step short against the diffusion time stopped near rtol of the whole field. _convergence_reference_rule overrides the declaration on a solver, so both rules can be measured while the ruling is pending. The linear floor was a KSP atol in ||F|| units. GMRES with left preconditioning measures the preconditioned residual, about 40 times smaller on the scalar route, so a Newton step's linear solve stopped at its first residual and the SNES ended on a zero step above its target. The floor is now set before each linear solve as a reduction of its own first residual, eta T / ||F(x_k)||, which is right in either norm. test_0028 gains a nonlinear advection-diffusion time step; both the max rule and the absolute floor fail it. Underworld development team with AI support from Claude Code
…a relative reduction Underworld development team with AI support from Claude Code
…g 2026-11-08) Underworld development team with AI support from Claude Code
…eaves set rtols alone The floor as a KSP pre-solve replaced PETSc's own: on the saddle-point route Eisenstat-Walker is KSPPreSolve_SNESEW, so the floor switched EW off, and clearing the hook after the solve left it off. The floor is now appended to the outer KSP's convergence test (once per KSP, the solver held weakly), scaled into the KSP's own norm by the ratio of its first residual to ||F(x_k)||. EW sets the rtol and the floor bounds it from below, as the design intends. The floor replaces only the ksp_rtol that tolerance derives (_TOLERANCE_DERIVED_KEYS, or 0.1 tolerance on the routes without the table). A linear rtol set by the user, or by the library for a solve it wants tight, stays in force: five suite tests that set ksp_rtol 1e-8 to 1e-10 had their answers loosened to the nonlinear target. test_0028: Eisenstat-Walker's rtol_0 reaches the first linear solve, and a set ksp_rtol is not loosened. The pre-solve floor and the absolute floor each fail one. Underworld development team with AI support from Claude Code
…ence-reference-policy Underworld development team with AI support from Claude Code
…911) The rotated Newton loop took max(r0, ||F(0)||) on every warm start. It now asks the solver (_resolved_reference_rule): a stationary equation keeps the max, and one with memory, a viscoelastic step, measures its own first residual. Each increment's linear solves, outer and fieldsplit, stop at the floor max(0.1 T, 10 eps |A|_F |u|), T the loop's own target (from the paused bugfix/rotated-inexact-newton-911 patch, on the vector route too). Every rotated KSP is FGMRES, which measures the true residual, so the floor is an absolute tolerance there. test_0022 goes from 758 s to 13.6 s on wombat: its last increments' linear solves took 300 (the cap), 32 and 12 iterations, and now take 1. Underworld development team with AI support from Claude Code
test_0022's forward problem at the parameter its finite difference takes, a transversely isotropic power law in an annulus under rotated free slip at tolerance 1e-11. With the increment floor its linear iterations are [1, 2, 1, 1, 1, 1] and it passes in 7.6 s; with the floor removed at run time it ends with SNES reason -6 after 96 s. The design note records the rotated stage, and that #964's projection threshold keyed on the tolerance is the per-call one while the rotated atol is fixed. Underworld development team with AI support from Claude Code
…NES tolerances (#924) - The linear floor and the wall-clock guard each need petsc4py's one Python convergence test per KSP; with both, the guard raised "converged callback already set" (test_0203). utilities/ksp_convergence_tests prepends one dispatcher per KSP and both register in it. - The rotated increment floor drops its round-off term, 10 eps |A|_F |u|, which overstated round-off at least 300 times: on test_1136's Picard power-law box it stalled the loop at 3.4e-9 against a target of 1.1e-11 (a zero step, line search failed), where development converges in 60 increments. The floor is now min(0.1 T, 0.1 |b|), the native rule: every increment cuts its residual at least tenfold. The box converges in 60 again, test_0022's forward problem in 6. - A NaN or infinite target leaves the tolerances alone, so the solve fails on the residual with its own reason (test_1115: PETSc error 63 instead of reason -9). - #924: the rotated loop takes a user-set snes_rtol (through the saddle point's owned-option record, as snes_max_it), snes_atol and snes_stol. test_1143, tier B, fails on the build before: the loop ran past a user rtol of 1e-3, and took 7 increments under a user atol ten times the cold residual. Underworld development team with AI support from Claude Code
…lerance (ruling) A boundary term that depends on the unknowns and is nonzero at rest, a Nitsche or penalty condition with a nonzero datum, puts the penalty times the datum into F(0), at the coefficient at rest. On a Nitsche-driven power-law lid ||F(0)|| grew with the viscosity at rest (118, 548, 2540) and a warm re-solve held to it was 70 to 1300 times less accurate than under PETSc's test (3.6e-4 to 7.7e-3 against 5.2e-6 to 5.9e-6). _weak_datum reads the boundary terms symbolically (the unknowns and their gradients set to zero; a datum in a constant counts) and such an equation measures its increment. The warm re-solves now match development's. test_0028: the warm lid stops at the first iterate inside rtol of its own first residual (fails under the max rule), and a zero-datum Nitsche condition and a traction are not a datum. Louis's ruling on accuracy that came from over-solving: "Remove the redundant work, set a reasonable tolerance." Tests assert at the accuracy their solver is asked for: - test_1057: evaluate()'s projector is asked for 1e-6, so the bound is 1e-6 of the value, not 1e-10; - test_0009: the warm ratio at the tolerance, 1e-4, not 1e-6; - test_1111: iterations re-recorded at tolerance 1e-6, (3, 6) and (4, 14) for (4, 7) and (5, 17); the shell's v_rms at 1e-6 (it lands 3.9e-7 from the SVD value); - test_1087 counts the cycle with the rotated floor off (_INCREMENT_TARGET_FRACTION = None): under the floor the sub-solves stop at the Newton target and the count follows it (4 and 6), not the cycle (5 and 5). The changelog records the policy and what users see in evaluate(). Underworld development team with AI support from Claude Code
H1. The rotated floor's absolute tolerance on the fieldsplit sub-KSPs was in the outer residual's units: on test_1087's single increment the pressure solve stopped at 6 iterations in place of 15 and the fault slip moved 2.2e-4 at tolerance 1e-6, where development is 2.7e-7 off. The sub-KSPs now keep their configured rtols, scaled by how far the floor relaxed the outer target, (0.1 T / |b|) / rtol, never below 1 and capped at 0.1. A first increment is solved exactly as on development: test_1087 and test_1111 pass with development's own baselines again (the rebaselines and test_1087's floor-off switch are reverted), and test_0022's last increments still relax. The configured tolerances live on the context and come back when the floor is switched off. M1. _weak_datum read the datum by its value, so a lid ramped up from zero, or a Robin ambient set later, was cached as no datum. Every UW expression whose value is a number is now held as a symbol before the term is unwrapped (keep_constants is ignored by the unwrapper); the cache key is the terms' hashes, not only the BC ids. test_0028 ramps a lid from zero and sets a Robin ambient from zero; the value-based reading fails it. M2. On a preconditioned norm the native floor stopped on its scaled estimate, which left the true residual above the floor and cost Newton a step. When the estimate says stop it now builds the true residual once and stops only under the floor. Warm nonlinear Poisson re-solves take 1 Newton step against development's 2 (wombat, serial). A KSP with no norm gets no floor. M3 and the design note: a stationary equation re-solved in a time loop lags its forcing by up to the tolerance; documented in the design note and the nonlinear-solver guide, with the override. The note's sections on the floor, the rotated loop, the weak datum and the KSP mechanism now say what the code does. Underworld development team with AI support from Claude Code
… target formula in the docs Hyperion's re-check of 26e4031: an expression re-pointed in place between the unknown and a constant keeps its hash, so _weak_datum's cached verdict is not read again until the boundary conditions change; documented, with the override. The guide and the changelog wrote the native target as tolerance * F_ref + atol; it is max(tolerance * F_ref, atol), and only the rotated loop adds atol. Underworld development team with AI support from Claude Code
Review record 1 of 2: 43857a5 (superseded; kept for the record)The second record, below, re-checks every finding here on 26e4031. Paths under Tip reviewed: 43857a5 (built as VerdictNot ready to merge. The parallel behaviour is clean: every floor and guard decision was identical on every rank at np 1–4, including on empty ranks. #911 and #924 are fixed, and the rotated case drops from >900 s to 13 s. Two correctness defects remain:
FindingsHighH1. The rotated floor on the fieldsplit sub-KSPs costs accuracy beyond the tolerance (test_1087 territory). Probe
The loop reports
The cause is the atol on the pressure and velocity sub-KSPs. That atol is in outer-residual units, and it cuts the Schur solve at 6 iterations. In the tight welded run, the branch's pressure sub-KSP also reaches its cap of 200 iterations, against 25 on base. The tip's test_1087 now sets MediumM1.
The docstring says "a datum held in a constant counts whatever its value". The unwrap evidently folds a zero-valued expression away. The id-keyed cache cannot notice a value change. Ramping a forcing up from zero is a common continuation pattern. M2. On left-preconditioned GMRES the floor is not a true-residual bound, and linear problems pay extra Newton steps. The floor is scaled into the preconditioned norm by
The design's merge bar says "Newton iterations do not increase". It does not hold on these routes. M3. The cold-start reference extends to Scalar and Vector solvers, and a quasi-static field in a time loop then lags the moving part of its forcing (attack 4). Setup: a stationary Poisson, warm-started every step, forced by H = 30 plus a moving unit perturbation. The probe measures error on the moving part against a cold 1e-11 solve.
The branch keeps the residual within T = 1e-4·‖F(0)‖, which is the design's stated guarantee. Users of a time loop should still be told: their answer now drifts by up to one cold-start tolerance band of the steady part. The same experiment on saddle-point Stokes (a hydrostatic-dominated convection proxy, LowL1. A KSP with L2. The design note no longer matches the code
L3. Setting the rotated floor to None does not clear an atol already set on a cached rotated KSP L4. Tests that cannot fail on their bug. Run on base, L5. Attacks that failed (numbers)
The five "by design" tests
Issue verdicts
Merge conditions
Could not test
Underworld development team with AI support from Claude Code |
Review record 2 of 2: 26e4031, re-checkVerdict: ready. The merge condition below is met. On hyperion the full parallel suite on 26e4031 passed: The head, caebd29, differs from 26e4031 only in a docstring, the nonlinear-solver guide and the changelog (
On the np 2 hangs under "Could not test": test_1087 and test_1111 are serial-only files, run here under Tip reviewed: 26e4031 (built as VerdictReady to merge once the parallel suite on 26e4031 passes.
There is one new low finding (N1): the hash-keyed Findings from the last reviewH1. Rotated floor on the fieldsplit sub-KSPs: fixed
The author's claim holds: slip 0.1595809 with 5 / 15 iterations, the same with the floor on and off. On a single increment, the sub-KSP rtols stay at their configured 3.3e-8 and 1e-7 (factor 1). Logs: test_1087 and test_1111 are now byte-identical to development's (
Attack: later increments, where the relaxation applies. Power-law fault box (η = (0.01 + ε̇_II)^-1/2, k=2 split, 7 increments;
Rotated TI power-law annulus, multi-increment Newton, cold and warm (
Every solve lands well inside its tolerance. Development over-solves by 4 to 5 orders of magnitude. Does the cap hold? No sub rtol exceeded 0.1 in any trace; the largest seen with default margins was 7.9e-3. With default margins (velocity 0.033·tol, pressure 0.1·tol), the sub rtol tops out at 0.0033 and 0.01, so the cap cannot bind To make it bind, we set
Rank verdicts. The per-increment (atol, ‖b̂‖, outer tolerances, sub rtols) trace was identical on every rank at np 2 and np 4. The rotated probe in M1.
|
| U | tip error | tip Newton its | dev06 error | dev06 Newton its |
|---|---|---|---|---|
| 0.5 | 4.45e-3 | 2 | 4.45e-3 | 2 |
| 1.0 | 1.05e-4 | 11 | 6.63e-3 | 5 |
| 1.01 | 1.51e-6 | 10 | 6.38e-3 | 1 |
| 1.02 | 1.38e-6 | 10 | 2.72e-3 | 1 |
These match the lid built at U = 1 from the start (w-nitsche-crp2.log: 1.09e-6, 1.38e-6, 1.36e-6).
Robin ambient ramped 0 → 1 → 1.01 → 1.02, warm accuracy (w3-*.log): errors 2.4e-5, then 2.7e-7, then 2.5e-7 at tol 1e-4, under the increment rule.
Attacks on the classifier and the cache key (probe_weak3.py, np 1 and np 3):
| case | verdict | ranks agree |
|---|---|---|
Robin with ambient = expr(0) |
True | yes |
Robin with ambient = expr(expr(0)) |
True | yes |
| Robin with ambient = a mesh variable holding 0 | True | yes |
k = expr(0), flux k·(T − 1) |
True | yes |
| pure flux | False | yes |
| Robin with u_ext = 0 | False | yes |
fn_fis anImmutableDenseMatrix, so it is hashable and the key really is hash-based.- A value change keeps the hash and the key, and the verdict stays correct, because the term is read by its symbols.
- BC removed, then re-added: across 200 alternating datum/traction swaps on the same BC slot, the cached verdict never differed from a fresh one (0 / 200). Removing every BC gives False; re-adding the Robin datum gives True.
- Hash collision: in CPython hash(-1) == hash(-2), so the terms −1·T and −2·T have equal keys. Both are correctly "no datum". We could not build a collision that changes the verdict: that needs a term that is zero at rest and one that is not, with the same hash, and hash(0) = 0 is not shared by any other small integer. The exception is N1 below.
M2. Preconditioned norm and true residual: fixed
Warm nonlinear Poisson +1 % at tol 1e-4 (p4-poisson-*.log):
| np | tip Newton steps / KSP its | dev06 |
|---|---|---|
| 1 | 1 / [6] | 2 / [7, 7] |
| 2 | 1 / [6] | 2 / [7, 7] |
| 3 | 1 / [6] | 2 / [7, 7] |
| 4 | 1 / [6] | 2 / [7, 7] |
The tip's dispatch log is identical across ranks at every np. The author's claim holds.
The same problem at tol 1e-6 (p-poisson-crp2-*.log) takes 2 steps ([9 or 8, 5] its) at np 1–4. That is development's 2, against 3 on the last tip.
test_0009's third solve is in test_mesh_t_resolves_to_the_model_clock (tr-0009-*.log). It now takes 1 Newton step, 6 KSP its, and ends at 1.05e-5 against a target of 6.25e-5. That is identical to development; the last tip took 2 steps (5 + 2) and ended at 6.50e-5. The other two Poisson tests in test_0009 also match development's counts.
Memory: the RSS rebuild loop stays flat (369.7 → 372.0 MB over 60 rebuilds, one linear_floor entry). 40 new solvers add 99 MB, against 99 MB on development (m-rss-crp2.log). The buildResidual vector is destroyed.
M3. Time-loop lag: documented
- Design note §1 has a new bullet, "A stationary equation in a time loop". It gives 1.3e-2 against 5.6e-9 and the
_convergence_reference_rule = "increment"way out. docs/developer/guides/nonlinear-solver.mdhas a new paragraph, "Where a solve stops".[read]
Low
- L1.
ksp_norm_type none: fixed (m-normnone-crp2.log). CG gives reason -3 at Newton 0, and Richardson does 40 its per application up to max_it. Both match development exactly; the last tip cut each application to 1 iteration. - L2. Design note §2 and §4: fixed
[read].- §2 now says the native floor is on the outer KSP only, as a convergence test composed with PETSc's. It describes the true-residual check and says a KSP with no norm gets no floor.
- §4 describes the convergence test, not a pre-solve.
- The rotated paragraph describes the sub-rtol scaling and the switch-off. All of this matches the code.
- Nit: the user guide writes
T = tolerance·max(...) + atol. The native code usesmax(rtol·F_ref, atol); only the rotated loop adds atol. The difference is immaterial at default atol.
- L3. Floor off on a cached rotated KSP: fixed (
rot-crp2-np1-1e-7.log,rot-crp2-np4-1e-7.log). After solves with the floor on, setting_INCREMENT_TARGET_FRACTION = Noneputs back the configured values on the same cached KSP:- outer atol: 1e-50;
- sub rtols: 3.3e-9 and 1e-8 (0.033·tol and 0.1·tol).
The warm re-solve then over-solves as development does (5.5e-11 at tol 1e-7). The 1e-11 reference solve with the floor off then reproduces development's own failure: pressure PC fails with NaN, and Newton does not converge in 6 at 1.27e-10. That is base behaviour (Rotated solve past round-off fails its last linear solve; since #907 a time loop rebuilds its KSP every step #911), not new.
The baseline is captured once per ctx. The ctx is rebuilt whentolerancechanges (cache["tolerance"], rotated_bc.py:1328), so a stale baseline cannot carry across a tolerance change[read].
- L4 and L5: no change from the last review.
New findings
N1 (low). The _weak_datum cache cannot see an expression's definition change from unknown-dependent to constant (w3-*.log, "structural stale").
- Setup: the ambient
E2 = uw.expression(..., T.sym[0]), so the Robin flux 3(T − E2) is zero at rest and the verdict is False. ThenE2.sym = 1.0. hash(E2)is the symbol's hash, so the key does not move. The cached verdict stays False; a fresh read gives True, the same on every rank.- The solve then keeps the stationary rule: the accuracy loss of M1.
- The opposite direction (constant → unknown-dependent) leaves a cached True. That is conservative.
- The case is contrived: an expression re-pointed from the unknown to a number.
- Fix: key on the held term (after
_heldswaps constants for Dummies,.symincluded), or note the limitation in the docstring.
Observed, by design. Under the increment rule, the Nitsche lid's step from U = 0.5 to 1.0 takes 11 Newton its against development's 5. It is 60 times more accurate (1.05e-4 against 6.6e-3).
Attacks that failed (numbers)
- Rank agreement (
p-*-crp2-{1..4}.log). Identical per-rank dispatcher decisions at np 1–4 in every scenario:- poisson: 84–89 calls;
- poisson_empty: 34 calls, cells per rank [0, 2, 0] and [0, 0, 0, 2];
- zero;
- stokes: 10 calls;
- stokes_guard: 892, 968, 1054 and 981 calls, the same counts as the last review;
- stokes_guard_fire: 14 calls, guard reason -3 on every rank;
- rotated.
The_weak_datumverdicts agree across ranks at np 3.
- F(x0) = 0. Target 1e-50, 0 iterations, |u| = 0 at np 1–4.
- Cold solves unchanged.
- Cold Poisson: 6 Newton steps on both builds at np 1–4, with the same history to 1.3e-4, |u| equal to 1e-10, and the last linear solve stopping at the floor (7 its against 10).
- Cold Stokes: identical (2 steps, history to 2.134e-8).
- Cold Nitsche lid (A weakly imposed nonzero velocity makes the cold-solve target follow the penalty: 1e-3 to 3e-2 off at tolerance 1e-4 #1011): 4.260e-2 on both builds.
- Rotated cold solves do change, by design (Rotated solve past round-off fails its last linear solve; since #907 a time loop rebuilds its KSP every step #911), and land inside their tolerance (table above).
- User tolerances (
m-user-crp2.log).snes_atol1e-3: target 1e-3.snes_rtol1e-8: target 2.69e-9.ksp_rtol1e-2:linear_floorNone, counts the same as base.ksp_atol1e-3: the same as base.snes_atol1e-12 withksp_rtol1e-12: floor None.
- Cap (
m-cap-crp2.log). Tol 1e-10, warm from half the answer: 6 Newton steps, the same as base, ending at 1.7e-12. - Tests.
- test_0028 at np 2: 10 / 10 passed (
t-crp2-np2-0028.log). - test_0028, test_1087 and test_1111 serial on the tip: 16 passed, 1 skipped.
- test_0028 at np 2: 10 / 10 passed (
Merge conditions
- The full parallel suite on 26e4031 passes. Another process is running it; we did not see its result.
- Optional, low: N1. Key the
_weak_datumcache on the held term, or document the limitation. - Optional, nit: align the user guide's
T = ... + atolwith the nativemax(rtol·F_ref, atol).
Could not test
- test_1087 and test_1111 at np 2.
- test_1087: one rank fails a test and the ranks then hang, at the same place on development (rank 0 in
solve_rotated_freeslip, rank 1 in_collective_raise). - test_1111: rank 0 is in
_agree_source_across_ranksand rank 1 in_free_petsc_garbage, on both builds. - These are serial tests, and the hang is not this branch's (
t-{crp2,dev06}-np2-{1087,1111}.log). - The combined np-2 run of the three files hangs in test_1087 for the same reason (
t-crp2-np2.log).
- test_1087: one rank fails a test and the ranks then hang, at the same place on development (rank 0 in
- The test_1111 shell case: this host's gmsh mesh differs (4560 cells against 4904), so it skips on both builds.
- Development's warm rotated solves. Its 1e-11 reference stalls (Rotated solve past round-off fails its last linear solve; since #907 a time loop rebuilds its KSP every step #911), and the supervisor killed the dev06 rotated probes after 600 s of silence, once their cold row was printed. The two tip 1e-5 probes were killed the same way at the floor-off step, after their warm rows. Their floor-off rows are covered by the 1e-7 runs.
- The rotated vector route (no fieldsplit): not probed directly. It has no sub-KSPs and only the outer atol, which is unchanged from the last tip
[read]. - The zg95 viscoelastic and rotated time loops, including the design note's ruling-2 table: not reproduced.
- Units-scaled models.
Underworld development team with AI support from Claude Code
…rence-policy Underworld development team with AI support from Claude Code
…ering Underworld development team with AI support from Claude Code # Conflicts: # docs/developer/CHANGELOG.md
…stom-mg-1016 Underworld development team with AI support from Claude Code # Conflicts: # scripts/test.sh
…eform-1015 Underworld development team with AI support from Claude Code # Conflicts: # scripts/test.sh
underworldcode#1115) _robust_owning_cells accepted the first cell it tried (the nearest control point's) whenever the point was within the 1e-2 face tolerance of it. A point just inside the NEIGHBOURING cell, within that tolerance of the face they share, was then evaluated in the wrong cell, and the box clamp in DMInterpolationEvaluate_UW put it on the shared face: an error of about |grad f| times its distance from the face, for any field, the ones the element represents exactly included. On a 1/16 simplex box: 4e-6 at 1e-6 from an edge or vertex, 4.4e-5 at 1e-5; 5 of 20,000 random points. The locator now takes two passes: a cell that contains the point to rounding (_EVAL_CONTAIN_TOL, 1e-10, face-relative), and the 1e-2 face tolerance only for points no local cell contains. The set of points a rank claims is unchanged, so ownership and migration are untouched; only which of a rank's cells evaluates a point changes. The face tolerance dates from 2026-05-28 (c52201b, parallel locator hardening); underworldcode#1014 (register row 6) did not touch this path. test_0511 (tier B): 2-D and 3-D simplices, P1 and P2, points on and at 1e-8..1e-3 from vertices and edges, exact to rounding; quads as control. The four simplex cases fail on development. Underworld development team with AI support from Claude Code
Every solve now measures one convergence reference and two targets, on the native routes and in the rotated free-slip loop alike (#911, #985, #924). The design is
docs/developer/design/CONVERGENCE_REFERENCE_POLICY_2026-11.md.The problem
toleranceof an already small residual and kept iterating.The change
The nonlinear target is
T = max(tolerance * max(||F(x0)||, R), atol).Ris what the equation declares in_reference_residual:||F(0)||for a stationary equation, so a warm start or a continuation step is held to the cold start's target;_weak_datum), whoseF(0)measures the penalty;solver._convergence_reference_rule = "increment"or"stationary"overrides the declaration.The linear floor. Each linear solve stops at
0.1 * T, and always cuts its own residual at least tenfold.utilities/ksp_convergence_tests).ksp_rtolthattolerancedid not derive, and Eisenstat-Walker, which still sets the saddle point's rtol.The rotated loop follows the same reference rule, and honours a user-set
snes_rtol,snes_atolandsnes_stol(#924).Tests at their tolerance (Louis, 2026-11-08: "Remove the redundant work, set a reasonable tolerance."):
evaluate().Edge cases found and fixed on the branch
maxrule in time loops was 20 to 70 times less accurate (test_0008). That led to the memory rule.Evidence
Serial, wombat (full tier A/B: 2940 passed; only test_0063 fails, and it fails on development too):
maxrule: 9.07e-5)maxrule: 3.6e-4 to 7.7e-3)test_0022's four arms (tol 1e-11; the two numbers are the two fixtures):
The pressure rtol default is a separate branch and is not included here.
Kaiju (K2), np 16. The zg95 faulted annulus, restarted from the TAf-v2 step-25 checkpoint for 10 steps:
The viscoelastic rotated case (ruling 2, for Louis): a VEP annulus, 40 steps of 0.1 Maxwell times at tolerance 1e-5, against a 1e-8 run.
max)Parallel, hyperion, np 2 and 4 (
scripts/test.sh --parallel-only --p 2 --full-parallel): all passed, rc 0.Behaviour users will see
toleranceasks, and no more: a linear solve no longer gets a second, exact Newton step for free.evaluate()of an expression with derivatives returns its projector's 1e-6.T. Its answer then lags the forcing by up to the tolerance. Stokes already did this on development.Reviews
Issues
F(0)would fix it, but that needs a run-time weight in the Nitsche and penalty kernels.Underworld development team with AI support from Claude Code