Repository navigation
A mesh move stays in its frame in a units model, and the monotone limiter compares like with like - #1003
Conversation
mesh.X.coords is physical in a model with reference quantities and the DM holds model coordinates. The remesh transaction read the first and wrote the second, so mesh.deform and the mover left the mesh scaled by the length scale. It also remapped at physical points read as model points, and wrote the dimensional answer into the raw values. deform now converts from the frame of mesh.X.coords, and the transaction works in the DM's frame. Fixes the mesh-move part of #979. Underworld development team with AI support from Claude Code
…esh and refine transfers in the DM's frame A plain array given to deform is model coordinates, as evaluate reads one, and coordinates with units are converted in any length unit. A submesh followed its parent through the physical coordinates, and the refine transfers evaluated at them; both now use the DM's. Underworld development team with AI support from Claude Code
…aces coordinates it can and refuses the rest The monotone limiter bounded a dimensional value by non-dimensional data and then labelled the result with units (#989); it now compares both in model units and gives the value its units back. deform converts coordinates in any length unit, including a pint Quantity, refuses one that is not a length, and refuses a plain array the size of the physical domain rather than reading it as model coordinates. Underworld development team with AI support from Claude Code
Adversarial reviewThree independent reviews, by reading code; none ran anything. The last commit ( Round 1 (first commit). The Round 2 (the follow-up):
Attacks that found nothing
Issue verdicts: #989 fixed. #979 partly fixed and still open, for the free surface (#998) and the Underworld development team with AI support from Claude Code |
Review of the final commit only (pre-rebase)This round covers only the final commit, which answered earlier review rounds and had not itself been reviewed. Each PR's own tests run again on its rebased head once H2 has rebased the stack onto development (#959 is merged). That record will follow as a separate comment. Paths under #1003, final commit 0b14c68: adversarial reviewCommit: 0b14c68 "Review of the units fix: the limiter compares in one frame; deform places coordinates it can and refuses the rest". Parent 5151468. Runtime base: #988 head e0d220b (wt-s988). Verdict: changes requested. The limiter fix is right. It is in one frame in a units model and in a no-units model, serially and at np 2, and for every unit tried. Method
What it answersFrom round 2 of the PR's review:
Evidence:
The commit's own tests
Mutants on the final, serial:
Every part of the change is caught by a test. The parallel test does not exercise the clamp or the refusals. FindingsF1. High: a units-model
F2. Medium, a regression: a dimensionless array is refused.
F3. Low to medium: the physical-size heuristic refuses legitimate model-frame moves when the reference length is near the domain size.
Notes, not findings against the commit:
Merge conditions
What we could not test
Underworld development team with AI support from Claude Code |
The two conflicts combine both sides: the evaluation stays at the non-dimensional coordinates the DM holds (this branch), and the result is laid out by development's _evaluated_in_storage_layout, which also reduces a dimensional evaluation to the non-dimensional values var.data holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With #1003 a move stays in the model frame, so 0.99 * mesh.X.coords keeps a constant field exactly with no limiter. The plain metre-sized array the case used before is now refused; assert that instead of the clamped number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The physical-size check in _model_coordinates_from gated its two allreduces on the local array size, so a rank holding no vertices skipped them and the move hung (H1 review F1, np 4). Every rank now enters both reductions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A UnitAwareArray or pint Quantity in dimensionless units was refused as not a length. It says the values are model coordinates, as a plain array is read, so take it that way, without the physical-size check (H1 review F2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dimensionless array holding metre magnitudes was accepted and scaled the mesh up; a plain array with the same numbers is refused. Read dimensionless values as a plain array, so both take the same check (H1 review, medium). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nly-978 Underworld development team with AI support from Claude Code
…#991) underworldcode#1003 moved both parallel sites to coords_nd and the storage layout, so the refusal underworldcode#1002 added is no longer needed: the transfers are exact for every shape at np 2 and 3. test_0785's refusal tests now assert exactness, over scalar, vector, 2x3 MATRIX, TENSOR and SYM_TENSOR. Underworld development team with AI support from Claude Code
In a model with reference quantities, a mesh move now stays in its frame and transfers values correctly, and the monotone limiter compares like with like. Fixes the mesh-move part of #979, and #989. Stacked on #988: merge #959, #982 and #988 first.
What was wrong
In a units model
mesh.X.coordsis physical, the DM holds model coordinates,evaluatereturns dimensional values, andvar.dataholds non-dimensional ones. Several sites crossed those boundaries without converting:mesh.X.coordsand wrote it to the DMmesh.deformand the mover left the mesh scaled to metres: DM coordinate max 1 to 1e6var.dataephemeral_coords,sync_coordinates_from_parent,_refine_prolongate/_refine_restrict_apply_monotone_limitbounded a dimensional value by non-dimensional data, then labelled the result with units (#989)The change
ephemeral_coords, submesh sync and the refine transfers read and write model coordinates. The remap evaluates atcoords_ndand non-dimensionalises the result before writingvar.data.Mesh.deformconverts coordinates that carry units throughuw.non_dimensionalise, in any length unit, a pintQuantityincluded. It refuses a unit that is not a length. A plain array is model coordinates, asevaluatereads one. A plain array the size of the physical domain is refused, where before it would have been read as model coordinates and silently scaled the mesh.TODO(units)there is removed.In a model without units nothing changes:
coords_ndiscoords,_coordsisX.coords, andnon_dimensionalisereturns its input.Tests
tests/test_0770_mesh_move_in_a_units_model.py(tier B, 10 tests):deformin metres, km and model coordinates; a units field remapped; the mover;ephemeral_coords; a submesh; the refusals; a pint quantity; the clamp. 9 fail on the SwarmVariable reads a non-symmetric matrix back in the order it was written; global_evaluate stops transposing tensors #988 build. The plain model-coordinate case passes there too, because it takes no remap.tests/parallel/test_0770_mesh_move_in_a_units_model_parallel.py: np 2, 4, 8.monotone,deform,ephemeral_coordsor submeshes: 982 passed, 15 skipped, 10 xfailed. 123 files that move meshes or useglobal_evaluateand swarm variables passed on the commit before the last review round. Their parallel files at np 4 pass.Not in this PR
mesh.unitsreportskmwhilemesh.X.coordsis labelledm, with the length scale in metres. This PR converts throughnon_dimensionalise, which is right for both, but anything converting tomesh.unitswill be 1000 times off. Recorded on mesh.deform in a units model leaves the mesh scaled to metres: the remesh transaction reads dimensional coordinates #979, which stays open for it and the free surface.non_dimensionaliseuses the default model rather than the mesh's own.Checklist (UW3 Style Charter)
level_*andtier_*markers.array/mesh.X.coordsUnderworld development team with AI support from Claude Code