Repository navigation
main train 2026-11-24: 5 reviewed changes from cekees/proteus - #1374
Merged
Merged
Conversation
model_kind() called a file an so module only if pnList is assigned directly at module level. The air-water-vv so files choose it with an option (`if tank3D.useOnlyVF: pnList = ... else: pnList = ...`), so pro run took 25 of the 31 *_so.py files in air-water-vv (cekees/air-water-vv proteus-2.0.x-update, including 3d/bathyduck and 45DEG_R1) for TwoPhaseFlow case modules and failed before reading the model (Carpenter, main 266eb97, 576 ranks, 9 s, exit 143; parun on the same deck ran to completion). model_kind now looks through the module-level if/try/with/loop blocks, not into a function or class. Before: 6 of 31 awvv so files read as 'so'. After: 31 of 31. test_pro_cli.py: 9 parametrized cases (if/else, try/except, with, plain, annotated, and function/class/no assignment staying 'case'); 3 fail before the change, all 12 model_kind tests pass after. The rest of the file is unchanged (9 failed / 90 passed after; the 9 fail the same way on cekees/main 80ddeac). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
pro msh called Profiling.openLog without setting Profiling.procID, which
Comm.init() leaves unset and openLog asserts on ("Initialize Comm and set
Profiling.procID before opening log"). pro run sets it at the same point. Every
pro msh at the default log level (-l 1) therefore died after about 7 s; the
tests all pass -l 0, which skips openLog, so none saw it (found running the
air-water-vv bathyduck and 45DEG_R1 decks on Carpenter, main 266eb97).
The fix is the one line pro run has. New test: pro msh at the default log level
writes <stem>_msh.log and the mesh manifest; it fails before the change with the
assertion, and passes after.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
pro run hashes the generator's input (the .poly) on rank 0 right after it loads the
model. A model that rewrites that file on every rank at import (air-water-vv
45DEG_R1 calls domain.writePoly("mesh") on each rank) has it truncated and
rewritten by the other ranks while rank 0 hashes it, so a current mesh reads as
stale. Found on Carpenter (main 266eb97, 3072 ranks): pro msh made the mesh
(1165 s, manifest written, `pro st` on one rank: "mesh: current"); the pro run
that followed with --no-mesh stopped after 13 s with "the mesh is stale (the
generator's inputs or command changed)", and the .poly on disk was byte-identical
to the one in the manifest (sha256 795bb3dc...). Without --no-mesh it would have
re-meshed 49 M tets on rank 0 of a 16-node allocation.
A comm.barrier() before the check, once the early return for models that give
their own mesh has passed (every rank takes that branch alike).
test_pro_run_checks_the_mesh_after_every_rank_has_loaded_the_model: 2 ranks;
rank 1 truncates and rewrites the .poly 3 s after loading. Before: exit 2 with
the Carpenter message; after: exit 0. test_pro_cli.py: 9 failed / 91 passed
(the same 9 fail on cekees/main 80ddeac).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and two ranks, plain and SUPG) proteus/kernels/SW2D.py (718 statements) ran only on import: nothing in the tree builds it (the SWE decks use SW2DCV and GN_SW2DCV; test/SWFlow/parab1D.py imports it and never uses it). The helper builds its LevelModel on a 1.0/0.5 depth step on the unit square, three BackwardEuler/Newton steps, with options.try_supg_stabilization 0 and 1; the test checks the bound entry points (calculateResidual/Jacobian vs _supg), finite and bounded depth, that the two variants differ, and that 2 ranks give the serial answer (measured 6e-17 plain, 7e-13 SUPG). SW2D.py uses TC_base, NonlinearEquation, Quadrature, logEvent, cfemIntegrals, memory, Comm, DOFBoundaryConditions and FluxBoundaryConditions without importing them, so it cannot be built as written; the helper puts those names in the module's namespace (kernel not edited, report in the round's handoff). Measured (statement coverage of the new tests alone, against the CI baseline of main 8b86493): kernels/SW2D.py 6.3% (45/718) -> 88.4% (635/718) +590 statements aggregate kernels/ 75.72% (23716/31319) -> 77.6% (24306/31319) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ctionType dg, dgp0, global, none) ls_consrv_vortex_2d_n.py maps correctionType to MCorr.ElementNewton, ElementConstantNewton, GlobalConstantNewton and DummyNewton; no test ran any of them. In-process test (two steps of the deck each, as test_mcorr_bisection.py). 'none' runs and zeroes the correction. The other three raise "RuntimeError: key r_l2g not found" inside the C++ call: MCorr.elementSolve, elementConstantSolve and globalConstantRJ do not put r_l2g in the arguments (residual and Jacobian do, MCorr.py:703 and :854). They are strict xfails that run the Python up to the call; the kernel is not edited (report in the round's handoff). Measured (new tests alone against the CI baseline of main 8b86493): kernels/MCorr.py 66.1% (783/1184) -> 85.7% (1015/1184) +232 statements Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…erial) MCorr3P carries ElementNewton, ElementConstantNewton, GlobalConstantNewton and DummyNewton and no deck selected any. mcorr3p_correction_mpi.py runs the 2D rising-bubble deck (RANS3PF, VOF3P, NCLS3P, RDLS, MCorr3P) to t = 0.004 with MCorr3P on the named solver (multilevel solver NLNI). Tests: 'none', 'dg', 'dgp0' run with the named class and finite dofs, 'none' leaves the level set at 0, Newton conserves the VOF mass to 3e-17. Two kernel findings are pinned, not fixed (kernel not edited; report in the round's handoff): - 'global' fails in MCorr3P.globalConstantRJ, line 977: R = np.array(dtype=float) raises TypeError; - 'dg' and 'dgp0' end with the mass error of 'none' (0.0155 vs 3e-17 for Newton) and one value in every dof: they apply no correction. The tests expect that and fail when it changes. Measured (new tests alone against the CI baseline of main 8b86493): kernels/MCorr3P.py 50.9% (485/952) -> 71.4% (678/952) +193 statements Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ng model (vortex2D deck) redist_vortex_2d_n.py takes the Newton branch unless the deck sets redist_Newton False; no test did, so RDLS.PsiTC (updateSubstep, stepExact_model, initialize_dt_model, choose_dt_model) never ran. In-process, two steps of the vortex2D level set transport with redistancing by pseudo-time continuation: the controller is PsiTC, its updateSubstep and choose_dt_model are called at least twice (counted), the redistanced field is finite, within 0.1 he of the level set and of its sign away from the interface. Measured (new test alone against the CI baseline of main 8b86493): kernels/RDLS.py 67.4% (634/941) -> 74.7% (703/941) +69 statements Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…box deck does not reach NonConservativeBackwardEuler.calculateGeneralizedInterpolationCoefficients (skipped unless integrateInterpolationPoints; m_t = dm (u - u_last)/dt, dm_t = dm/dt, dm_t_sge), Fixed_dt_controller_systemit.choose_dt_model (the first step stays dt_model_last) and stepExact_model, ISO_fixed_MinModelStep.setFromOptions (atol_iso, velocity_Postprocess) and SysNorm (the signed maximum, kept from the 2012 code). Bare instances made with object.__new__. Measured (new tests alone against the CI baseline of main 8b86493; these classes are measured individually, not in the kernels aggregate): TimeIntegration.py::NonConservativeBackwardEuler 65.1% (28/43) -> 100% (43/43) StepControl.py::Fixed_dt_controller_systemit 92.0% (23/25) -> 100% (25/25) SplitOperator.py::ISO_fixed_MinModelStep 97.1% (34/35) -> 100% (35/35) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ll Riemann, nodal h bounds, bounds relaxation, linear friction, tailwater, walls function, drag law) circular_damBreak (SWEs, lumped mass matrix, unstructured he 0.6, t 0.3) with one switch on, serially and on 2 ranks (partition pinned to a slanted cut). Per variant: finite, depth >= 0, water volume (sum ML h) conserved to 1e-11 on a closed domain, and falling when a tailwater edge sits below the still depth; LOW_ORDER_ONLY, no bounds relaxation, linear friction, tailwater and the drag law change the answer by > 1e-8; 2 ranks give the serial answer to 1e-9. NO_STAR_STATES, WALL_RIEMANN, NODAL_H_BOUNDS and the walls function give the default's answer to the last bit on this case (the dam does not reach a wall and the states stay smooth): for them only the run, the conservation and the two-rank comparison are checked. Measured (new tests alone against the CI baseline of main 8b86493; the flags act in the C++ kernel, which is not measured): kernels/SW2DCV.py 87.2% (1190/1365) -> 89.5% (1222/1365) +32 statements Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ive model and getJacobian Adds to the SW2DCV switches test: the consistent mass matrix, GN_SW2DCV (sw_model=1) with the lumped and the consistent mass matrix (conservation, serial vs 2 ranks to 1e-9, differs from SWEs) and, serially, the model's getJacobian, which the explicit SSP scheme never asks for: for SWEs and GN it is the mass matrix of every unknown (symmetric, entries add up to nc times the area). The helper calls it at the end of a serial run. Measured (new tests alone against the CI baseline of main 8b86493; this commit adds 169 to GN_SW2DCV; with the previous commit's 32 for SW2DCV the file's total is 201): kernels/GN_SW2DCV.py 78.5% (1229/1565) -> 89.3% (1398/1565) +169 statements Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…T, trapping, end-point permeability) test_m_comp_co2.py's cases run the deck with the constructor's defaults for most options. The same segregation case now runs with FCT on, with residual gas (S_gr_types), with end-point gas relative permeability (krn_end_types) and with a CO2 injection port as the lumped disk and as the consistent point source. Checked: CO2 and H2O conserved to 1e-6 (the case's own drifts are 1e-10) for the gas options; the point source adds rate pi r^2 T of CO2 to 5% (the doc's "mesh-exact total": 0.01386 against 0.01414), the disk 0.0104 (74%, the nodes do not tile the disk), neither moves the H2O total. LUMPED_MASS_MATRIX needs the explicit lumped solver (the constructor asserts it) and is not run here. Measured (new test alone against the CI baseline of main 8b86493): kernels/m_comp_co2.py 41.8% (1132/2707) -> 47.2% (1277/2707) +145 statements Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he strong faces, weak elsewhere, 'none' open RANS2P.py (the LevelModel of RANS2P.h and RANS2P2D.h): implementsBoundaryKinds; a declared setter turns on the python-side row replacement (dirichletConditionsForceDOF from the strong faces only, per declared component, decided by the declaration for the parallel authority); kernelIsDOFBoundary(ci) hands the kernels the weak faces AND the strong ones (a strong face keeps imposing its datum in the flux, as forceStrongDirichlet always did; the flux class's own isDOFBoundary stays weak-only, so a strong face never also gets the flux class's weak term); forceStrongDirichlet of the coefficients together with a declared setter is refused; the constant-pressure null space check reads the legacy flag, not the per-face one. NO kernel edit: unlike TADR's scalar forceStrongConditions, RANS2P.h/RANS2P2D.h have no force-strong flag, they read isDOFBoundary per face point; the changed branch (the strong union in kernelIsDOFBoundary, strong points > 0) runs in cRANS2P2D (2D) and cRANS2P (3D). Nothing changes without a declared setter. test/rans2p_mixed_bc_mms_mpi.py + test_rans2p_mixed_bc_mms.py (12 tests): manufactured divergence-free Navier-Stokes solution (stream function, sympy forcing, nu 0.1, P1/P1 with the model's stabilization; velocity strong left/top (/back), weak bottom (/front), 'none' right with the pressure as weak datum there; the exact solution has no stress on x = 1). 2D mixed, h 1/16 -> 1/32 -> 1/64: L2 rates u 1.88/1.94, v 1.96/1.97, p 1.60/1.59; H1 u, v 1.01/1.00, p 0.83/0.74. 3D mixed, h 1/8 -> 1/16: L2 u 1.84, v 1.91, w 2.29, p 1.63; H1 u 1.01, v 1.02, w 1.83, p 0.89. as accurate as the all-weak run (2D, 32 elements/side: L2 u 7.8e-4 vs 6.2e-4, v 9.4e-4 vs 6.6e-4, p 4.0e-3 vs 4.6e-3). dofs of the strong walls hold the data to 0.0; no face point is both weak and strong (2D, 3D). every face strong == legacy forceStrongDirichlet bit for bit (2D h 1/16: L2 u 3.0737520031092805e-3, p 1.2080950812986014e-2, both; 3D same); a bare function in a declared setter == the undeclared run bit for bit. serial = 2 and 3 ranks, node and element partitions (-mat_partitioning_type current): relative differences of every L2/H1 norm <= 3.3e-14; 3D 2 ranks within 1e-9. Existing BC suite and the RANS2P users (test_mixed_bc_mms, cube/simplex/weak_dirichlet mms, rank_interface, strong dirichlet, numerical flux, step retry, twophaseflow partition independence, hotstart, dispatch, solver_tests, cylinder2D, rans2p_ib, periodic, CLSVOF, TADR, multilevel, post_processing + the new file): 1159 passed, 8 skipped, 0 failed (Mac, arm64; CI is the oracle). Found, not fixed: RANS2P2D segfaults in calculateResidual with a P2 velocity space on some meshes (NN=13 4/4, plain undeclared setters, test/rans2p_mixed_bc_mms_mpi.py SPACE=p1p2), P1/P1 never: the tests use P1/P1. The coefficients' `stokes` flag is not read by the kernels. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ure datum; periodic dofs leave the forced rows Review of c9369a8, two findings: 1. pp_hasConstantNullSpace tested `not forceStrongAllFaces`, so a declared problem with a strongly imposed pressure datum and u = 0 at the start got True where legacy forceStrongDirichlet gives False. Old behaviour, kept: legacy forceStrongDirichlet never declares the null space; every other problem (weak or no pressure datum) declares it while the velocity is zero. Now a declared setter whose pressure has a strong datum anywhere (collective over ranks, computed once in the constructor: hasStrongPressureDatum) gives False too; nothing else moves. 2. The declared branch did not remove the dofs of a periodic pair from dirichletConditionsForceDOF as OneLevelTransport does (Transport.py): copied the loop (periodicity wins over a Dirichlet value). Only the empty periodicDOFDict path is exercised by the tests (no periodic RANS2P case with a declared setter exists). Not done (nits): the declared branch is not gated on the flux class (RANS2P always builds its weak NavierStokes flux; the flux class refuses a 'weak' face under a class without a weak term); isStrongBoundary[3]/isOpenBoundary[3] in 2D are one-time copies of component 2, like the pre-existing isDOFBoundary[3]. Tests (14 now): the flag read at the first Jacobian (the driver records it; zero velocity): weak velocity + weak pressure datum True (declared and undeclared, the old behaviour), weak velocity + strong pressure datum False, legacy all-strong False, 2 ranks with the strong pressure datum False on both; a declared velocity setter with a bare undeclared pressure setter == the declared weak pressure run bit for bit (2D h 1/16: L2 p 1.2023600021764112e-2). Re-measured: the BC suite and every RANS2P user (same list as before + the new file): 1161 passed, 8 skipped, 0 failed (1159 + the 2 new tests); serial = 2 and 3 ranks to 3.3e-14 (test_ranks_give_the_serial_errors_2d, unchanged and green). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…etsc4py/pyyaml failed) conda-forge yaml 0.2.6 (build h602ebc4_0) ships lib/libyaml-0.1.dylib. pyyaml 6.0.3 (py312h05c94ff_4, built against yaml 0.2.5) and PETSc.abi3.so link @rpath/libyaml-0.2.dylib, so a freshly solved macOS env imports neither. On 2026-11-23 the self-hosted chewbacca-1/-2 legs of #344, #350 and #351 all failed at the Smoke test step with "Library not loaded: @rpath/libyaml-0.2.dylib" before any test ran. The three environment files now constrain `yaml >=0.2.5,<0.2.6`, written as a range so the off-lock legs' pin-to-floor rewrite (sdist.yml) leaves it alone. Measured: on chewbacca, `conda install -n proteus-dev yaml=0.2.5` restored libyaml-0.2.dylib, `yaml.__with_libyaml__` True and `import petsc4py` ok (host fix, already applied). Not measured here: the macOS CI legs with this pin (they run after this PR is pushed). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…single classes cekees decided 2026-11-22 that C49's kernels are floored as one aggregate and that the modules which moved into proteus/ (the gwvd step classes among them) are measured and floored individually, not inside it. The ratchet knew only modules. A floors.json key ending in "/" is now an aggregate over every module under it, a key <module>::<Class> is one class of a module (the report's lines between the class's first and last line, found by parsing the file under the report's source directory). Both are checked, raised by --write-floors and reported as no longer measured exactly like a module floor; the tables still list modules only. Checked on the real combined report of main 8b86493 (cekees/proteus run 45099441761, green): output identical to the old ratchet with the unchanged floors.json (rc 0, 150 modules, 65.8% of 91,735 statements); with test floors added the class numbers equal C49 R3's baseline table (NonConservativeBackwardEuler 65.1%, Fixed_dt_controller_systemit 92.0%, ISO_fixed_MinModelStep 97.1%) and proteus/kernels/ reads 75.7% of 31,319. test/test_coverage_ratchet.py (5 tests, new file): holds at the measured values; an aggregate drop with every module at its floor fails; a class drop fails; a class that is gone is reported; --write-floors raises a part only a point above and adds none. 3 of the 5 fail against the old ratchet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…58.9 (main 8b86493) The four modules that moved into proteus/ are floored individually (cekees 2026-11-22). Measured on the real combined report of main 8b86493 (cekees/proteus run 45099441761, all legs and the coverage job green; recorded with the ratchet's own --write-floors, only these two of its changes taken): | module | statements | old floor | main 8b86493 | new floor | |---|---:|---:|---:|---:| | SpatialTools.py | 1,943 | 56.0 | 57.1 | 57.0 | | mbd/BodyDynamics.py | 817 | 52.2 | 59.0 | 58.9 | | BoundaryConditions.py (Cython-traced) | 1,001 | 70.7 | 70.7 | 70.7 (unchanged) | | MoveMeshMonitor.py | 305 | 65.9 | 65.9 | 65.9 (unchanged) | --write-floors on the same report would also raise ~90 other floors (StepControl, TimeIntegration, SplitOperator among them); those are not touched here. Ratchet on the report with this floors.json: rc 0, no drop. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ep classes at 100.0 Measured on the coverage leg of dev push run 45359350052 (dev e50b052, after #350 and #344): proteus/kernels/ 80.3% of 31,319 statements (main 8b86493 had 75.72%, run 45099441761). Floor 80.0 leaves 0.3 points under the tolerance (max(0.5 pp, 2 statements)). The ratchet on that report with the new floors exits 0; with the kernels floor at 90.0 it exits 1 naming proteus/kernels/ (80.3%), so the aggregate key is evaluated. The three class floors (StepControl Fixed_dt_controller_systemit, SplitOperator ISO_fixed_MinModelStep, TimeIntegration NonConservativeBackwardEuler) are at 100.0, as #350's tests cover them completely. Only these four keys change; no other floor is rewritten. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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 8b86493 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.
dev)dev)dev)Diff against
main: 22 files changed, 1653 insertions(+), 25 deletions(-).