Repository navigation
main train 2026-11-16 (second): Richards solver guard (C0), crash-relaunch in test harness (C3), RT0/BDM1 velocity post-processing (C10b), SWE outflow and structured meshes in ymf_run (C5), ADRH generator spike, space-general BC layer (C0), 64-bit index types in the remaining kernels (C33), py-proteus packaging (C38) - #1366
Open
cekees wants to merge 47 commits into
Open
cekees wants to merge 47 commits into
cekees wants to merge 47 commits into
Conversation
… crashing SuperLU SuperLU does not look at its input. In the Richards implicit-FCT levee run on Linux pip builds the matrix went all-NaN for five prepares, then dgstrf died with SIGSEGV in dpivotL, ending the process with no Python traceback and no log. LinearSolvers.refuseNonFiniteMatrix sums the stored values and raises FloatingPointError, naming the solver, the matrix size and nnz, how many entries are bad and the first one. The sum is exact as a detector: any NaN, +Inf or -Inf makes it non-finite (+Inf with -Inf gives NaN), so no bad entry is missed; the only false alarm is a sum of finite entries that overflows, so a non-finite sum is confirmed entry by entry before raising. Dense (LAPACK) matrices get the same check. Cost, measured (2D Poisson, SuperLU factor vs guard, Apple arm64, conda-dev-mpich env): n=1e4 nnz=4.96e4 factor 0.0110 s guard 8e-6 s (7e-4 of the factor) n=9e4 nnz=4.49e5 factor 0.2166 s guard 5.5e-5 s (2.5e-4) n=3.6e5 nnz=1.80e6 factor 1.6749 s guard 2.1e-4 s (1.3e-4) test/test_lu_nonfinite_matrix.py: NaN, +Inf, -Inf in one entry, all-NaN, +Inf/-Inf cancelling, a finite matrix whose sum overflows (not refused), a dense matrix, and a finite matrix still factors and solves (13 passed with test_superlu.py). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…exception The first version of the guard raised FloatingPointError out of LU.prepare. That escaped calculateSolution, so the step control never saw a failed step: test_step_time_check.py::test_a_retry_that_walks_the_time_backwards_stops_the_run (injects a non-finite value on purpose; 342 x 342 matrix, 3522 of 7044 entries NaN/Inf) failed on the fork CI. SuperLU used to survive that NaN prepare, so the guard must not turn a handled event into a crash. Now prepare() logs the message (solver, size, nnz, bad count, first bad entry) at level 0 and does not factor; failed() returns True, which Newton already reads as linearSolverFailed (the step ends as a failed solve and the step control retries or stops); solve() returns NaN in u instead of a solution computed from no factorization, so a caller that ignores failed() cannot use a stale answer. The next finite matrix is factored normally. NonlinearSolvers.py and StepControl.py are not touched. Same for RedundantLU (every rank holds the same gathered matrix, so all take the same branch before its collective allgather). Measured: test_lu_nonfinite_matrix.py + test_superlu.py 14 passed; test_step_time_check.py 6 passed (Mac conda-dev-mpich, 17 s). Guard cost unchanged (0.21 ms at nnz 1.8e6 vs 1.67 s factor). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… first launch's output A helper that crashes part-way leaves files its relaunch cannot use. Run 43773961726 attempt 1 of #292 (linux-64 py3.12, ceds-model): ncls_edge_partition_mpi.py on 2 ranks died by SIGSEGV with box.1.node half written; retrying_run launched it again in the same directory and the second launch failed with "mv: cannot stat 'box.1.node'", the failure the test reported. The crash (its stack) was only in a RuntimeWarning's last 1500 characters. retrying_run (test/conftest.py, which every launch from test/launch_output.py:58 and test/multilevel/conftest.py:108 goes through) now, for a launch whose cwd is a directory under pytest's basetemp, snapshots the directory before the first launch and, after a crash: - moves everything the crashed launch created into <cwd>/launch.first.files/ - writes its whole stdout and stderr to <cwd>/launch.first.stdout.txt and .stderr.txt, beside the launch.stdout.txt / launch.stderr.txt that launch_output.report writes for the last launch - names those files in the RuntimeWarning and, via launch_output.report, in the failure message - names a pre-existing file the crash changed or deleted (not restored). A directory outside basetemp, or no cwd, is not touched (the output goes under basetemp when there is one); behaviour for launches that never started is unchanged. Run (macOS arm64, conda-dev-mpich, Python 3.13, extensions from c32-r5; PYTHONPATH=worktree): test_mpi_launch_retry.py test_launch_output.py test_launchers_have_timeouts.py multilevel/test_launch_retry.py: 33 passed (43 s), baseline 25 passed before the new tests. New tests, helper that leaves box.1.node and dies by SIGSEGV on its first launch: before (cekees/main conftest + launch_output): 2 failed ("mv: cannot stat 'box.1.node': found the crashed launch's files" on the relaunch; no launch.first.* files), the directory-outside guard passes; after: 3 passed. Not run here: a real mpiexec crash, the full suite (CI is the oracle). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…k boundary term restored)
Cause (in the post-processor, not in HdivSpaces): the Crouzeix-Raviart space takes Dirichlet and Neumann conditions
weakly, so the model lists every face dof as free and the weak residual of an interior face dof carries a boundary
term for each element with an exterior face (the basis function of an interior face has mean zero on the exterior
face, the penalty term does not). The kernel's flux through a face is the element's volume term only. Measured on
vpp_poisson_2d 13 x 13 (288 elements): flux_i + elementResidual_i = 2e-16 on the 242 elements without an exterior
face, 1.1e-2 on the interior faces of the 46 elements with one; the model's own residual at every dof is 1e-14,
so the solution is right and only the post-processor missed the term.
Fix, VPP_P1nc_RT0 only: the kernel gets the interior faces as its free rows (exterior faces, flag != -1, complete
the rows with right hand side 0; their flux comes from the element balance), then a d x d solve per element with an
exterior face moves the interior-face fluxes to minus the element residual. Elements without an exterior face are
untouched.
Measured, p1-nc on vpp_poisson_2d, 13 x 13, before -> after:
jump of the normal component (interior faces): 5.56e-3 (67 of 408 faces) -> 7.0e-15 (0)
element balance residual: 1.7e-16 -> 1.6e-16
field_difference (FemTools RT0 field vs post-processor): 6.5e-2 -> 7.5e-14
L2 velocity error vs exact, 7/13/25 nodes: 0.115/0.0594/0.0303 -> 0.130/0.0640/0.0316 (still first order,
ratios 2.04, 2.02; it is 3-8% larger because the interface fluxes now follow the weak boundary treatment)
serial vs 2 ranks (overlap 1): dof vector equal to 1e-9 (test), L2 error 0.0640478848134 vs 0.0640478848135
test_hdiv_vpp.py: the pinned xfail-style test is gone, p1-nc is in the serial and the 2-rank (overlap 0, 1) lists:
11 passed (-k nc). test_velocity_postprocessing.py -k "nc or p1": 36 passed, 2 skipped. test_poisson2d.py -k nc and
single_phase_gw -k nc: 1 passed each. Run locally on macOS arm64, env proteus-bc-261025; CI is the oracle.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The spec's `outflow` set (q: open, i.e. zero diffusive flux) on the whole boundary is realized as SWFlow's reflectingBCs=False with no Dirichlet data (SHALLOW_WATER_BOUNDARY, DispatchTable.py), as the decks' `reflecting_BCs=False` with `lambda x, flag: None`. A state imposed on part of the boundary is still refused by name. dam3bumps_open.ymf is dam3Bumps over five seconds (the rarefaction reaches the open end at x = 0 after 3.7 s), run against `parun --SWEs dam3Bumps.py -C "final_time=5.0 dt_output=1.0 structured=False he=2.0 dam_x_location=16.05 reflecting_BCs=False"`: - every numeric dataset bitwise equal, 1 rank and 2 ranks (partition pinned): dam3Bumps_open-1, -2 pass. - test_dispatch.py: the outflow dispatch passes the precheck, a Dirichlet on part of the boundary is refused. - test/dispatch + test/test_pro_cli.py: 171 passed, 1 skipped (local, macOS arm64). Item 1 of the round (drop the CLSVOF 2-rank xfails): C0 r11 (72d6cc8) already removed them, so there is nothing to drop. test_dispatch_run.py on 92f24ad: 8 passed in each of 2 full runs (all four cases serial and 2 ranks, both CLSVOF cases among them). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The spec the previous commit's dam3Bumps_open test reads; the commit before it left it out because .gitignore lists *.ymf (the other test/dispatch specs are tracked). Same measurement: bitwise vs the deck, 1 and 2 ranks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-data ADR form (generator spike) generator/generate.py reads the ADR dict ymf.symbolic emits (no sympy) and writes the functor scalarSUPGElement, scalarUpwindFace and scalarInflowPenaltyFace consume; generated.h replaces vof.h's VOFCoefficients and ncls.h's NCLSCoefficients behind -DADRH_GENERATED (module adrh_gen, sh build.sh gen). The element template (tau, shock capturing, BDF history) stays in the engine, as the gap note's section 3 recommends. Measured (macOS arm64, proteus-pro-261015 env, damBreakLevelSet he=0.05 fixture, 733 elements): - vof_test.py and ncls_test.py with ADRH_MODULE=adrh_gen: the same errors as the hand-written functors (VOF residual 1.98e-15, Jacobian 2.44e-16, solution 2.18e-16; NCLS 1.71e-16, 2.47e-16, 1.88e-16); both pass. - generated vs hand-written, same module code: VOF fixture 100% of entries bitwise equal; NCLS 99.5% (1.97e-17; 100% with -ffp-contract=off); random porosity/velocity 2D and 3D: 1.1e-16 (association order of eps*u*v). - serial vs 2 ranks (mpiexec -n 2, partitioned element assembly): 1.8e-16 to 4.2e-16 relative, 2D and 3D, both kernels. - time, 73 300 elements, min of 7: generated / hand-written = 0.91-1.02 (VOF), 0.90-1.00 (NCLS): none. - the generator refuses RDLS (Hamiltonian nonlinear in grad u; mesh symbol h), MCorr (diffusive flux, reaction in u, h) and the flow problem (3 equations), naming what the template lacks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…float() casts deleted A Python int was stored only in the int dicts, so a kernel asking for a double found nothing and every call site wrapped the value in float(...). The scalar __setitem__ now stores an integer kind (Python int/bool, numpy integer/bool) as int/int64 AND widened in the double dict; the integer dicts are unchanged. Decided by cekees 11-15. Done at store time inside cArgumentsDict, not in the header's scalar<double>() lookup: same observable result for every kernel, one extension rebuilt instead of every mprans module (the header is in all of them). Also: scalars are classified by kind, not by pybind11's implicit conversions. The old int64 overload ahead of the double one truncated a numpy float32 to an int once the float() guard is gone; a float32/float16 is now a double. A tuple, None or string is still a TypeError. 62 `argsDict[k] = float(x)` casts removed (mprans x14, richards, m_comp_co2). `int(...)` casts are kept: they coerce a double-typed value (1.0) to the int a kernel asks for, a narrowing the dict deliberately does not do. Measured (macOS arm64, MPICH env, serial; FI_PROVIDER=tcp, -mat_partitioning_type current): test/dispatch, TADR, CLSVOF, shallow_water, ADR_SGS, porosity, richards: 111 passed (pins unmoved, no numeric change: the widened value is the int's exact double). New test_argsdict_widening.py (24 cases: int widening, integer kinds, float kinds not truncated, latest wins, arrays unaffected, non-numbers TypeError) plus test_argsdict_values.py and test_index_type.py pass. Not run locally: the rest of the suite (CI). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… field; no isinstance on spaces `velocityFunction(ci)` on every algorithm (and on AggregateVelocityPostProcessor) returns a FiniteElementFunction of Hdiv_AffineOnSimplex (RT0 for p1-nc, pwl, pwl-opt, pwc, sun-*, dg, pwl-ib-fix-0; BDM1 for pwl-bdm, pwl-bdm-opt, dg-bdm; None for BDM2 and point values), built on first use from the element-wise velocity of the last postprocess (one dof per face, or d per face, shared by the two elements), so a run that never asks pays nothing. `.known` marks the dofs an owned element fed, `.normalDefect` the disagreement of the two elements of a face. The test helper hdiv_vpp_mpi.py no longer converts: it takes the post-processor's own field. The 5 isinstance(femSpace, ...) sites of the file (chooser, p1-nc, pwl x2 incl. the test space, dg x2) are replaced by one helper reading the dof map (dof i of an element is its node / its face / its own), which is what the algorithms depend on, not the class. Measured (vpp_poisson_2d 13 x 13, 288 elements, 18 H(div) variants run): jump of the normal component <= 1e-14 (was 5.56e-3 for p1-nc, previous commit); field vs the post-processor's own evaluation at random points 1e-13; 2 ranks (overlap 0/1) vs serial dof vector equal to 1e-9 as before. test_hdiv_vpp.py + test_velocity_postprocessing.py: 72 passed, 4 skipped (the skips are the existing ones). Local macOS arm64, env proteus-bc-261025; CI is the oracle. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lls: N})
A shallow-water discretization that gives `mesh: {cells: N}` runs on SWFlow's structured path (the decks'
structured=True): the box as RectangularDomain, nnx = nny = N + 1, he = L[0]/N, as circular_damBreak.py has
(nnx = nny = 50, N = 49). `h` still takes the triangle path; both or levels != 1 are refused. ymf_run's precheck
(proteus/cli/ymfrun.py, one condition) no longer refuses `cells` for split discretizations; only a levels study.
Two-phase still needs h and refuses cells when it realizes.
circular_dam.ymf vs `parun --SWEs circular_damBreak.py -C "sw_model=0 final_time=2.0 dt_output=0.4"`: every numeric
dataset bitwise equal, 1 rank and 2 ranks (partition pinned). test/dispatch + test_pro_cli.py: 172 passed, 1 skipped
(local, macOS arm64). The old test that refused the lake's `cells` study now tests the levels refusal.
Missing word for the ymf round: cells per axis. The decks tie nny to nnx by their own aspect rule (dam3Bumps
nny - 1 = (nnx - 1)/2 on a 75 x 30 box), and a list in `cells` is a study, so a non-square structured grid cannot be
stated; here N applies to every side. Stored meshes (item 3b) are not done: see the handoff.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… neighbours) traceStreamline(velocity, x0, h, nSteps) follows a streamline of an RT0 or BDM1 FiniteElementFunction (for instance vpp.velocityFunction(0)); the field is evaluated per element from the dofs through the Piola basis, the element of each stage is found by walking through the face neighbours, and the trace stops where it leaves the mesh. Known flows on a 9 x 9 / 17 x 17 triangle mesh (test_hdiv_streamlines.py, 2 passed): uniform flow (1, 0.5) in RT0, 12 steps crossing 8 elements: deviation from the exact line 1e-12 (round-off) rotation about (1/2, 1/2) in BDM1, radius 0.3, h = 0.02, 150 steps (half a turn): radius error 2.0e-11 (test bound 1e-6), angle advance error < 1e-6; the circle of radius 0.5 stops at the boundary. Serial only; not run on a velocity of a post-processor (the tracer takes any function of the spaces). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…roteus_index_t / proteus_csr_index_t Types only. ArgumentsDict reads, kernel pointers and locals that hold mesh, dof or csr numbers move to the index types (mpretype/ptrretype/declretype name classes of parts 2-3); face-local ebN_local and the quadrature numbers stay int; csrTransposeIndices is csr (Richards.py astype(CSR_INDEX_DTYPE)); ebN_i_k is an array position (index type). Checks: clang -Wshorten-64-to-32 clean over cADR.cpp and cRichards.cpp at index/csr 64/32, 64/64, 32/64, 32/32 (before: 21 diagnostics each, errors from CompKernel.h at 64). g++ 11.4 (ceds-model) -Wall clean at 32/32, 64/32, 64/64 (one pre-existing -Wcomment at Richards.h:2184). Tests (32-bit build, macOS): test/richards, ADR3D, ADR_SGS, IFEM, test_adr_problem, griffiths_lane_6: all pass, no pinned value moved (round total 525 passed, 40 skipped; 25 failures are ymf-environment, see PR). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nly) through the index types eN/ebN/dof/l2g/elementBoundaries in unfitted::CutGeometry (gfF/gfS/icase*/demoted/active/fluxLift/compDFa and Inputs), the cutfem/ifem face lists, FaceCtx pointers, tripleCutEdge, and sd_rowptr/sd_colind as csr arrays (the kernel reads them as csr via CompKernel.h). Face-local ebN_local and quadrature numbers stay int. No arithmetic or logic touched. Checks: clang -Wshorten-64-to-32 clean over ADR.cpp at 64/32, 64/64, 32/64, 32/32 (before: 48 distinct lines, 208-780 diagnostics with template instantiations). g++ -Wall clean at 32/32, 64/32, 64/64. Tests (32-bit): test/ADR3D, test/IFEM, test_adr_problem, ADR_SGS: pass, no pinned value moved. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…parsity through proteus_index_t meshio.h/.cpp: the six write* routines (Triangle, Tetgen, 3dm, 2dm; mesh and element-boundary nodes) take proteus_index_t counts and arrays, so mesh.cpp's calls compile at index 64 with no change to mesh.cpp. Index-type signatures and loop counters only; no reader logic. cartesianPartitioning.cpp: new proteus_index_t[] for the Mesh arrays it fills. sparsity.cpp: ebN/eN_global locals. Domain.cpp has no meshio call and no index type (nothing changed). Checks: clang -Wshorten-64-to-32 clean at 64/32, 64/64, 32/64, 32/32 over meshio.cpp, mesh.cpp, cartesianPartitioning.cpp, sparsity.cpp (before: 6 errors in mesh.cpp, 12 errors in cartesianPartitioning.cpp, 9 warnings sparsity.cpp; meshio.cpp:139/438 size_t notes are pre-existing). g++ -Wall clean at 32/32, 64/32, 64/64. Tests: test/mesh_tests importers/numbered arrays pass where ymf allows (failures are ymf-env). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…number buffers follow proteus_index_t getNonOwnedNodeValues copied the subdomain numbering to np.int32, which fails the proteus_index_t[:] buffer at index 64; it and the node-number MPI exchange now use INDEX_DTYPE and an MPI datatype chosen from sizeof(proteus_index_t). Counts and displacements stay int (MPI requires it). cyCheckOwnedVariable, cyGetGlobalVariable, pyxGetLocalNearestElementIntersection and their cMoveMeshMonitor callers return/hold proteus_index_t[:]; nearestNArray and eN_phi are index dtype. Flags, material types, local counters stay int. Checks: Cython builds; test/MoveMeshMonitor passes serial (32-bit build); the MPI path at 2 ranks is covered only where that test launches it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (80 isinstance + 28 class-name sites)
A test of a concrete space class rejects or mis-dispatches every space that is not
one of those classes: the any-order C0_AffinePolynomialOnSimplex (same numbering as
P1/P2 for order 1,2 but another class), Bernstein of any order, the H(div) spaces.
FemTools: every space states continuity ('C0','NC','DG','Hdiv'), family, order,
cell ('simplex'/'cube'), declared in one table at the end of the module (an
instance overrides, as the any-order spaces do with order); DG monomial spaces
now carry order = k. Base-class methods: isSpace(continuity, family, order, cell),
hasBasisHessians(), dofCoordinates() (mesh vertices for P1, the dof map's Lagrange
nodes otherwise), sameSpaceAs(other). Additive: no existing attribute or method
changes.
Callers changed:
- Transport.py: the 63 viewSolution / viewSolutionVTK class tests -> isSpace(...);
the rank-interface DG check (dofMap class) -> continuity == 'DG'.
- mprans GN_SW2DCV, MoveMesh, RANS2P, RANS2P_IB, SW2D, SW2DCV, elastoplastic:
`Hess = isinstance(P2)` -> hasBasisHessians() (now true for any order >= 2).
- RANS3PF particle velocity: P1 or P2 only -> any continuous Lagrange/Bernstein
simplex space, through dofCoordinates().
- RDLS: Bernstein check (cube or simplex class) -> isSpace('C0','bernstein').
- gwvd: P1 assert -> the P1 of the interface (any class).
- 28 `femSpace.__class__.__name__ ==` "all femSpaces must be the same" asserts
(Transport, ADR, 23 mprans, richards x2, elastoplastic, m_comp_co2) -> sameSpaceAs.
Left on purpose (not C0's files or not P1/P2 dispatch), listed in the handoff:
PostProcessingTools.py (C10b), TimeIntegration.py (C17/C14), FemTools internals
(multilevel transfer), ADR.h pOrder from the dof count and Richards.h's
nDOF == nSpace+1 assert (kernel files), Transport's archive grouping by class.
Checked for unchanged behaviour on the existing spaces: test_space_interface.py
(125 cases) evaluates, for every existing class, each old isinstance condition
against its replacement: identical answers. One intended difference: the legacy
cube classes C0_LagrangeOnCube/BernsteinOnCube subclass the P1 simplex class, so
the old viewer tests matched them; they are cells 'cube' now and no longer take
the simplex viewer branches. macOS arm64, MPICH, serial and 2 ranks
(`-mat_partitioning_type current`, FI_PROVIDER=tcp): test_space_interface, dispatch
(serial and 2-rank bitwise cases), TADR, CLSVOF, shallow_water, ADR_SGS, porosity,
richards, elliptic_redist, gwvd, hotstart_rans3pf, simplex/hdiv dofmap, and the
partition-independence tests (av, gn_sw2dcv, mcorr, ncls_edge, sw2dcv, tadr,
twophaseflow, vof, vos; serial vs 2 ranks): 304 passed, pins unmoved.
Not run locally: the rest of the suite (CI).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…[project] Distribution name py-proteus (import name stays proteus); metadata moves from setup.py to [project]: MIT (SPDX, LICENSE.md), requires-python >=3.12 (was a stale, untested >=3.9: CI tests 3.12 and 3.13, and the CI environments' numpy >=2.5.2 / scipy >=1.18 need 3.12), URLs, classifiers, readme, runtime dependencies unchanged (numpy scipy mpi4py petsc4py h5py ymf), test extra, the pro console script. The version stays in setup.py (RELEASE.md's three files); [project] declares it dynamic. setuptools floor 77 for the SPDX license. Measured: python -m build --sdist --no-isolation gives py_proteus-2.0.0.dev0.tar.gz with the expected PKG-INFO and entry_points. Nothing reads the installed distribution name (no importlib.metadata or pkg_resources use in proteus/, scripts/, test/). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…y-proteus sdist is 3.6 MB Measured 2026-11-16 (macOS arm64, python 3.14, build requirements in a bare venv, no PETSc, nothing compiled or uploaded): python -m build --sdist --no-isolation -> py_proteus-2.0.0.dev0.tar.gz, 3.9 MB before and 3.6 MB after pruning docs/issue_archive (a 1 MB tracker export). PyPI's limit is 100 MB; the tracked tree is 97 MB because test/ (1788 files) and experimental/ are not shipped (MANIFEST.in grafts only proteus, docs, scripts; unchanged). twine check --strict passes; no .so/.o/.pyc/.log/.h5/.xmf/.github files; PKG-INFO Name py-proteus, Requires-Dist ymf. The script asserts those, a 50 MB cap and an optional EXPECT_VERSION. Installing and running the sdist stays with sdist.yml (every leg), not duplicated. The stale global-exclude of docs/* was a no-op and is dropped. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (inert until a tag and a registered publisher) Same shape as ymf's release.yml (cekees/ymf#14). Triggers only on bare-number tags, as proteus releases always were: 2.0.0 -> PyPI, 2.0.0a1/b1/rc1 -> TestPyPI. The build job runs tools/check_sdist.sh with EXPECT_VERSION set to the tag, then classifies the version; simulated locally: 2.0.0rc1 accepted as a pre-release, 2.0.0 refused against an rc build. Environments testpypi and pypi are named, not created; id-token: write only in the publish jobs; no secret or token; actions pinned by SHA (releases >= 3 weeks old on 2026-11-16). Zenodo: its hook fires on a published GitHub release; this workflow never creates or edits a release, so a final tag made by gh release create fires Zenodo once and this workflow once, and an rc tag pushed with git push fires neither Zenodo nor a release. actionlint passes; the workflow itself has not been run. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es by hand, Zenodo, ymf and conda-forge Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ypes (found by the real 64-bit build) The first 64-bit-index build on ceds-model failed in these two kernels (they were in nobody's list): m_comp_co2.h 2408 error lines, ElastoPlastic.h 320. Same pattern as the mprans families: ArgumentsDict reads, pointers and locals by name class; face-local ebN_local stays int; csr loops/columns are csr (full_offset_from_compact returns csr; the Full-system column is a static_cast to csr); m_comp_co2.py: comp0/comp1 rowptr/colind CSR_INDEX_DTYPE, internalNodesArray INDEX_DTYPE. Checks: clang -Wshorten-64-to-32 clean over cm_comp_co2.cpp and cElastoPlastic.cpp at 64/32, 64/64, 32/64, 32/32 (before: 30 / 84 / 56 distinct diagnostics at 64/32, 64/64, 32/64). Tests (32-bit build): test/m_comp_co2 8 passed, griffiths_lane_6 (ElastoPlastic) pass; no pinned value moved. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rrays to proteus_index_t
NodeStarFactor and calculateConservation{Residual,Jacobian}PWL cast nodeStarElements*, dofMapl2g and dofStar* arrays to
int*, which the 64-bit build rejects (postprocessing.h takes proteus_index_t*). Casts only.
Tests (32-bit build): test/post_processing, test_hdiv_vpp: 105 passed, 4 skipped.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…oteus_index_t signature partitioning.pxd declared the parents vector as vector[int] and cpartitioning.pyx returned np.intc; the C++ function (cartesianPartitioning.cpp) takes std::vector<proteus_index_t>&, so the 64-bit-index build failed in the generated cpartitioning.cpp. The binding now uses vector[mesh.proteus_index_t] and INDEX_DTYPE (identical at 32 bits). Tests (32-bit build, macOS): test/multilevel -k hierarch/parents/generated: 201 passed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lty grows with the degree
Mechanism 1 of 1 that the measurements asked for. The *_exterior flux classes
(Diffusion_{SIPG,IIPG}_exterior, NIPG by boundaryAdjoint_sigma = -1) already run
on the any-order spaces: the traces, face quadrature and boundary data are
space-generic. What breaks is the penalty: penalty_constant/h is the constant the
classes always used, and coercivity needs it to grow like p**2/h.
New harness weak_dirichlet_mms_mpi.py (the problem of simplex_mms_mpi.py with the
boundary data imposed weakly). Poisson, smooth u, unit square, SIPG, penalty_constant
10, strong-Dirichlet error on the same mesh for comparison. L2 error:
p nn strong weak, no factor weak, factor p**2
3 9 1.051e-4 7.485e-4 (7.1x) 1.016e-4
3 17 6.268e-6 2.287e-5 (3.6x) 6.160e-6
4 9 5.697e-6 4.159e-5 (7.3x) 5.632e-6
4 17 1.813e-7 8.829e-5 (487x) 1.802e-7 (the unscaled error grows with refinement)
Smallest constant that matches strong at h = 1/8: about 10, 20, 40 for p = 2, 3, 4.
Rates with the factor (nn 9 -> 17): p = 3 L2 4.04 H1 3.00; p = 4 L2 4.97 H1 3.98.
IIPG and NIPG, p = 3, nn 9: L2 1.030e-4 and 1.050e-4 (strong 1.051e-4); Bernstein p = 3
equals Lagrange. Tetrahedra p = 3, nn 5: strong 2.951e-3, weak 2.702e-3, unscaled 9.82e-2.
Serial = 2 ranks (p = 1..4 nn 5, 9; 3D p = 3): errors equal to 5 digits.
NF_base.penaltyOrderFactor(): 1 for degrees 1 and 2 (the constant they always had: no
existing result moves), p**2 above, p the largest degree among the continuous
Lagrange/Bernstein spaces of the unknowns; penalty_order_scaling = False switches it
off. Transport.py multiplies the interior and exterior penalty arrays by it (factor
1.0 is bitwise the old expression). Discontinuous spaces are not scaled: DG P3+ monomial
spaces exist and their pinned results would move; their interior penalty needs the same
factor and is not measured here. ADR.py and MCorr3P.py fill their own penalty arrays
(C44's / a kernel file) and are not changed.
test_weak_dirichlet_mms.py: 12 cases (optimal rates p = 3, 4; weak within 10% of strong;
IIPG/NIPG; Bernstein = Lagrange; negative control with the factor off; 2 ranks = serial in
2D and 3D; the factor). 17 s. Also run: test_numerical_flux_constructors, test_adr_problem,
poisson_2d, periodic, VOS, MoveMeshMonitor, test_simplex_mms, dg: with the 12 new,
155 passed, 17 skipped (macOS arm64, MPICH, FI_PROVIDER=tcp, -mat_partitioning_type current).
Not run locally: the rest of the suite (CI).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The distribution rename makes setuptools write py_proteus-*.tar.gz, so dist/proteus-*.tar.gz (sdist.yml, pytest-ways.yml) matched nothing. dist/ holds only the one sdist built in the step before. Edited with cekees's go (C3's files). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ugh proteus_index_t (C32 files, types only) The build*Subdomain2GlobalMappings family (quadratic 1d/2d/3d, cube, DG) took const int* offsets and numberings and wrote int dof arrays; the Python side (FemTools) and the mesh already pass proteus_index_t arrays, so at index 64 the generated cpartitioning.cpp did not compile and the Python buffers would not have matched. Inputs, outputs (offsets_subdomain_owned, subdomain_l2g, subdomain2global, nDOF_*, max_dof_neighbors), the dof locals, readSimplexNodeStars' range, material-type maps (int tags) and the MPI count casts (static_cast<int>) follow the index type. cpartitioning.pyx/partitioning.pxd: casts and counters. No numerical change. Checks: clang -Wshorten-64-to-32 over partitioning.cpp and cartesianPartitioning.cpp clean at 64/32 and 32/32 (before: 124 diagnostic lines at 64/32; 64/64 and 32/64 stop at the PETSc static_assert by design). Tests (32-bit build, macOS, -n 6): test/ci, test/multilevel, test/MeshAdaptPUMI, partition guards: 1115 passed, 2 failed (test_partition_balance: ghost-layer thinness and node-weight balance; partitioner quality assertions, not types: compared with the 32-bit ceds-model run in the PR body). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…gh proteus_index_t (C24 files, types only) MeshConverter/ParallelMeshConverter allocate and fill the Mesh arrays (new int[] -> proteus_index_t[]), the offsets and numbering temporaries, the node-star sets; the PUMI calls that take int counts get static_cast<int> at the call site (apf::construct, setCoords, model counts). DumpMesh prints index values as long long. Checks: clang -Wshorten-64-to-32 at 64/32, 64/64, 32/64: no diagnostic left that involves proteus_index_t in these three files (before: 42 / 28 / 37; what remains is size_t/apf::Gid narrowing that exists at 32 bits too). The PUMI extension builds and test/MeshAdaptPUMI passes (32-bit macOS; the flaky Gmsh SIGSEGV did not occur). Not changed: SizeField.cpp, ErrorResidualMethod.cpp, MeshFields.cpp, VMS.cpp (no index diagnostics). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s the node numbering as proteus_index_t The file defines its own construct/constructVerts (int* local2globalMap); the 64-bit-index build on ceds-model (scorec in proteus-ci-main) rejected the call with globalMesh.nodeNumbering_subdomain2global. Parameter type only. Checks: whole tree builds at index 64 / csr 32 with PUMI on (ceds-model, g++, python 3.12); this file does not compile against the macOS scorec at 32 bits either (different apfConvert.h), so it was verified on ceds-model only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… proteus_index_t declaration The definition took std::vector<int>& while partitioning.h declares std::vector<proteus_index_t>&; at index 64 the mangled names differ and cpartitioning.so failed to load (undefined symbol) in the 64-bit suite on ceds-model. Types only (vector element, the coarse-local map's value). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…g with INDEX_DTYPE DiscontinuousGalerkinDOFMap, QuadraticLagrangeCubeDOFMap, QuadraticLagrangeDOFMap and P1BubbleDOFMap allocated l2g as int32; the partitioning builders now write proteus_index_t into it, so at index 64 the write overran the array and corrupted the next allocation (dof_offsets_subdomain_owned read back as garbage; 'number of ghostnodes must be non-negative' collecting 40 test modules; found by the first 64-bit suite on ceds-model). Identical at 32 bits. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…uite found (PETSc index type, subsurface, post-processing flags) Found by running the suite on a real 64-bit-index build (ceds-model, int64 mesh indices, 32-bit PETSc): - LinearAlgebraTools: the LGMap and ghost arrays handed to petsc4py are converted to PETSc.IntType (PETSc's PetscInt is its own width; petsc4py rejected int64 'safe' casts: 842 failures). - subsurfaceTransportFunctions.pyx: ITYPE_t buffers for the mesh arrays (exteriorElementBoundariesArray, elementBoundaryElementsArray, boundary/element arrays) are proteus_index_t; material types stay int; eN/ebN locals follow. - postprocessing: the skipflag_elementBoundaries flags are proteus_index_t like the other flux flag arrays (header, C and cpostprocessing.pyx cast); PostProcessingTools allocates fluxElementBoundaries(_global) and nodeStarElementNeighborsArray with INDEX_DTYPE. Identical at 32 bits. Checks at 64 (ceds-model): test/post_processing + test/test_hdiv_vpp: 80 passed, 1 failed (below), was 24 failed; test/richards, ADR3D, poisson_2d, simplex_mms pass. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
linux-64 / py3.13 (locked) failed at Build sdist: its environment locks
setuptools 73.0.1 and builds with --no-isolation, so the build-system floor is
not applied, and setuptools 73 rejects the PEP 639 license string and
license-files ('project.license must be valid exactly by one definition').
Back to license = { text = "MIT" } plus the MIT classifier (LICENSE.md is
packed by default), setuptools floor back to 61.0. Measured: tools/check_sdist.sh
passes with setuptools 73.0.1 and with 84.2.1 (deprecation warnings only on 84);
the PKG-INFO has License: MIT and License-File: LICENSE.md. Switch to the SPDX
string once the locked environments carry setuptools >= 77.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…NDEX_DTYPE 19 mprans model classes (AddedMass, CLSVOF, Dissipation, GN_SW2DCV, Kappa, MCorr, MCorr3P, Pres, PresInc, PresInit, RANS2P, RANS2P_IB, RANS3PF, RANS3PSed, RDLS, SW2D, SW2DCV, TADR, VOS3P) still allocated it as int32 while the kernels and cpostprocessing read it as proteus_index_t; at index 64 the velocity post-processing crashed in calculateConservationJacobianPWL_opt and the hot-start / checkpoint / two-phase partition tests failed (found by the 64-bit suite on ceds-model). Identical at 32 bits. At 64: those test files pass. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…pe of their width ParallelMeshConverter gathered the per-rank owned counts with MPI_Allgather(MPI_INT) straight into the proteus_index_t offsets arrays, and cartesianPartitioning reduced max_nNodeNeighbors_node (proteus_index_t) with MPI_INT; at index 64 both wrote half-width garbage (nodeOffsets_subdomain_owned read back as junk: 'number of ghostnodes must be non-negative' in test/MeshAdaptPUMI reconstructParallel, gauges_pumi). The counts are gathered into an int vector and widened; the reduction is done in long long. Identical at 32 bits. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rrays with INDEX_DTYPE _line() allocated elementNodes, neighbours and l2g as int32 and handed them to ctimeIntegration.applyDGlimitingP1Lagrange1d, which reads proteus_index_t: a deterministic SIGSEGV at index 64 (found by the 64-bit suite), a pass at 32 bits. The arrays now follow the index type; the tag array stays int. At 64: 3 passed, three runs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…_t like the other flux flag arrays calculateConservationResidualGlobalBoundaries read the skip flags (fluxElementBoundaries, INDEX_DTYPE) as int*, so at index 64 every second flux face was treated as not skipped: the sun-gs-rt0 initial residual was wrong (max 0.513 vs 0.0074) and Gauss-Seidel stalled (10000 sweeps, 0.48; 231 sweeps to 9.9e-7 at 32 bits). Cause found by the C10b session (measured with an int32 control). Header, C and cpostprocessing.pyx cast. At 64 and 32 (ceds-model): test/post_processing + test_hdiv_vpp 81 passed, 4 skipped; sun-gs-rt0-P1 passes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Each change below was reviewed, and passed CI, as its own pull request on cekees/proteus. This branch merges them onto
mainat 92f24ad with one merge commit per pull request, in the order listed.Merge with "Create a merge commit", not squash or rebase, so the commits keep their hashes and the fork's pull requests close themselves.
LU.preparerefuses a non-finite matrix as a failed linear solve (the cause of the Richards implicit-FCT NaN Jacobian is not found)p1-ncmade single valued, H(div) field, streamlinesymf_runArgumentsDictwidening, space interface, weak Dirichlet on any-order C0 spacesMeasured, per pull request:
proteus/LinearSolvers.pyand tests.LU.prepareandRedundantLU.preparecheck the stored values for a NaN or Inf before SuperLU sees them; a bad matrix is a failed linear solve (Newton ends the step, the solver, size and first bad entry are logged) instead of a SIGSEGV indgstrf, which the 11-16 fleet nightly hit intest_levee_edge_flux_with_implicit_flow_fcton Linux pip builds. Cost of the check: 8 us, 55 us and 0.21 ms at nnz 5e4, 4.5e5 and 1.8e6, against factorizations of 11 ms, 0.22 s and 1.67 s.test_lu_nonfinite_matrix.py,test_superlu.pyandtest_step_time_check.pypass. The defect itself is NOT fixed: the levee test reproduces on the fork's CI runner (92985 of 93017 matrix entries NaN after Newton residuals grow from 1.3e13 to 2.8e18) but passes on two other builds, so its cause (Newton or step control, not the Richards kernels, which stay finite for finite input) is open. Nothing underproteus/richards/changes, the xfail from the earlier train stays, and 1.9.x was not checked.test/conftest.py(retrying_run) and addstest/test_mpi_launch_retry.pycases. After a SIGSEGV the relaunch runs in the directory as the crashed launch left it, and the first launch's whole stdout and stderr go to named files; this is what hid the cause of a failed 2-rank NCLS test on 2026-11-15. The new tests fail without the change (2 failed, 1 passed) and pass with it (3 passed); the launch-policy tests go from 25 to 33 passed. A realmpiexeccrash was not run locally.proteus/PostProcessingTools.pyand tests. Thep1-ncRT0 velocity was not single valued on interior faces of elements that touch the boundary because the face-dof residual lacked the weak boundary term: normal jump 5.56e-3 on 67 of 408 faces becomes 7e-15 (13 x 13; L2 error 0.0594 to 0.0640, still first order); the test that pinned the defect is replaced by the passing assertion, in serial and on 2 ranks. The post-processor now yields its velocity as a FemTools field in the RT0 or BDM1 space (velocityFunction), andtraceStreamline(RK4, face-neighbour walk, serial only) follows it: exact to 1e-12 for uniform flow in RT0, radius error 2e-11 for rotation in BDM1. 72 passed, 4 skipped locally.proteus/Dispatch*.py,test/dispatch, one condition inproteus/cli/ymfrun.py. A ymf spec'soutflowon the whole boundary runs the SWE model with open boundaries, andmesh: {cells: N}runs the structured SWFlow mesh; the answers are bitwise equal to the hand-written decks on 1 and 2 ranks (dam3Bumps open,circular_damBreak.py -C sw_model=0), 172 tests passed locally. Not done: stored meshes, dispersive auxiliaries, 3D tanks, gauges, hot start. The one edit outside the dispatch files letscellsbe used with split discretizations (only alevelsstudy is still refused).experimental/adrhonly; noproteus/mpransfile and no default build changes. A generator turns ymf's plain-data ADR form into the VOF (with porosity) and NCLS coefficient functors of the engine form, built withsh build.sh gen. Against the hand-written functors on the existing fixtures: same errors (VOF residual 1.98e-15, NCLS 1.71e-16), bitwise equal on the VOF fixture, 1.1e-16 with random porosity, serial against 2 ranks 1.8e-16 to 4.2e-16, time ratio 0.90 to 1.02. What is generated is the 12 to 18 line functor; the SUPG, shock-capturing and BDF template stays in the engine, so this shows functors, not whole kernels.ArgumentsDicthandling,FemTools.py,NumericalFlux.pyand the mprans.pymodules. (1) A Python int is also stored widened in the double dict and 62float()casts are gone: 111 family tests and 17 new cases pass. (2)FemToolsspaces state continuity, family, order and cell kind; 80isinstancetests and 28 class-name asserts are replaced, and a 125-case test checks that old and new tests agree on every existing space (304 passed, including serial against 2 ranks). (3) The Nitsche penalty grows like p^2 above degree 2: L2 error against strong BCs at 17 nodes is 6.160e-6 against 6.268e-6 at p=3 (unscaled 2.29e-5) and 1.802e-7 against 1.813e-7 at p=4 (unscaled 8.8e-5, growing with refinement); serial equals 2 ranks. Not in this PR: the remainingisinstancesites in other owners' files (listed in its handoff), thegf.Daudit and the RANS2P ghost penalty.proteus_index_t,proteus_csr_index_t; flags, tags and face-local numbers stayint):richards/ADR.h,Richards.h,Richards.py,proteus/ADR.h,Unfitted.h, the meshio routines, MeshSmoothing,m_comp_co2,ElastoPlastic, and, on cekees's instruction to retype globally, the partitioning and MeshAdaptPUMI converter files. Compile checks (clang-Wshorten-64-to-32, g++-Wall) are clean at index/csr 64/32, 64/64, 32/64 and 32/32 on the files touched. A real 64-bit-index build of the whole tree (csr 32) was built and the full suite run on ceds-model, pinned and one suite at a time: 32-bit 29 failed and 4218 passed, 64-bit 31 failed and 4216 passed; the 29 common failures are not type problems (an older ymf in that environment, two partitioner-balance assertions, a leakedPETSC_OPTIONS). Running at 64 found what compiling did not (int32 arrays, PETSc and MPI boundaries, two unlisted kernels): 780 failures, then 55, then 31. The two 64-only failures were fixed afterwards (a test's int32 arrays; oneint*read of the skip-flag array inpostprocessing.c) and re-run at both widths (81 passed, 4 skipped intest/post_processingandtest_hdiv_vpp), but the full suite was not rerun after them. Not verified: csr index 64 (no 64-bit-index PETSc was available),experimental/adrhat 64 bits,CouplingFSI.pyxnodeStarbuffers,MeshConverter.cppagainst the macOS scorec.pyproject.toml,setup.py(metadata moved),MANIFEST.in,tools/check_sdist.sh,RELEASING.md,.github/workflows/release.yml(new), and one line each in.github/workflows/sdist.ymlandpytest-ways.yml.[project]names the distributionpy-proteus(MIT, Python >= 3.12), which is free on pypi.org and test.pypi.org; the sdist is 3.6 MB (3.9 MB before),twine check --strictpasses, and the sdist file name changes fromproteus-*topy_proteus-*, hence the glob edits (dist/*.tar.gz).release.ymlpublishes through Trusted Publishing (TestPyPI on a pre-release tag, PyPI on a release tag, tag must equal the built version) and does nothing until a tag is pushed; the publishers are registered, no tag exists, and nothing is uploaded by this PR.The eight touch different files and merge cleanly in the order listed (checked by the dry run). 2.0 only: none of this goes into 1.9.x.
Diff against
main: 106 files changed, 4717 insertions(+), 1673 deletions(-).🤖 Generated with Claude Code