Skip to content

#896: the FAC cover gate classifies every row against its coarse node, wherever it lives - #914

Merged
lmoresi merged 5 commits into
developmentfrom
bugfix/fac-cover-gate-partition
Oct 31, 2026
Merged

lmoresi merged 5 commits into
developmentfrom
bugfix/fac-cover-gate-partition

Conversation

@lmoresi

@lmoresi lmoresi commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

In parallel, the FAC cover gate declined the band patch on a placed fault. The structural split counted, as patch, a fine row whose coarse node is on another rank. This PR classifies every row against its coarse node, wherever that node lives.

Stacked on #892's PR (bugfix/fac-live-block-solver); it is retargeted to development when that merges.

What was wrong

_fac_patch_split_parallel counted a fine row whose coarse node this rank does not hold as patch, without the coincidence test. A placed fault level is partitioned by the add-on partition, which gathers the fault, while the coarse levels keep the base partition. So on the ranks without the fault most rows were such rows.

On UWTN 2026-022's 320-rung linear fixture at np 2, 4474 of rank 1's 9410 rows were counted. That is a cover of 0.797, and the gate declined the patch: 640 velocity iterations, against 67 in serial.

The fix

The coarse rows a rank references but does not hold are fetched from their owners by _append_remote_coarse_nodes. It is one collective scatter carrying each node's coordinates, its component and a key unique to the node, so a split pair stays two nodes. The fetched rows are appended to the rank's node table, and the coincidence, duplicate and halo tests then run unchanged on every row.

Two parts stay rank-local, and the docstring says so:

  • The duplicate test: both copies of a split pair are owned by one rank (ptest_0865 pins this for a split through a seam).
  • The halo: it can miss a layer the serial halo has where a partition boundary runs along the band; ASM's overlap adds one back.

Measured

On the 320-rung fixture at np 2 the patch is installed again: 73 velocity iterations over 18 applications (640 before, 67 serial), with the same peak slip and no background block on the rank without the fault.

Tests

test_1106 asserts that the finest level's patch rows, summed over the ranks, equal the serial count, and that the patch is installed.

  • It uses a structured base, so the count does not depend on the host's gmsh: 4780 rows in serial and at np 2 and 4 on this branch, against 6890 at np 2 on the parent.
  • The review also compared the patch rows as (x, y, component) multisets, on this fixture and on test_1095's 3-D split box: identical to serial at np 2.

Serial FAC/fault suite: 66 passed. At np 2: 26 passed, 3 skipped.

Review

The adversarial review (f7914a9) is in the first comment.

Issues

Underworld development team with AI support from Claude Code

The parallel structural split counted a fine row whose coarse node is held
on another rank as patch. A placed fault level is gathered by the add-on
partition while the coarse levels keep the base partition, so most of the
other ranks' rows were counted, and at np 2 on UWTN 2026-022's linear
fixture (320 rungs) the cover gate then declined the patch (640 velocity
iterations against 68).

The test solves the same fixture at 80 rungs and asserts that the finest
level's patch rows, summed over the ranks, equal the serial count (4248)
and that the patch is installed. On the parent build: 4248 serial, 5798 at
np 2. Tier B, one file under tests/parallel with no min_size mark, run from
the serial batches as well.

Underworld development team with AI support from Claude Code
…lives

_fac_patch_split_parallel counted a fine row whose coarse node this rank
does not hold as patch, without the coincidence test. A placed fault level
is partitioned by the add-on partition and the coarse levels by the base,
so on the ranks without the fault most rows were such rows: at np 2 on the
320-rung linear fixture, 4474 of rank 1's 9410 rows, a cover of 0.797, and
the gate declined the patch.

The coarse rows a rank references but does not hold are now fetched from
their owners (_with_remote_coarse_nodes: one collective scatter carrying the
node's coordinates, component and a key unique to the node, so a split
pair stays two nodes) and appended to the rank's node table. The
coincidence, duplicate and halo tests then run unchanged on every row.

test_1106 passes: 4248 patch rows at np 2, as in serial (5798 before). On
the 320-rung fixture at np 2 the patch is installed again: 73 velocity
iterations over 18 applications (640 before, 67 serial), the same peak slip,
and no background block on the rank without the fault.

Underworld development team with AI support from Claude Code
…d guards gone

From the adversarial review of this branch:

- test_1106 pinned an exact row count on an unstructured gmsh base measured
  on macOS; CI runs linux. It now uses a structured base (regular=True):
  4780 patch rows serial and at np 2 and 4 on this branch, 6890 at np 2 on
  the parent. MPI imported plainly. The serial count is 67 iterations, not 68.
- The docstring says what stays rank-local: the duplicate test (both copies
  of a split pair are owned by one rank, which ptest_0865 pins for a split
  through a seam) and the halo (it can miss a layer the serial halo has where
  a partition boundary runs along the band; ASM's overlap adds one back).
- Every column is held or fetched now, so the "coarse node not held" guards
  could not fire; they are gone. The helper is _append_remote_coarse_nodes,
  and the comment at its call states the constraint, not the bug's history.

The review compared the patch rows as (x, y, component) multisets on this
fixture and on test_1095's 3-D split box: identical to serial at np 2.
Serial FAC/fault suite 66 passed; np 2 26 passed, 3 skipped.

Underworld development team with AI support from Claude Code

lmoresi commented Oct 31, 2026 •

Copy link
Copy Markdown
Member Author

Adversarial review (fixes in f7914a9)

Reviewed by a separate agent against docs/developer/guides/adversarial-review.md.

Findings and what was done

  1. The test pinned a host-dependent count. test_1106 pinned an exact row count on an unstructured gmsh base measured on macOS, and CI runs Linux.
    Resolution: it uses a structured base (regular=True): 4780 patch rows in serial and at np 2 and 4 on this branch, against 6890 at np 2 on the parent. MPI is imported plainly. The serial count is 67 iterations, not 68.
  2. The rank-local parts were unstated.
    Resolution: the docstring says what stays rank-local:
    • the duplicate test: both copies of a split pair are owned by one rank, which ptest_0865 pins for a split through a seam;
    • the halo: it can miss a layer the serial halo has where a partition boundary runs along the band, and ASM's overlap adds one back.
  3. Dead guards. Every column is held or fetched now, so the "coarse node not held" guards could not fire.
    Resolution: removed. The helper is _append_remote_coarse_nodes, and the comment at its call states the constraint, not the bug's history.

The review compared the patch rows as (x, y, component) multisets on this fixture and on test_1095's 3-D split box: identical to serial at np 2. Serial FAC/fault suite: 66 passed. At np 2: 26 passed, 3 skipped.

Issue verdicts

Underworld development team with AI support from Claude Code

@lmoresi
lmoresi changed the base branch from bugfix/fac-live-block-solver to development October 31, 2026 21:07
Development now carries D (#912) and the #894 fix (#913). The only
conflict was scripts/test.sh, where both branches add a tests/parallel
file to batch 4; both are kept.

Underworld development team with AI support from Claude Code
CI failed test_1106 at np 1 as well as at np 2: Linux counts 4772 patch
rows in serial against 4780 on macOS. The placed fault's cavity fill
differs by a few rows between hosts:
- macOS arm64, custom PETSc 3.25.0;
- CI's Linux x86_64, conda-forge PETSc 3.25.3;
- both with gmsh 4.15.2.
On CI the np 2 count is 4772 too, so the partition does not change the
band there either: the test's single macOS baseline was the defect, not
the halo.

The test accepts exactly the recorded serial counts, one per host. #896's
error added 2110 rows. A new host records its serial count. Passes at np
1 and 2. The merged branch's FAC and fault suite passes: 66 serial, 26 at
np 2 (3 skipped). test_1088 (from #913) passes 12, with its LU case
xfailing (#899).

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings October 31, 2026 21:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants