Repository navigation
Rotated workspace: reuse the coefficient enumeration only for the same kernels (#546) - #1056
Conversation
…e kernels (#546, m3) The workspace reassembles the operator when a variable it depends on changes. It reads which variables those are from the constitutive parameters, and used to reuse that list whenever the geometry matched. A rewire that adds a variable was safe only because every rewire also tore the workspace down. The list is now reused only when the cached constants signature carries the same JIT key, so the new variable is watched by construction. test_1158 (new, tier B) leaves a workspace that claims older kernels with no coefficients, then changes the newly added variable. With the old reuse the first increment rode the viscosity-1 operator (residual 0.19 -> 0.072) and the linear solve took 2 increments; with this change it takes 1 and matches a fresh solver to 1e-6. #546 m1, probed on development: a new set_custom_fmg registration rebuilds the workspace (velocity MG 3 -> 2 levels, prolongations 2 -> 1), and a new tolerance drops the KSP context (tol_ok). Nothing to fix there. Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
Review record: #546 m3 (3bc1e6b)Verdict: ready. This is the m3 part of a pre-PR review of bundle C4, run on hyperion against the branch head 005a34b. 3bc1e6b changes Check 5: #546 m3 (and m1)test_1158
W1's behavioural claim holds: 2 increments against 1, the same answer. Can the JIT-key comparison be rank-divergent?
Cost. The extra enumeration when the key is None costs 0.11 to 0.13 ms per call; the constants signature costs 0.012 ms. Both were measured at np 2 on a 0.2 annulus. That is negligible next to a solve. Is the stale state reachable through the public API today? It is not. Setting m1, measured at np 1 and np 2, the same on development and the branch:
W1's m1 verdict is confirmed. Mutants against test_1158 (np 1 and np 2)
Findings for this PR
Issue status. #546 m3 is fixed; it is hardening, since the public API doesn't reach the stale state. m1 is already fixed on development, as the probe above confirms. Not run: np 4, and an empty-rank partition. The full C4 record is on hyperion at Underworld development team with AI support from Claude Code |
… via #1056) Underworld development team with AI support from Claude Code
The rotated free-slip workspace keeps the operator between solves and reassembles it when a variable the operator depends on changes. It reads which variables those are from the constitutive parameters, and reused that list whenever the geometry matched. A rewire that adds a variable (a viscosity that now depends on a temperature) was safe only because every rewire also tears the workspace down (#546, m3). The list is now reused only when the cached constants signature carries the same JIT key as the current kernels, so a new variable is watched by construction.
Tests
tests/test_1158_rotated_cache_watches_new_coefficients.py(new, tier B). It sets up a workspace that claims older kernels with no coefficients, as a rewire that kept the workspace would leave it, then changes the newly added variable.Serial: test_1158 and test_1018 give 28 passed.
Issues
set_custom_fmgregistration rebuilds the workspace (velocity MG 3 -> 2 levels, prolongations 2 -> 1), and a tolerance change drops the KSP context (tol_ok).Underworld development team with AI support from Claude Code