You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rotated free-slip: reassigning an expression each step leaks ~14 MB per solve at np 2 through the prolongation rebuild #1007
A rotated free-slip Stokes solve whose expression is reassigned each step leaks about 14 MB per step at np 2 (about 7 MB per rank), because each reassignment rebuilds the rotated workspace and the custom prolongation, which leaks.
Measured on development 15f13d0, np 2: an annulus with walls slid 1e-5, both walls rotated free slip, custom FMG, tol 1e-9. The figure is ru_maxrss summed over the two ranks.
each step
rotated workspace reused
peak RSS over 6 solves
s.bodyforce = ... reassigned, sign flipped
False every solve
805, 819, 832, 847, 860, 874 MB
a uw.expression amplitude's .sym flipped
True after the first
803, 810, 811, 811, 811, 811 MB
The same growth appears on #964's branch with the body force changed each solve.
Why
From the comment at utilities/rotated_bc.py ~L2128 (bcaef15, 2026-09-17): _build_rotated_custom_Pl leaks the velocity submatrix and the rotated fine prolongation on every call. Nothing owns them, and _destroy_rotated_linear_cache only dereferences custom_Pl, since its coarse Mats belong to the hierarchy.
The trigger is _rotated_geometry_signature, which includes dm.handle. A reassigned expression re-JITs and rebuilds the solver DM, so the whole workspace rebuilds, prolongation included, and leaks again.
Changing a uw.expression's value, or a field's data, keeps the DM and doesn't leak.
Likely fix (hypothesis, not tried)
Have the custom_Pl record keep the objects it creates, and the cache destroy them. Optionally, key the geometry tier on something narrower than dm.handle.
Probe: runs/2026-11-06/rev906/leak/leak.py on hyperion, with modes rhs and expr.
Underworld development team with AI support from Claude Code
Fixed in #1013 (bugfix/rotated-prolongation-leak-1007). The rebuild path now ends with the collective garbage cleanup. Hyperion measured leak.py at np 2 flat from the third solve, where development keeps rising. test_1144 counts petsc4py's deferred-destroy list: it fails on development in every order tried and passes on the branch.
Underworld development team with AI support from Claude Code
Activity
#1007: free the deferred garbage at the end of a solve that built a n…
test_1144 reads the deferred-destroy list, not the resident set (#1007)
test_1144 counts the deferred-destroy entries, not the summary's bytes (
lmoresi commentedon Nov 8, 2026
Fixed in #1013 (
bugfix/rotated-prolongation-leak-1007). The rebuild path now ends with the collective garbage cleanup. Hyperion measured leak.py at np 2 flat from the third solve, where development keeps rising. test_1144 counts petsc4py's deferred-destroy list: it fails on development in every order tried and passes on the branch.Underworld development team with AI support from Claude Code
Merge pull request #1013 from underworldcode/bugfix/rotated-prolongat…
Rotated free slip: a workspace rebuild frees what the old workspace d…
Custom-P hierarchy state no longer outlives a change to the solver or…