Skip to content

A refinement that leaves wall vertices off their wall says which walls (#949) - #1280

Merged
lmoresi merged 5 commits into
developmentfrom
bugfix/refinement-says-which-walls-are-left-off
Nov 20, 2026
Merged

lmoresi merged 5 commits into
developmentfrom
bugfix/refinement-says-which-walls-are-left-off

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 20, 2026

Copy link
Copy Markdown
Member

The mesh refinement guard's warning now names the walls whose vertices it leaves off, and gives a generator's remedy when the generator has one. For a refined simplex CubedSphere it says what to do.

What changes

On development. The refinement guard (#946) keeps every cell valid by leaving some moved vertices where refinement put them. It warned only: "N vertices it moved ... stay where refinement placed them instead (#946)." On a refined simplex CubedSphere those vertices sit off the inner sphere (#949, item 1). The warning did not say that they are off a wall, which wall, or what to do.

Measured on development, vertices held back:

numElements refinement 1 refinement 2
2 0 24
3 1 21
4 0 0

Now.

  • The walls. The warning names the walls the vertices are left off (off the walls ['Lower']) and says that a condition or a surface on those walls sees them off the wall. The mesh already recorded which walls (_refinement_left_off_surface); that per-rank set is gathered over the ranks for the message. The held count is already global, so every rank reaches the gather.
  • The remedy. A generator can attach a remedy to its refinement callback (callback.remedy), and the warning appends it. CubedSphere(simplex=True) says that the vertices sit on a crease between two wall patches, that numElements=4 held none at refinements 1 and 2 (measured), and that simplex=False has no such crease.
  • Not fixed. The cross-patch flip that would place the vertices stays open on Spherical mesh generators: five defects found while fixing #946, left open #949.

Measured message, numElements 3 at refinement 2: "... 21 vertices it moved, over the hierarchy's 3 levels, stay where refinement placed them instead, off the walls ['Lower']: a condition or a surface placed on those walls sees them off the wall (#946). CubedSphere(simplex=True) leaves them on a crease between two wall patches (#949). numElements=4 held none at refinements 1 and 2 (measured); simplex=False has no such crease."

Tolerances and coordinate matches

None: the count and the walls are the guard's own record.

Tests

tests/test_0949_refinement_says_which_walls_are_left_off.py, level 2, tier B:

  • numElements 3 at refinement 2 warns once, with 21 vertices, the Lower wall and the remedy. On development the warning lacks both the wall and the remedy, so the test fails there.
  • numElements 4 says nothing.

tests/parallel/test_1189 matches the unchanged part of the message.

Serial runs (macOS, 12-core Apple M4): the 31 test files that use a refinement callback or a spherical generator, 318 passed, 1 xfailed.

Review

The changes are a message and one gather on a path every rank takes. No numbers move.

Issue state

#949 item 1: the silence is fixed here; the placement stays open.

Underworld development team with AI support from Claude Code

#949)

The refinement guard keeps cells valid by leaving some moved vertices where
refinement put them, and warned only "N vertices ... stay where refinement
placed them". On a refined simplex CubedSphere those vertices sit off the
inner sphere (numElements 3: 21 at refinement 2), which a boundary condition
or a surface placed on that wall then sees, and nothing said so.

The warning now names the walls the vertices are left off (gathered over the
ranks; the held count is already global, so every rank reaches the gather),
and appends a generator's remedy when its refinement callback carries one.
CubedSphere's says the vertices sit on a crease between wall patches, that
numElements=4 held none at refinements 1 and 2 (measured) and that
simplex=False has no such crease. The cross-patch flip that would place them
stays open on #949.

test_0949_refinement_says_which_walls_are_left_off: numElements 3 at
refinement 2 warns with 21 vertices, the Lower wall and the remedy;
numElements 4 says nothing.

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 20, 2026 08:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@lmoresi

lmoresi commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Adversarial review, round 1

  • Rank asymmetry. held is the global count from _flag_on_every_sharer, so every rank enters if held: together and reaches the new allgather. The message is printed on rank 0 only.
  • What it reports. The walls come from the guard's own record of where it put vertices back (_labels_holding_vertices), not from a distance test. So there is no tolerance: a vertex is reported exactly when the guard kept it.
  • The remedy attribute. It is read with getattr(..., None). Callbacks without it (every other generator, and users' own) give the message as before, plus the walls.
  • Tests that cannot fail. The positive case asserts the count (21), the wall and the remedy text, all of which development's message lacks. The negative case asserts silence.
  • CI reach. The test_09* batch collects it.

No findings.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Correction to the round-1 review. It said that the test_09* batch collects the new test. That line did not exist; it is added in #1278. This branch picks it up by merging development once #1278 merges.

Underworld development team with AI support from Claude Code

… no platform count

- The allgather of each rank's walls moves out of `if held:` to just before
  it, under `if callable(refinement_callback):`. The scan still read that
  guard as rank-local (a call on a parameter), so it is in test_0052's
  ACCEPTED with the reason: one callback object, the same on every rank.
- test_0949 pinned "21 vertices", the macOS count; the Linux runner's gmsh
  mesh holds 47. It now asserts a positive count, the Lower wall and the
  remedy, and says both counts were measured.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Pushed 6620222, for the two CI failures:

  • test_0052. The walls allgather moves out of if held: to just before it, under if callable(refinement_callback):. The scan still reads that guard as rank-local, so it is in ACCEPTED, keyed on the guard, with the reason: the callback is one object, a constructor argument every rank passes alike, so callable() of it is the same everywhere.
  • test_0949. It pinned "21 vertices", the macOS count; the Linux runner holds 47. It now asserts a positive count, the Lower wall and the remedy text. The docstring gives both measured counts. numElements=4 says nothing on both platforms.

Serial (macOS, 12-core Apple M4): test_0949 and test_0052, 22 passed.

Underworld development team with AI support from Claude Code

@lmoresi
lmoresi merged commit 2d251b7 into development Nov 20, 2026
10 checks passed
lmoresi added a commit that referenced this pull request Nov 24, 2026
…ny-platform

test_0949: the walls named are any non-empty set of the shell's walls (#1280 follow-up)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants