Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Implement sys_rand #1294

Merged
merged 8 commits into from
Jan 26, 2025
Merged

[feat] Implement sys_rand #1294

merged 8 commits into from
Jan 26, 2025

Conversation

Golovanov399
Copy link
Contributor

This resolves INT-2955.

sys_rand now:

  • calls a new phantom instruction that adds a hint stream with some random numbers,
  • then reads this many numbers from this hint stream to the required memory location.

The integration test is a simple one and just shows that the hashmap works somehow (it didn't use to because of "sys_rand unimplemented", but maybe we could also check the statistical randomness of our calls somehow.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

@jonathanpwang jonathanpwang left a comment

Choose a reason for hiding this comment

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

Move integration test to rv32im/test.

Currently the phantom instruction is wrong: it needs to read len from memory address space 1.

Update ISA doc: it's easier to make a PR into #1291

This comment has been minimized.

This comment has been minimized.

Copy link

group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair (+31 [+1.4%]) 2,193 513,772 19,376,241 - - -
fibonacci_program (+170 [+3.3%]) 5,265 1,500,095 51,485,080 - - -
regex_program (+46 [+0.3%]) 15,059 4,139,840 163,831,459 - - -
ecrecover_program (-11 [-0.4%]) 2,542 284,567 15,055,843 - - -

Commit: a5c71aa

Benchmark Workflow

Copy link
Contributor

@jonathanpwang jonathanpwang left a comment

Choose a reason for hiding this comment

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

LGTM

@Golovanov399 Golovanov399 merged commit 0a77e95 into main Jan 26, 2025
15 of 16 checks passed
@Golovanov399 Golovanov399 deleted the feat/phantom-sys-rand branch January 26, 2025 18:54
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