The concern
Maintainer ruling (2026-09-10): .meshes is a choice that would not be made
now. It is a flat directory of generated meshes with no proper namespace
separation — an accident waiting to happen.
What is actually there
src/underworld3/meshing/_mesh_files.py is candid about the mechanism:
It is not a cache: every construction regenerates both, and nothing checks
whether they already exist.
The name is derived from the mesh PARAMETERS, so two processes building the
same geometry in one working directory choose the same name.
Two things follow that the module does not claim to solve.
1. The only separation is the working directory. DEFAULT_MESH_FILE_DIR
is the relative path ".meshes", so a tree appears wherever a process happens
to be run from. The 2026-09 audit found 93 of them — one per worktree plus
the main checkout — holding 4.4 GB between them, 544 files in the main one
alone. UW_MESH_CACHE_DIR exists to give a job somewhere of its own but is set
nowhere in the repository, the pixi tasks, or scripts/test.sh. Nothing is
choosing that separation; it is falling out of cwd.
2. Identical parameters, different code, same filename. The name carries
the mesh parameters and nothing about the code that generated it. Two worktrees
on different meshing branches building the same geometry agree on the filename
and disagree about the contents. Atomic writes (#563) make sure a reader sees a
complete file rather than a half-written one; they do not make it the right
file. #618 was the same class narrowed to one generator — elementRes missing
from the StructuredQuadBox name — and was fixed by adding the missing
parameter, which does not generalise to "the code changed".
3. Nothing reclaims. Files are regenerated every construction and never
deleted, so each directory grows without bound for the lifetime of its
worktree.
Worth considering
- Give the directory a namespace that includes what generated it, not only what
it geometrically is.
- Or drop the shared location: since every construction regenerates anyway,
per-process scratch under a temporary directory costs nothing and removes the
collision surface entirely.
- Either way, set
UW_MESH_CACHE_DIR for the test suite so a parallel run is
not sharing a namespace with whatever else is running from that cwd.
Real outputs that need keeping live in ~/+Simulations, not here, so nothing
in these directories is worth preserving; the audit cleared all 93.
Underworld development team with AI support from Claude Code
The concern
Maintainer ruling (2026-09-10):
.meshesis a choice that would not be madenow. It is a flat directory of generated meshes with no proper namespace
separation — an accident waiting to happen.
What is actually there
src/underworld3/meshing/_mesh_files.pyis candid about the mechanism:Two things follow that the module does not claim to solve.
1. The only separation is the working directory.
DEFAULT_MESH_FILE_DIRis the relative path
".meshes", so a tree appears wherever a process happensto be run from. The 2026-09 audit found 93 of them — one per worktree plus
the main checkout — holding 4.4 GB between them, 544 files in the main one
alone.
UW_MESH_CACHE_DIRexists to give a job somewhere of its own but is setnowhere in the repository, the pixi tasks, or
scripts/test.sh. Nothing ischoosing that separation; it is falling out of cwd.
2. Identical parameters, different code, same filename. The name carries
the mesh parameters and nothing about the code that generated it. Two worktrees
on different meshing branches building the same geometry agree on the filename
and disagree about the contents. Atomic writes (#563) make sure a reader sees a
complete file rather than a half-written one; they do not make it the right
file. #618 was the same class narrowed to one generator —
elementResmissingfrom the
StructuredQuadBoxname — and was fixed by adding the missingparameter, which does not generalise to "the code changed".
3. Nothing reclaims. Files are regenerated every construction and never
deleted, so each directory grows without bound for the lifetime of its
worktree.
Worth considering
it geometrically is.
per-process scratch under a temporary directory costs nothing and removes the
collision surface entirely.
UW_MESH_CACHE_DIRfor the test suite so a parallel run isnot sharing a namespace with whatever else is running from that cwd.
Real outputs that need keeping live in
~/+Simulations, not here, so nothingin these directories is worth preserving; the audit cleared all 93.
Underworld development team with AI support from Claude Code