Tiling parity harness: assert the tiled run is tiled, give fextrema its own cache entry, stop appending its log - #3991
Merged
Conversation
…ts own cache entry, stop appending its log Follow-up to #3972, which added add_test_tiling_parity and Tests/RunTilingParity.cmake. Three problems in that harness, all of them about the test staying honest rather than about the PBL fix itself. The tiled/untiled comparison proves nothing unless the tiled run is in fact tiled. FabArrayBase::buildTileArray splits a direction into max(ncells/tilesize,1) tiles, so a box splits only once it is twice the tile size: with the 8-cell default a 16-cell box gives two tiles and a 15-cell box gives one. A later deck edit that narrows the boxes in y therefore leaves one tile per box, and every test keeps passing while comparing two identical untiled runs. Confirmed by running the MRF deck with amr.max_grid_size_y=8: the eight boxes give one tile each, and fcompare reports PLOTFILE AGREE with every norm exactly 0. count_xy_tiles() now reads the level-0 boxes out of Level_0/Cell_H, the way RunBoxParity.cmake's count_level0_boxes() does, and requires the tiled tile count to exceed the untiled one. Only x and y are counted: these schemes iterate under TileNoZ(), which pins the z tile size to the whole box, so counting z would let z-tiling alone satisfy the check after the y split that exposes the bug had gone away. FEXTREMA_EXE was derived from FCOMPARE_EXE with string(REPLACE "amrex_fcompare" "amrex_fextrema" ...). FCOMPARE_EXE is a user-facing cache entry, so configuring with a path that does not contain that literal made the substitution a no-op, FEXTREMA_EXE pointed at fcompare, and every test failed with "fextrema could not read <field>" -- which reads as a broken deck rather than a misconfigured tool path. Give fextrema its own cache entry beside fcompare instead, in both the internal and external AMReX branches, and report it in the test configuration summary. RunTilingParity.cmake also checks the path exists before running anything, since an EXISTS check at configure time would fire on every fresh build (the plotfile tools are not built yet). The fextrema logs were appended, never truncated, so on a repeated run in the same build directory the ATTACHED_FILES_ON_FAIL artifact mixed this run's ranges with earlier ones -- the one file a developer reads to decide whether a field really varied. Truncate it at the start of each run. ABL_MRF_Tiling, ABL_YSUNew_Tiling and ABL_YSU_Tiling pass, and MRF now reports "4 boxes on level 0, 8 x-y tiles with fabarray.mfiter_tile_size=1024000 8 8". Co-Authored-By: Claude Opus 5 (1M context) <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.
Summary
Follow-up to #3972, which added
add_test_tiling_parityandTests/RunTilingParity.cmake. Three problems in that harness. None of them affect the PBL fix; all of them are about the tests staying honest.The tiled run is not checked to be tiled
RunTilingParity.cmakecarefully rejects a comparison between two copies of a constant field (VARYING_3D/VARYING_2D), but nothing rejects a comparison between two effectively untiled runs.FabArrayBase::buildTileArraysplits a direction intomax(ncells/tilesize,1)tiles, so a box splits only once it is twice the tile size: with the 8-cell default a 16-cell box gives two tiles and a 15-cell box gives one. A later edit toTests/test_files/ABL_MRF_Tiling/ABL_MRF_Tiling.ithat narrows the boxes in y — a smalleramr.max_grid_size_y, a shorter domain — therefore leaves one tile per box, and all three tests keep passing while testing nothing.This is not hypothetical. Running the deck with
amr.max_grid_size_y=8gives eight boxes of one tile each, andfcompareon the two plotfiles reportsPLOTFILE AGREEwith every norm exactly0:count_xy_tiles()now reads the level-0 boxes out ofLevel_0/Cell_H, the wayRunBoxParity.cmake'scount_level0_boxes()does, and requires the tiled tile count to exceed the untiled one. The same narrowed deck is now refused:Only x and y are counted. These schemes iterate under
TileNoZ(), which pins the z tile size to the whole box, so counting z would let z-tiling alone satisfy the check after the y split that exposes the bug had quietly gone away.fextrema had no path of its own
FEXTREMA_EXEwas derived fromFCOMPARE_EXEwithstring(REPLACE "amrex_fcompare" "amrex_fextrema" ...).FCOMPARE_EXEis a user-facingCACHE STRING, so configuring with a path that does not contain that literal —-DFCOMPARE_EXE=/usr/local/bin/fcompare, say — made the substitution a no-op.FEXTREMA_EXEthen pointed at fcompare, which was run asfcompare -v Lturb untiled_plt00010, treated-vas a plotfile and aborted. All three tests failed withfextrema could not read Lturb from ..., which reads as a broken deck rather than a misconfigured tool path.fextrema now gets its own cache entry beside fcompare, in both the internal and external AMReX branches and for both WIN32 and not, so there is no derivation left to no-op. It is reported in the test configuration summary alongside fcompare:
RunTilingParity.cmakealso checks the path exists before running anything, so a wrong path fails immediately instead of after two simulations:An
EXISTScheck at configure time would not work:FCOMPARE_EXEpoints into${PROJECT_BINARY_DIR}/Submodules/AMReX/Tools/Plotfile/, which does not exist yet when CMake runs, so it would fire on every fresh build.The fextrema log was appended, never truncated
execute_process(OUTPUT_FILE ...)rewrites the run and fcompare logs, but the fextrema output was appended one field at a time. On a repeated run in the same build directory theATTACHED_FILES_ON_FAILartifact accumulated one block per invocation, mixing this run's ranges with earlier ones — and that is the one file a developer reads to decide whether a field really varied. It is truncated at the start of each run: 22 lines after one run ofABL_MRF_Tiling, still 22 after a second, where it used to be 44.Testing
GNU 13.3, Release,
ERF_ENABLE_MPI=ON, 2 ranks, on this branch.ABL_MRF_Tiling,ABL_YSUNew_Tiling,ABL_YSU_Tilingpass, and MRF now reportsRunTilingParity: 4 boxes on level 0, 8 x-y tiles with fabarray.mfiter_tile_size=1024000 8 8.ABL_MOST_WOA_ZSplit_NoSub_BoxParityandCloudChamber_SatAdj_Paritypass, so the sharedTests/CTestList.cmakestill works for the other parity harnesses.ctest -L regression: 108/108. No gold files change.count_xy_tiles()checked against a stored plotfile of 12 boxes of 16³: 24 tiles at tile size 8, and 12 at tile size 16 — reproducing the floor semantics where a box splits at 2× the tile size, not at 1×.Not changed here
#3972's registration guard isif(ERF_ENABLE_MPI AND NOT WIN32), so a serial build registers none of these tests even though the bug is pure CPU MFIter tiling. No CI job loses coverage — Windows is the only serial regression job and it is excluded byNOT WIN32anyway — so this is left alone rather than restructured toRunBoxParity.cmake's launcher-guard pattern.ApplyPBLHSmoothingis fixed in #3978. None of these tests seterf.enable_pblh_smoothing=true, so that path still has no parity coverage; the fourth registration belongs with that PR.🤖 Generated with Claude Code