Skip to content

feature: speed up unit tests - #4113

Open
victorapm wants to merge 4 commits into
developfrom
feature/paludettomag1/faster-tests
Open

feature: speed up unit tests#4113
victorapm wants to merge 4 commits into
developfrom
feature/paludettomag1/faster-tests

Conversation

@victorapm

@victorapm victorapm commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This PR reduces setup, allocation, launch, and repeated numerical-derivative overhead in the slow unit tests while preserving the existing test cases and assertions.

Main changes:

  • Disable per-allocation memory-log callbacks only for the testCRSMatrix target.
  • Batch the Drucker–Prager and Modified Cam Clay load-step work.
  • Batch fluid numerical-derivative evaluations so model setup is reused.
  • Reuse inverse-capillary-pressure fixture setup across all 246 parameterized cases.
  • Keep the optimized tests buildable and runnable in both CPU-only and CUDA configurations.

The “before” values are from the original test run. The “after” values are sequential wall-clock measurements from the CPU-only RelWithDebInfo build (clang++-23, ENABLE_CUDA=OFF, RAJA_ENABLE_CUDA=OFF).

Test Before After Improvement
testInverseCapillaryPressure 40.11 s 0.07 s 573x faster, 99.8% less time
testModifiedCamClay 225.40 s <0.01 s >22,540x faster, >99.99% less time
testMultiFluidBlackOil 15.82 s 0.07 s 226x faster, 99.6% less time
testMultiFluidCO2Brine 79.88 s 2.84 s 28.1x faster, 96.4% less time
testMultiFluidThreePhaseCompositionalMultiphase 44.89 s 0.11 s 408x faster, 99.8% less time
testMultiFluidTwoPhaseCompositionalMultiphase 115.92 s 0.22 s 527x faster, 99.8% less time

Additional CPU-only timings: testCRSMatrix 0.02 s, testDruckerPrager 0.01 s, and testMultiFluidDeadOil 0.07 s.

  • CPU-only build: 534/534 targeted tests passed; the slowest targeted test took 2.84 s.
  • CUDA build: 573/573 targeted tests passed, including the host/device variants.
  • Tests were run sequentially because several fluid tests write shared CSV filenames.

Depends on GEOS-DEV/LvArray#355

@victorapm victorapm self-assigned this Aug 10, 2026
@victorapm victorapm added the ci: run CUDA builds Allows to triggers (costly) CUDA jobs label Aug 10, 2026
@victorapm victorapm added flag: no rebaseline Does not require rebaseline ci: run code coverage enables running of the code coverage CI jobs labels Aug 10, 2026
@jhuang2601 jhuang2601 added the ci: run integrated tests Allows to run the integrated tests in GEOS CI label Aug 11, 2026
The faster-tests branch had pinned an unmerged LvArray commit, which failed the submodule sync check. The unused git diff against origin/develop also failed in shallow CI checkouts.
@victorapm
victorapm requested a review from bd713 as a code owner August 13, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: run code coverage enables running of the code coverage CI jobs ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: no rebaseline Does not require rebaseline flag: ready for review flag: requires updated submodule(s)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants