Skip to content

3D NVB refinement count diverges across PETSc patch versions from an identical base mesh (5198 vs 4816) #387

Closed

Description

@lmoresi

Found while unblocking #378's CI. The 3D adapt gate (test_0842) refines an identical 1472-cell tetrahedral base mesh to 5198 cells on the reference toolchain (source-built PETSc 3.25.0, macOS) and 4816 cells on CI (conda-forge PETSc 3.25.3, ubuntu) — a 382-cell difference from the same input.

Within either environment the refinement is partition-independent (identical counts at np1/np2/np4 locally; CI is serial) and structurally sound (CI's FMG-vs-GAMG + label-survival test passes on its 4816-cell child). So this is not a correctness failure of the refinement contract — but the coordinate-driven metric marking (r < 0.18 thresholds on computed centroids) is floating-point sensitive, and the conformity closure amplifies flipped cells into a materially different mesh. Worth understanding whether the divergence is (a) benign FP-at-threshold amplification, (b) a PETSc 3.25.0→3.25.3 behaviour change in the transform machinery, or (c) an unintended sensitivity in the tagged-state seeding — (c) would weaken the determinism story and matter for reproducibility across machines.

The gate test now logs base/child counts everywhere and pins the exact count only in the reference toolchain (see #378).

Underworld development team with AI support from Claude Code

Activity

  1. lmoresi commented on Aug 13, 2026

    @lmoresi
    MemberAuthor

    Verified at development @ e475246f: this is now a documented, pinned, known
    condition rather than an open defect.

    tests/test_0842_nvb_3d_parallel_adapt.py:66-79 carries the full explanation —
    the absolute child count is explicitly declared non-portable, the divergence is
    attributed to FP-sensitive threshold marking amplified by the conformity closure,
    and the count is asserted only in the reference toolchain:

    if parent_cells == 1472 and petsc4py.__version__ == "3.25.0":
        assert child_cells == 5198

    Everywhere else the base and child counts are logged, so drift stays visible. The
    structural gates (partition-independence within an environment, label survival,
    FMG-vs-GAMG) pass on both toolchains, so the refinement contract was never in
    question — only the absolute count was, and it is now pinned exactly where it is
    reproducible.

    Closing as known-and-pinned. If the cross-version determinism question is worth
    pursuing on its own — option (c) in the original filing, an unintended sensitivity
    in the tagged-state seeding — it deserves a fresh issue framed as a determinism
    investigation rather than as a failing count.

    Underworld development team with AI support from Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions