Skip to content

fix: handle rng-seed values greater than 2^32-1#328

Open
asaites wants to merge 1 commit into
quil-lang:masterfrom
asaites:fix-rng-seed-handling
Open

fix: handle rng-seed values greater than 2^32-1#328
asaites wants to merge 1 commit into
quil-lang:masterfrom
asaites:fix-rng-seed-handling

Conversation

@asaites

@asaites asaites commented Nov 4, 2025

Copy link
Copy Markdown

Values larger than $2^{32}-1$ should be converted to a byte array before passing them onward to the seeded-random-state function.

Note to reviewers: I am not experienced with lisp, and so used generative AI to write the integer->ub32-vector function. My apologies if it is not a particularly idiomatic way to accomplish this in lisp, but in any case, the important aspect for the fix is that get-random-state converts larger values to an array (or rejects them).

Closes: #327

Values larger than 2^32-1 should be converted to a byte array
before passing them onward to the seeded-random-state function.

Closes: quil-lang#327
@stylewarning

Copy link
Copy Markdown
Member

Thanks for the patch. I'll try to have it reviewed by tomorrow.

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.

qvm-app server mishandles rng-seeds greater than $2^32-1$

2 participants