Skip to content

Add PUSH_RAND and SET_SEED directive into FpySequencer#5062

Draft
Nickg02 wants to merge 7 commits intonasa:develfrom
Nickg02:add-rng-directive-fprime
Draft

Add PUSH_RAND and SET_SEED directive into FpySequencer#5062
Nickg02 wants to merge 7 commits intonasa:develfrom
Nickg02:add-rng-directive-fprime

Conversation

@Nickg02
Copy link
Copy Markdown

@Nickg02 Nickg02 commented Apr 25, 2026

Related Issue(s)
Has Unit Tests (y/n) y
Documentation Included (y/n) y
Generative AI was used in this contribution (y/n) y

Change Description

In this PR two directives have been added to the FpySequencer, SET_SEED and PUSH_RAND.

This was previously PR #5002

Rationale

There has been interest in having ways to generate random numbers in fpy scripts.

Testing/Review Recommendations

Can run integration test suite through fpy by running the pytest suite connected to the gds.

There are fprime-util unit tests for deserialization and for testing sequencer behavior.

Future Work

Future work that could add onto this could be to:

  • Implement cryptographically secure random number generation
  • Add in fpy language native features to generate multiple random numbers at once

AI Usage (see policy)

Codex with ChatGPT 5.4 and 5.5 was used for code generation and for debugging assistance.

// otherwise, since construction
U64 m_statementsDispatched;

// per-component RNG state used by PUSH_RAND and later SET_SEED-style directives
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.

put these in Runtime struct

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