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
_tensor_stats crashes for genuine (d,d) tensor variables: flat component index used on the structured array axis #400
Found by the public adversarial review of the #330/#397/#384 batch (2026-07-23).
MeshVariable._tensor_stats (discretisation_mesh_variables.py) reads components as self.array[:, 0, i] for i in range(self.num_components) — but for a rank-2 tensor variable num_components = d*d (4 in 2D) while self.array has structured shape (N, d, d), so the loop indexes 4 against an axis of size 2:
IndexError: index 2 is out of bounds for axis 2 with size 2
Demonstrated live on a (2,2) tensor variable. The Frobenius accumulation should read the flat layout (self.data[:, i]) or iterate the structured axes. Until then, stats() on any true TENSOR/SYM_TENSOR variable raises — the method is effectively dead code for its own case (vector variables are unaffected; they take _vector_stats).
Pre-existing on development — the #330-batch diff only renamed the temporary variable inside it.
Underworld development team with AI support from Claude Code
Activity
Swarm/mesh checkpoint quiescence, .msh coordinate-system default, ran…
Empty-rank mesh construction, tensor stats, global metric moments, sw…
lmoresi commentedon Jul 24, 2026
Fixed by PR #406, merged to development on 2026-07-24 after a public adversarial review round. (Manual close — PRs target development.)
Underworld development team with AI support from Claude Code