Skip to content

[CMake 5/7] Make unit tests safe for grouped execution - #3505

Open
SteveBronder wants to merge 1 commit into
cmake-split/04-probability-testsfrom
cmake-split/05-unit-tests
Open

SteveBronder wants to merge 1 commit into
cmake-split/04-probability-testsfrom
cmake-split/05-unit-tests

Conversation

@SteveBronder

@SteveBronder SteveBronder commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Grouped unit executables expose duplicate helper definitions, conflicting MPI registrations, and autodiff state left behind by earlier tests. Inline shared helpers, give MPI fixtures and call IDs distinct names, and use the autodiff cleanup fixture for the affected OpenCL tests. Guarantee that the Bernoulli GLM invalid-label fixture contains an invalid label.

Part 5 of the CMake migration split from #3463.

Targets cmake-split/04-probability-tests (#3504) as the preceding layer of the native stack. The review contains only this layer's prepared patch and its supporting tests.

Tests

  • Reproduced shared-helper duplicate definitions; fixed helpers link and execute across translation units.
  • Independent Make Bernoulli GLM suite passes all 24 tests.
  • The combined stack passes seven grouped MPI tests with two local ranks.
  • OpenCL autodiff cleanup runtime coverage remains for GPU CI.

Side Effects

Test fixtures, registration IDs, and cleanup behavior change. Production Math code is unaffected.

Release notes

Make unit tests safe to link and execute in shared test processes.

Checklist

  • Copyright holder: Simons Foundation
  • The complete basic-test and CI matrix is passing
  • C++ idioms and Doxygen documentation have completed review
  • Focused validation is passing as described above; remaining coverage is listed

Related PRs

Native stack: https://github.com/stan-dev/math/stack/3509

WardBrian
WardBrian previously approved these changes Nov 3, 2026
@SteveBronder
SteveBronder enabled stacked auto-merge November 4, 2026 16:15
@SteveBronder
SteveBronder disabled stacked auto-merge November 4, 2026 16:44
@SteveBronder
SteveBronder removed this pull request from stack #3507 November 4, 2026 16:44
@SteveBronder
SteveBronder added this pull request to stack #3509 November 4, 2026 16:44
@SteveBronder SteveBronder changed the title [CMake 5/6] Make unit tests safe for grouped execution [CMake 5/7] Make unit tests safe for grouped execution Nov 4, 2026
@SteveBronder
SteveBronder force-pushed the cmake-split/05-unit-tests branch from 50272f8 to 9dd379e Compare November 5, 2026 14:39
@WardBrian
WardBrian force-pushed the cmake-split/05-unit-tests branch from 9dd379e to 1077b99 Compare November 6, 2026 10:47
Inline shared test helpers, distinguish MPI call IDs and fixtures, and
clean up autodiff state between grouped OpenCL tests. Guarantee the
Bernoulli GLM invalid-label fixture contains an invalid label.
@WardBrian
WardBrian force-pushed the cmake-split/05-unit-tests branch from 1077b99 to 09896e8 Compare November 6, 2026 20:06

This branch has not been deployed

No deployments
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