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-BC analytic-normal guard false-positive when a second mesh exists at reaction read-out (multi-mesh unwrap identity) #445
The new analytic-normal validation in _boundary_velocity_nodes (development, 2026-07)
raises
ValueError: analytic normal for boundary 'Upper' contains symbols ['N.x', 'N.y']
that are not mesh coordinates
on a NORMAL that was correctly built from the solver's own mesh.X — but only when a
SECOND mesh has been created before the recovery call. Reproduce: build mesh A + Stokes
add_rotated_freeslip_bc(normal = X/|X| from mesh A) + solve (passes — guard OK at
solve time); build mesh B (a second annulus); then call
solverA.boundary_normal_traction(...) -> guard fires. Same call BEFORE mesh B exists:
fine.
Mechanism (suspected): the guard unwraps the stored normal at read-out time
(unwrap(normal[0,k], keep_constants=False)) and compares free symbols against set(solver.mesh.X) by identity; with two meshes alive the expression-registry
cross-talk returns coordinate BaseScalars that are not identical to mesh A's — the
multi-mesh symbol-identity class (see SYMBOL_DISAMBIGUATION design note).
Impact: any workflow that solves on one mesh and reads the reaction after constructing
another mesh (comparison studies, A/B harnesses) hard-fails. Workaround: read
reactions before constructing the next mesh. Fix direction: compare by symbol NAME
within the solver's coordinate system, or unwrap against the solver's own registry
scope rather than the global one.
Found while running the #438 TI pre-test (results in that thread).
Underworld development team with AI support from Claude Code
Consolidating into #501 — same defect, same line. Both reports land on the stray
check in _boundary_velocity_nodes, src/underworld3/utilities/rotated_bc.py:152:
which still has no name-retag at development @ e475246f. unwrap canonicalises
coordinate BaseScalars onto the first mesh's frame, so on a later mesh the
unwrapped x is not mesh.X[0] by identity even though it prints identically, and
the check raises on a normal correctly written in that mesh's own mesh.X.
#501 is the better-written record: it carries the minimal reproducer, the exact
patch (retag by name onto solver.mesh.X before both the stray check and the
lambdify), the note that the same fix is already applied to the fault-side twin fault_contact._compiled_normal_override, and the observation that genuine strays
are still caught afterwards. We have copied this issue's impact framing across —
the workflows that hit it are the comparison/A-B harnesses that solve on one mesh
and read the reaction after building another.
One measurement worth carrying over, recorded on #501: at current head the
unwrap-layer symptom reproduces (second annulus, unit_e_0 normal → stray=['N.x','N.y']; first annulus → stray=[]), but two solver-level
reproductions did not raise. The trigger is narrower and more
registry-state-dependent than either filing implies, so whoever fixes this should
tighten the reproducer first — otherwise the regression test will pass for the
wrong reason.
Underworld development team with AI support from Claude Code
Suggested edits to issues we are keeping (not closing)
These are not closures — they are corrections the main session may want to post so
the issue text matches what we measured.
Stokes_Constrained free-slip: the answer is partition-dependent (np2 iso -3.4%, np4 ti +2.8%) — not an environment-sensitive golden #495 — the headline is wrong and should be replaced. Serial on this
macOS/arm64 environment reproduces the golden to 2.6e-12
(6.194547793939e-01 vs 6.194547793955e-01, tolerance rtol=1e-9), so the
golden is not environment-sensitive. What varies is the partition:
np=2 iso 0.5982807168536982 (−3.4%), np=4 iso 0.6187878061676945 (−0.11%),
np=4 ti 0.4036468804590768 (+2.8%; ti passes at np=2). A different answer at
every rank count is a partition-dependence defect in Stokes_Constrained, most
likely in the iso case's active pressure null space / gauge handling. Retitle
along the lines of "Stokes_Constrained free-slip: the solution is
partition-dependent (np=2 iso off by 3.4%, np=4 ti by 2.8%)", and raise the
severity — the current title reads as a test-hygiene chore and it is not one.
Worth ruling out under-convergence first (per house lore, a positive getConvergedReason() does not mean the inner blocks converged).
uw.function.evaluate returns negative values for a squared DERIVATIVE expression #491 — record the mechanism precisely, since the issue only guesses at it: _function.pyx:964-985 replaces the entire expression with a work variable
whenever a derivative appears anywhere, and _project_to_work_variable
(:648-769) L2-projects it onto a hard-coded degree-1 continuous scalar with a
gradient penalty (:748-767). Two independent defects there: resolving the whole
composite instead of just the Derivative sub-nodes, and the hard-coded degree.
Activity
lmoresi commentedon Aug 13, 2026
Consolidating into #501 — same defect, same line. Both reports land on the stray
check in
_boundary_velocity_nodes,src/underworld3/utilities/rotated_bc.py:152:which still has no name-retag at
development@e475246f.unwrapcanonicalisescoordinate BaseScalars onto the first mesh's frame, so on a later mesh the
unwrapped
xis notmesh.X[0]by identity even though it prints identically, andthe check raises on a normal correctly written in that mesh's own
mesh.X.#501 is the better-written record: it carries the minimal reproducer, the exact
patch (retag by name onto
solver.mesh.Xbefore both the stray check and thelambdify), the note that the same fix is already applied to the fault-side twin
fault_contact._compiled_normal_override, and the observation that genuine straysare still caught afterwards. We have copied this issue's impact framing across —
the workflows that hit it are the comparison/A-B harnesses that solve on one mesh
and read the reaction after building another.
One measurement worth carrying over, recorded on #501: at current head the
unwrap-layer symptom reproduces (second annulus,
unit_e_0normal →stray=['N.x','N.y']; first annulus →stray=[]), but two solver-levelreproductions did not raise. The trigger is narrower and more
registry-state-dependent than either filing implies, so whoever fixes this should
tighten the reproducer first — otherwise the regression test will pass for the
wrong reason.
Tracking continues on #501.
Underworld development team with AI support from Claude Code
Suggested edits to issues we are keeping (not closing)
These are not closures — they are corrections the main session may want to post so
the issue text matches what we measured.
macOS/arm64 environment reproduces the golden to 2.6e-12
(
6.194547793939e-01vs6.194547793955e-01, tolerancertol=1e-9), so thegolden is not environment-sensitive. What varies is the partition:
np=2 iso
0.5982807168536982(−3.4%), np=4 iso0.6187878061676945(−0.11%),np=4 ti
0.4036468804590768(+2.8%; ti passes at np=2). A different answer atevery rank count is a partition-dependence defect in
Stokes_Constrained, mostlikely in the iso case's active pressure null space / gauge handling. Retitle
along the lines of "Stokes_Constrained free-slip: the solution is
partition-dependent (np=2 iso off by 3.4%, np=4 ti by 2.8%)", and raise the
severity — the current title reads as a test-hygiene chore and it is not one.
Worth ruling out under-convergence first (per house lore, a positive
getConvergedReason()does not mean the inner blocks converged).NON-STRICT xfail". What actually landed is a positive assert with a
pytest.skipbranch in the 3-D case (
tests/test_0753_nested_mg_prolongation.py:262-283).Same intent, different mechanism; worth correcting so nobody goes looking for an
xfail marker.
rotated field copy-back scatter, marked with the
TODO(BUG)atrotated_bc.py:626-628), and that the design ruling's stated prerequisite JIT: a manifested constants[] UWexpression can be baked into the C source (not live-rampable) #302 isnow CLOSED, so the model-owned-time route is unblocked.
bc_is = bc_label.getStratumIS(value)beside the natural-BC DS registration invites a rank-local skip #506 — the body is literally-. It needs writing, and the scope is four sitesnot one:
cython/petsc_generic_snes_solvers.pyx:3549, 3689, 4494, 5301.breaks found on the same scan,discretisation/discretisation_mesh.py:8244(nvb non-native path, which alsocalls
eval_metricunconditionally at:8241with no size guard at all) and:8305(sbr).get_mean_radius(
discretisation_mesh.py:6531-6560) was built empty-safe whileget_min_radius/
get_max_radius(:6512,:6527) were not, so the fix pattern already existsin the same file, ten lines away.
_function.pyx:964-985replaces the entire expression with a work variablewhenever a derivative appears anywhere, and
_project_to_work_variable(
:648-769) L2-projects it onto a hard-coded degree-1 continuous scalar with agradient penalty (
:748-767). Two independent defects there: resolving the wholecomposite instead of just the
Derivativesub-nodes, and the hard-coded degree.DMLocatePointsoutright (
function/petsc_tools.c:72-99), thatget_closest_cells(
discretisation_mesh.py:5941-5985) does no containment test, and that the ξ-clampat
petsc_tools.c:285-299is a box clamp — explicitly a no-op on simplices —which is why 3-D tets fail and 2-D quads (the test_1052 VEP stability tests fail under PETSc 3.25 (variable-dt pure-VE blow-up), pass in level_1 gate #390 case) were clamped into looking
fine. The containment-checked locator
_robust_owning_cellsalready exists(
:6225) and is used only in parallel / for non-simplex.guidance (
docs/developer/subsystems/mesh-shape-relaxation.md:154-165); there isno defect and no code to fix, only a measurement nobody has taken.