Skip to content

test(starknet_os): add small fft regression test #4895

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

Merged

Conversation

dorimedini-starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@dorimedini-starkware dorimedini-starkware self-assigned this Mar 13, 2025
@dorimedini-starkware dorimedini-starkware marked this pull request as ready for review March 13, 2025 13:31
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from e9d56df to 78b09a5 Compare March 13, 2025 13:35
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from 709dfcd to ca43c91 Compare March 13, 2025 13:35
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from 78b09a5 to 5ba1035 Compare March 13, 2025 13:50
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from ca43c91 to 3a26702 Compare March 13, 2025 13:50
@aner-starkware
Copy link
Contributor

crates/starknet_os/src/hints/hint_implementation/kzg/test.rs line 29 at r1 (raw file):

    let generator = BigInt::from(3);
    let coeffs: Vec<BigInt> = [0, 1, 2, 3].into_iter().map(BigInt::from).collect();
    let expected_eval: Vec<BigInt> = (if bit_reversed { [6, 15, 9, 4] } else { [6, 9, 15, 4] })

Were these taken from somewhere, or did you compute them?

Code quote:

let expected_eval: Vec<BigInt> = (if bit_reversed { [6, 15, 9, 4] } else { [6, 9, 15, 4] })

Copy link
Contributor

@aner-starkware aner-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @amosStarkware, @dorimedini-starkware, and @nimrod-starkware)

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @amosStarkware, @aner-starkware, and @nimrod-starkware)


crates/starknet_os/src/hints/hint_implementation/kzg/test.rs line 29 at r1 (raw file):

Previously, aner-starkware wrote…

Were these taken from somewhere, or did you compute them?

I ran the code before PR 4896 to get the values, then used this test to find the bug in 4896. I assumed that if (a) the logic was copied from moonsong and (b) I didn't refactor yet, the values I get are correct.

Copy link
Contributor

@aner-starkware aner-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware and @nimrod-starkware)


crates/starknet_os/src/hints/hint_implementation/kzg/test.rs line 29 at r1 (raw file):

Previously, dorimedini-starkware wrote…

I ran the code before PR 4896 to get the values, then used this test to find the bug in 4896. I assumed that if (a) the logic was copied from moonsong and (b) I didn't refactor yet, the values I get are correct.

Maybe consider copying the naive computation from the test_fft instead? (Or even better, make it a fn and call it).
I can't say I'm a fan of magic numbers that come from nowhere, but unblocking.

@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from 5ba1035 to 0a037e7 Compare March 16, 2025 09:37
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from 3a26702 to 7ad00f3 Compare March 16, 2025 09:37
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from 0a037e7 to 6d3ce17 Compare March 16, 2025 09:56
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from 7ad00f3 to 0ef3174 Compare March 16, 2025 09:56
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from 6d3ce17 to b75afc4 Compare March 16, 2025 10:02
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from 0ef3174 to f8b646f Compare March 16, 2025 10:03
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from b75afc4 to 8eb8647 Compare March 16, 2025 14:09
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from f8b646f to ebb35c0 Compare March 16, 2025 14:09
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @amosStarkware, @aner-starkware, and @nimrod-starkware)


crates/starknet_os/src/hints/hint_implementation/kzg/test.rs line 29 at r1 (raw file):

Previously, aner-starkware wrote…

Maybe consider copying the naive computation from the test_fft instead? (Or even better, make it a fn and call it).
I can't say I'm a fan of magic numbers that come from nowhere, but unblocking.

the point of the small_fft_regression test is to not copy test_fft, as it generates huge input/output pairs that are unusable for debugging.
test_fft is still a good test for the change I made

@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from 8eb8647 to bc1a882 Compare March 16, 2025 16:17
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from ebb35c0 to 91d2ce9 Compare March 16, 2025 16:17
Copy link
Contributor

@aner-starkware aner-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware and @nimrod-starkware)

@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from bc1a882 to 5e305dd Compare March 17, 2025 08:21
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from 91d2ce9 to 253eb33 Compare March 17, 2025 08:21
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from 5e305dd to e7ab684 Compare March 17, 2025 15:24
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from 253eb33 to cc37a9d Compare March 17, 2025 15:24
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from e7ab684 to 2184e84 Compare March 17, 2025 18:00
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from cc37a9d to 1303cb3 Compare March 17, 2025 18:00
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from 2184e84 to ac22bc5 Compare March 18, 2025 13:19
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from 1303cb3 to 0ebecdd Compare March 18, 2025 13:19
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_implement_hint_store_da_segment branch from ac22bc5 to b7449ea Compare March 18, 2025 16:29
@dorimedini-starkware dorimedini-starkware force-pushed the 03-13-test_starknet_os_add_small_fft_regression_test branch from 0ebecdd to 8d7cdbf Compare March 18, 2025 16:29
@dorimedini-starkware dorimedini-starkware changed the base branch from 03-12-feat_starknet_os_implement_hint_store_da_segment to main March 18, 2025 20:50
@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue Mar 18, 2025
Merged via the queue into main with commit 27ff6da Mar 18, 2025
16 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants