From 6b2611dd03903aa20a19f9443c69df736be250a2 Mon Sep 17 00:00:00 2001 From: lmoresi Date: Tue, 13 Oct 2026 11:17:00 -0700 Subject: [PATCH] Find the checkpoint vector wherever the writer put it (test_1079) test_1079's `_checkpoint_fields` helper asserted the field's saved vector is at `uw_checkpoint/`. #756 moved the reload payload under /restart/petsc, where the same vector sits one group deeper as `.../dms//vecs//`, so the assertion fails on every current file and development has been red since #708 merged. Nothing was broken. By the time that line runs, both the write and the resume phases have already returned 0 and the saved metadata has already compared equal -- the restart works. The test is marked `xfail(strict=True, raises=SymbolicDiskContinuationMismatch)`, so only that one exception counts as the expected failure and an AssertionError from the layout check surfaces as a genuine failure, which is why a cosmetic relocation reads as a broken restart. The helper now accepts either spelling, so a file written by either version stays readable to the test. This is the same assumption that regressed #640 in the reader (fixed in #847): the payload is found by structure, not by one hard-coded path. Proven on one build: with the single-spelling assertion restored the test fails at line 34; with this change it reaches its intended strict xfail. Checkpoint and snapshot suite: 122 passed, 1 xfailed. How this reached development: #708 added this test and its CI was green, but that run predates #756 by a day. #708 then merged twelve hours after #756 without a re-run, so the layout change and the assertion never met in CI until afterwards. Underworld development team with AI support from Claude Code Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01E87Q7KrpapxeQiLD1RiNXv --- tests/test_1079_diffusion_disk_restart.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/test_1079_diffusion_disk_restart.py b/tests/test_1079_diffusion_disk_restart.py index 2bce0e560..aa2afb1e7 100644 --- a/tests/test_1079_diffusion_disk_restart.py +++ b/tests/test_1079_diffusion_disk_restart.py @@ -31,7 +31,19 @@ def _checkpoint_fields(wrapper): data.visititems(lambda key, obj: arrays.update({key: obj[()]}) if isinstance(obj, h5py.Dataset) else None) assert arrays, f"Missing checkpoint datasets for {name}" - assert f"uw_checkpoint/{name}" in arrays + # The field's saved vector, wherever the writer put it. It sat + # at uw_checkpoint/ until #756 moved the payload under + # /restart/petsc, where the same vector is one group deeper as + # .../dms//vecs//. Pinning one spelling made + # this test fail on a relocation that broke nothing -- both + # phases had already restarted and the metadata already + # compared equal by the time this line ran -- and it is the + # same assumption that regressed #640 in the reader (#847). + assert any( + key == f"uw_checkpoint/{name}" + or key.endswith(f"dms/{name}/vecs/{name}/{name}") + for key in arrays + ), sorted(arrays) fields[mesh_name, name] = arrays assert fields return fields