Skip to content

BUG: seed parachute pressure noise with per-instance RNG (#1091) - #1134

Merged
Gui-FernandesBR merged 1 commit into
RocketPy-Team:developfrom
thatrandomasiandev:bug/1091-parachute-noise-seed
Aug 14, 2026
Merged

BUG: seed parachute pressure noise with per-instance RNG (#1091)#1134
Gui-FernandesBR merged 1 commit into
RocketPy-Team:developfrom
thatrandomasiandev:bug/1091-parachute-noise-seed

Conversation

@thatrandomasiandev

Copy link
Copy Markdown

Summary

  • Give Parachute an optional seed and a per-instance numpy.random.Generator so pressure noise no longer draws from the process-global RNG (Fixes #1091).
  • Thread a derived noise seed from StochasticParachute into created parachutes when Monte Carlo seeds the model.
  • Add unit tests for same-seed reproducibility, different-seed divergence, default unseeded behavior, and independence from the global NumPy RNG.

Test plan

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONPATH=. pytest tests/unit/rocket/test_parachute_noise_seed.py tests/unit/rocket/test_parachute.py tests/unit/stochastic/test_stochastic_parachute.py
  • Spot-check that two Monte Carlo runs with the same root seed produce identical parachute noise sequences when noise is non-zero

@thatrandomasiandev
thatrandomasiandev requested a review from a team as a code owner August 11, 2026 01:56
@Gui-FernandesBR Gui-FernandesBR linked an issue Aug 12, 2026 that may be closed by this pull request
@Gui-FernandesBR
Gui-FernandesBR force-pushed the bug/1091-parachute-noise-seed branch from e43b8a8 to 36f9d6b Compare August 12, 2026 22:40
@Gui-FernandesBR
Gui-FernandesBR force-pushed the bug/1091-parachute-noise-seed branch from 36f9d6b to 469b750 Compare August 14, 2026 00:11
@Gui-FernandesBR
Gui-FernandesBR merged commit cb6106a into RocketPy-Team:develop Aug 14, 2026
8 checks passed
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.29%. Comparing base (e0ff281) to head (469b750).
⚠️ Report is 53 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1134      +/-   ##
===========================================
+ Coverage    82.18%   83.29%   +1.11%     
===========================================
  Files          122      130       +8     
  Lines        16355    17080     +725     
===========================================
+ Hits         13441    14227     +786     
+ Misses        2914     2853      -61     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

thc1006 added a commit to thc1006/RocketPy that referenced this pull request Aug 16, 2026
StochasticParachute.create_object derives the pressure noise seed after the
draw, and RocketPy-Team#1134 relied on last_rnd_dict being the same dictionary to carry it
into the record. Snapshotting the draw broke that link: the parachute is still
built with the seed, but the record loses it, so the Monte Carlo inputs stop
describing the parachute that flew.

    develop   recorded 37773913418288439290323614982376424810
    before    recorded <absent>

The source scan missed it because it only read dict_generator overrides. It
reads create_object too now, and tracks the names a method binds from a draw
rather than guessing at a variable name, so a local a method fills in for its
own use is not mistaken for a record.

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
thc1006 added a commit to thc1006/RocketPy that referenced this pull request Aug 25, 2026
StochasticParachute.create_object derives the pressure noise seed after the
draw, and RocketPy-Team#1134 relied on last_rnd_dict being the same dictionary to carry it
into the record. Snapshotting the draw broke that link: the parachute is still
built with the seed, but the record loses it, so the Monte Carlo inputs stop
describing the parachute that flew.

    develop   recorded 37773913418288439290323614982376424810
    before    recorded <absent>

The source scan missed it because it only read dict_generator overrides. It
reads create_object too now, and tracks the names a method binds from a draw
rather than guessing at a variable name, so a local a method fills in for its
own use is not mistaken for a record.

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
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.

Parachute pressure noise is outside the Monte Carlo seed tree

2 participants