Repository navigation
test_1152: a failed assertion says how the solves ended and what the move left - #1096
Conversation
…move left The zone case failed once in a parallel run and the message held only the numbers compared. Each assertion now carries, for the solve with the patch kept and the one registered again: the solve's reason, the outer KSP's reason, the first and last residual norms; and beside them the velocity iteration counts and the lowest cell quality after the move. No assertion or bound is changed. Underworld development team with AI support from Claude Code
…rs under it The first red CI run that carried the record had it cut by pytest's truncation of the assertion message, and the linear solvers' reasons were the part cut. A move that fails a bound now prints its record before the assert, past the capture, one key a line: the errors, the mesh quality, how each SNES ended, and one line for the outer KSP and each solver under it (the fieldsplit's velocity and pressure solves, every multigrid level, the FAC smoother's SOR and ASM and the ASM's blocks) with its reason, its iteration count, its preconditioner's failed reason and the norm of its operator. The lines of the ranks are set side by side where they differ. That separates the three readings of a linear solve that fails at its first step on a healthy mesh: a factorisation that failed (DIVERGED_PC_FAILED, a zero pivot on one block, SUBPC_ERROR above it), a NaN in the operator (a NaN norm), and a sub-solve that diverged by itself (its own reason, no failed preconditioner). The iteration counts in the comments were stale. Measured on development f8c6014 at np 1: kept and fresh 8 and 7 on the zone, 17 and 16 to 17 on the split level; with no patch 10 to 13 and 17 to 19. The bound is unchanged. Underworld development team with AI support from Claude Code
The record took each operator's norm with Mat.norm, which is collective, in a walk of the solver tree that a rank leaves early where its preconditioner never set up. Ranks would then make different numbers of collective calls and hang. Each rank now reads its own rows of an operator (the sum of squares and the count of entries that are not finite), the ranks' lines are matched by key after one allgather, and the norm and the count are added up there. A line a rank does not hold is said to be absent on that many ranks. Underworld development team with AI support from Claude Code
…dist The record of a failed move was printed past pytest's capture only. CI runs this file serially under pytest-xdist, whose workers' own output does not reach the controller, so the red run on df4bd01 showed the truncated assertion and none of the record. It is now printed into the capture as well, where pytest reports it under "Captured stdout call", and past it as before for the runs under mpirun. Checked with the failure forced in a copy of the test, under `-n 1 --dist loadfile`: the whole record is in the report. Underworld development team with AI support from Claude Code
PR #1096 at 149bd53, test_1152 failure record (H1, hyperion, 2026-11-12)Verdict: READY at 149bd53. Setup: library build development f8c6014 (wt-devf8c), with the test file from 149bd53 (a test-only change). A read-only plugin (plug/rec1096.py) wrote each move's record per rank and compared it across ranks with an allgather.
Velocity iterations, kept/fresh, by move:
Wall time: np 1 536 s, np 2 356 s, np 4 266 s. Underworld development team with AI support from Claude Code |
PR #1096 at df4bd01: the failure record at np 2The record prints only when a move fails. To reach it, I forced the failure path with a read-only plugin that adds 100 to the kept solve's reported velocity iterations; the solver itself was untouched. I ran
Log: Underworld development team with AI support from Claude Code |
tests/parallel/test_1152_fac_zone_survives_a_mover_parallel.py[zone]failed once in a parallel run and has passed since. The assertion message held only the numbers it compared, so the red run could not be explained afterwards.Each assertion in the test now carries a record of the move it failed on:
solver.solve_report, and from the rotated solve's record on the split level);mesh.quality()["q_min"]).No assertion or bound is changed, and no library code.
What the record reads on a passing serial run (macOS), first two moves:
The test's bound is "kept takes at most one velocity iteration more than fresh". On this host the zone case sits on that bound at both moves, so one more iteration on the kept side is a failure. These counts were taken on a build of the #1091 branch (PR #1094), which changes nothing a serial solve reads; they have not been taken on a build of development itself. The test file's comment gives 6 and 6, and 13 and 13, at np 1.
Serial: 2 passed in 134 s. Not run in parallel here.
Review, by the author (a test-only change; no second reviewer was used): every value in the record is the same on all ranks (
q_minis reduced over ranks inmesh.quality, the reasons and norms come from collective solver state), so the assertion message does not differ between ranks;mesh.quality()reads coordinates only and is called between the two solves' set-ups, not inside one; the record is built whether or not an assertion fails, so a pass exercises the code that a failure would print. No open issue is in this change's territory.Underworld development team with AI support from Claude Code