Skip to content

Add regression and benchmark test coverage - #1

Open
visura96 wants to merge 6 commits into
openmsr:developfrom
visura96:phase1-review-tests
Open

Add regression and benchmark test coverage#1
visura96 wants to merge 6 commits into
openmsr:developfrom
visura96:phase1-review-tests

Conversation

@visura96

@visura96 visura96 commented Jun 6, 2026

Copy link
Copy Markdown

Summary

This pull request adds a regression and benchmark test suite developed during a code review. Review focused on identifying defecincies and improvments of the code.

The changes focus on reproducible testing of the existing point-kinetics, delayed-neutron, thermal-hydraulic, delayed transport, decay-heat, and MSRE benchmark behavior. The intent is to document and preserve current expected behavior while also adding targeted analytical and benchmark checks.

Main changes

  • Added a structured pytest suite under tests/testCases/.

  • Added point-kinetics tests covering:

    • basic behavior;
    • multiple precursor-group and reactivity contributions acting together;
    • delayed precursor transport;
    • circulating-fuel behavior;
    • smoke and API-contract checks.
  • Added thermal-hydraulic tests covering:

    • advective, convective, and internal heating terms;
    • compounded node behavior;
    • delayed source terms;
    • delayed loop behavior;
    • smoke and API-contract checks.
  • Added three-group decay-heat tests:

    • comparison of each group against the exact post-shutdown exponential solution;
    • comparison of the summed three-group curve against the ANS94 two-sigma, 100% U-235 reference through 6000 seconds using a 10% pointwise relative-error criterion.
  • Updated the MSRE benchmark tests to:

    • include the circulating-fuel reactivity offset rho_0 explicitly in the kinetics input;
    • verify that pre-insertion thermal feedback remains near equilibrium;
    • add representative core-temperature stability checks.
  • Added pytest.ini and shared pytest configuration.

  • Updated pyproject.toml dependencies required to install and run the package and test suite in a clean environment.

Test coverage

The added suite covers 153 tests across the following areas:

  • Point kinetics, including analytical one-group behavior, precursor dynamics, reactivity inputs, circulating-fuel effects, delayed transport, compounded terms, and smoke/API checks.
  • Thermal hydraulics, including advective, convective, and internal-heating terms, parameter sensitivity, multi-node configurations, delayed-source behavior, loop delays, and smoke/API checks.
  • Three-group decay heat, including exact post-shutdown exponential behavior and comparison against the ANS94 two-sigma, 100% U-235 reference through 6000 seconds.
  • MSRE benchmark regression at 1, 5, and 8 MW, including power-response comparison, the corrected rho_0 treatment, pre-insertion feedback checks, and representative temperature-stability checks.

Test result

The full test suite passes:

153 passed, 157 warnings in 41.93 s

Warnings

The test run still produces 157 warnings. These warnings do not cause test failures, but they should not be interpreted as fully resolved.

Most are associated with existing solver and model behavior exercised by the expanded test suite. The review identified the solver-wrapper warning related to non-monotonic or initial-time integration requests as the most technically significant item for follow-up. Other warnings are retained in the test output so they remain visible to future maintainers rather than being broadly suppressed.

Review notes

The analytical tests are intended to verify implementation behavior directly. The MSRE and ANS94 comparisons are benchmark or reduced-order validation checks and should not be interpreted as full independent validation of the library or the underlying reactor models.

The purpose, assumptions, and expected behavior of the individual tests are documented in the test-module, class, and function docstrings. More detailed external test documentation may be added in a future documentation update.

The exploratory notebooks were intentionally excluded from this pull request.

Comment thread tests/testCases/pke/test_pke_basic.py Outdated
"""Tests 5-6: rho=0 equilibrium and off-equilibrium IC behavior."""

def test_critical_steady_state_one_group(self):
"""Test 5: n and C stay constant at rho=0 with equilibrium precursors."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the numbering might be inconsistent throughout the test suite. Maybe we can just get rid of the numbering.

assert np.all(n.y_out[1:] < n0)
else:
assert np.all(n.y_out[1:] > n0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line

@LukeLabrie

Copy link
Copy Markdown
Collaborator

Hey @visura96, sorry for the delay. Everything looks good to me, just a couple of minor comments above. I also ran all the tests locally and they passed. There's just one commit from develop that needs to be synced in to this branch, but other than that I think we should be good to merge. Nice work.

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