Skip to content

Fix RNG segfaults when given size-0 input - #3389

Draft
WardBrian wants to merge 3 commits into
developfrom
fix/rng-size-zeros
Draft

Fix RNG segfaults when given size-0 input#3389
WardBrian wants to merge 3 commits into
developfrom
fix/rng-size-zeros

Conversation

@WardBrian

Copy link
Copy Markdown
Member

Summary

Closes #3388. I believe a lot of our RNGs behave poorly with size-0 inputs, so this PR adds some code to the vectorized rng test harness to test all of them that use that. My plan is then to fix each one that pops up before merging.

Tests

Updated rng test framework accordingly.

Side Effects

None

Release notes

RNGs now behave properly when given a size-0 input.

Checklist

  • Copyright holder: Simons Foundation

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

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.

normal_rng crashes when provided zero-length vector for mu and scalar for sigma

1 participant