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] ReleaseDomain API #465

Merged
merged 10 commits into from
Apr 9, 2024
Merged

[FEAT] ReleaseDomain API #465

merged 10 commits into from
Apr 9, 2024

Conversation

LeonHibnik
Copy link
Contributor

Describe the changes

This PR adds a NTT ReleaseDomain API in Golang and Rust

Linked Issues

Resolves #

where
<F as FieldImpl>::Config: NTT<F>,
{
// let ctx = DeviceContext::default_for_device(device_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

commented code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

@@ -201,6 +201,11 @@ func TestNttBatch(t *testing.T) {
}
}

func TestReleaseDomain(t *testing.T) {
cfg := GetDefaultNttConfig()
ReleaseDomain(cfg.Ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that ideally the test should release an allocated domain, call NTT and assert the error. Having said that I am not sure this can be achieved in go since the exception cannot be caught here I guess.
My issue with this test is that it passes even if ReleaseDomain() is doing nothing or behaves wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that ideally the test should release an allocated domain, call NTT and assert the error.

It should be possible to assert.Panics(Ntt()) after releasing the domain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Collaborator

@yshekel yshekel left a comment

Choose a reason for hiding this comment

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

I just had a comment about how ReleaseDomain is tested. I guess you already know that so I think it's up to you to decide what to do.

@@ -27,6 +30,13 @@ where
}
}

pub fn rel_domain<F: FieldImpl>(ctx: &DeviceContext)
Copy link
Collaborator

Choose a reason for hiding this comment

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

if this is the exposed API I would rename to release_domain

Copy link
Collaborator

Choose a reason for hiding this comment

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

Its a test function so I think the naming is fine but it doesn't need to be public since it is only being used in https://github.com/ingonyama-zk/icicle/pull/465/files#diff-96ad6a0ca42317faaf6524296cdaa92fcc3c634d36e2882c2b322d9b7287fd84R378

Copy link
Collaborator

@jeremyfelder jeremyfelder left a comment

Choose a reason for hiding this comment

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

The tests for golang are not deterministic in run order. The ReleaseDomain test should be made into a teardown test to ensure it runs after all other tests that require it

@LeonHibnik LeonHibnik requested a review from jeremyfelder April 9, 2024 08:23
Copy link
Collaborator

@jeremyfelder jeremyfelder left a comment

Choose a reason for hiding this comment

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

Looks good

@LeonHibnik LeonHibnik merged commit a7b0dc4 into main Apr 9, 2024
21 checks passed
@LeonHibnik LeonHibnik deleted the feat/ntt-releasedomain branch April 9, 2024 09:58
LeonHibnik added a commit that referenced this pull request Apr 9, 2024
## Describe the changes

This PR adds a NTT ReleaseDomain API in Golang and Rust

## Linked Issues

Resolves #

---------

Co-authored-by: Yuval Shekel <[email protected]>
yshekel added a commit that referenced this pull request May 19, 2024
## Describe the changes

This PR adds a NTT ReleaseDomain API in Golang and Rust

## Linked Issues

Resolves #

---------

Co-authored-by: Yuval Shekel <[email protected]>
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.

4 participants