Repository navigation
Probe-pass fixes: a MATRIX semi-Lagrangian history, tensor swarm read_timestep, a clamp on one component (#995, #984, #1000) - #1125
Merged
Conversation
…_timestep, a clamp on one component (#995, #984, #1000) - #995: SemiLagrangian built its history stores (psi_star, forcing_star) without the MATRIX shape, so their constructor failed on None. A new ddt._history_shape gives a MATRIX store the shape of the field it tracks. The projection that fills the history had no MATRIX branch, so MATRIX joins the tensor branch, with every entry of the field's shape independent. - #984 (the swarm half): SwarmVariable.read_timestep put the file's values into self.array[:, 0, :], which is the stored layout only for scalars and vectors. The file holds the storage layout (save writes self.data), so the values go back into self.data, the raw inverse of the write. No layout helper is needed. - #1000: global_evaluate of ONE component with monotone="clamp" built the bound for every component of the variable and failed to reshape. A single component is now bounded by its own stored column (through _data_layout, so a symmetric tensor's Voigt component maps correctly). This also fixes a single vector component, which failed the same way. tests/test_1165_tensor_history_swarm_read_and_component_clamp.py: 6 tests (tier B), all failing on development 01dec8d first. The history, swarm I/O, evaluate, stress-history and transport suites pass (583, 2 skipped). Side finding, not fixed here: the same missing MATRIX shape is at the history stores of Eulerian, Lagrangian, Lagrangian_Swarm, IntegrationPointSemiLagrangian and ForwardSemiLagrangian. Underworld development team with AI support from Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…clamp incl. a 2x3 MATRIX; serial-only; a units round trip; the MATRIX history over two steps Underworld development team with AI support from Claude Code
…istories of the same scheme Over two steps at zero velocity the history does not reproduce the nodal field exactly (5.5e-3 here; a property of the scheme), so the baseline is a scalar SemiLagrangian of each entry, which the MATRIX history must equal to 1e-12. The flat-index clamp mutant from the review fails the 2x3 MATRIX clamp case and nothing else. Underworld development team with AI support from Claude Code
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #995 and #1000, and the swarm
read_timestephalf of #984 (#984'smesh.deformhalf was already fixed on development). These are tensor-shaped paths that raised on development 01dec8d, found in a probe pass. Each fix is small, with a regression test shown failing first.SemiLagrangian(..., vtype=MATRIX)built its history stores without the MATRIX shape:TypeError: 'NoneType' object is not subscriptablein the store's constructorddt._history_shapepasses the tracked field's shape to a MATRIX store. The history's projection had no MATRIX branch, so MATRIX joins the tensor branch (every entry independent)SwarmVariable.read_timestepraised "could not broadcast (N,3) into (N,2)" for a symmetric tensor ((N,4) for a tensor): it assigned intoself.array[:, 0, :], which is the stored layout only for scalars and vectorssavewritesself.data), so the values go back intoself.data, the raw inverse of the write. No layout helper (#1006) is neededglobal_evaluate(var.sym[i, j], pts, monotone="clamp")raised "cannot reshape": the bound was built for every component, while the value holds one_data_layout, so a symmetric tensor's Voigt component maps correctly. This also fixes a single vector component, which failed the same wayTests.
tests/test_1165_tensor_history_swarm_read_and_component_clamp.py, tier B, serial: each rank would get its owntmp_path, and the clamp is rank-local by design.write_timestep/read_timestep.read_timestepraised there for every swarm variable shape; the storage-layout read fixes that too. This is a fix the first version of this PR did not state.The #995, #984 and #1000 tests fail on development. The history, swarm I/O, evaluate, stress-history and transport suites pass (583, 2 skipped).
Not here. The same missing MATRIX shape is at the history stores of
Eulerian,Lagrangian,Lagrangian_Swarm,IntegrationPointSemiLagrangianandForwardSemiLagrangian. It is noted for the hub; this PR fixes only #995's class.None of these touches solver defaults,
petsc_generic_snes_solvers,rotated_bc.pyor the custom multigrid.Checklist (UW3 Style Charter — docs/developer/UW3_STYLE_CHARTER.md)
level_*andtier_*markers (S8)maybe_/try_/do_) and no commented-out code (S3, S4).array/mesh.X.coords— nowith ....access(...), nomesh.data(S7).read_timestepwrites.data, the charter's one sanctioned case: a raw copy of non-dimensional storage, here the inverse ofsavepixi.toml/pixi.lockor other dependency changes riding in an unrelated PRUnderworld development team with AI support from Claude Code