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

Construct isogeny map using new function #529

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

drskalman
Copy link
Contributor

Description

This PR is trying to open discussion around issue #525 and hopefully closes it.

closes: #525

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • [x ] Targeted PR against correct branch (master)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

@drskalman drskalman requested review from a team as code owners November 30, 2022 17:52
@drskalman drskalman requested review from Pratyush, mmagician and weikengchen and removed request for a team November 30, 2022 17:52
@drskalman
Copy link
Contributor Author

@lamafab has done some tests and thinks this might be a rust bug. Quoting them here:

this works

trait Trait {
    type AssocType;
}

struct Test<
    A: Trait,
    B: Trait<AssocType = A>,
> {
    some: B,
} 

this does NOT:

trait Trait {
    type AssocType;
}

struct Test<
    A: Trait,
    // HERE:
    B: Trait<AssocType = A::AssocType>,
    // Or:
    // B: Trait<AssocType = <A as Trait>::AssocType>,
> {
    some: B,
} 

I'm really not sure if this is expected behavior or a bug? 🤔

@drskalman drskalman changed the title Skalman make isogeny map with new Construct isogeny map using new function Nov 30, 2022
@drskalman drskalman marked this pull request as draft November 30, 2022 18:04
Comment on lines 62 to 75
pub const fn new(
x_map_numerator: &'a [BaseField<CODOMAIN>],
x_map_denominator: &'a [BaseField<CODOMAIN>],
y_map_numerator: &'a [BaseField<CODOMAIN>],
y_map_denominator: &'a [BaseField<CODOMAIN>],
) -> Self {
Self {
x_map_numerator,
x_map_denominator,
y_map_numerator,
y_map_denominator,
_phantom_domain: PhantomData::<DOMAIN>,
}
}
Copy link
Member

Choose a reason for hiding this comment

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

We can also limit this to 'static lifetimes. That might help with the "temporary dropped while borrowed" issue.

Copy link
Contributor Author

@drskalman drskalman Dec 1, 2022

Choose a reason for hiding this comment

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

do you mean to hard code static life time? I think I did that and the error still persists.

Copy link
Member

Choose a reason for hiding this comment

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

I tried it too, couldn't find a way around it...

@Pratyush
Copy link
Member

Pratyush commented Dec 9, 2022

I think this is a Rust bug. What seems to be the equivalent code does compile: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=51633acd5ecaf330b62a44216c1b7e41

@drskalman do you want to file a bug against rust-lang/rust?

@drskalman
Copy link
Contributor Author

@drskalman do you want to file a bug against rust-lang/rust?

Sure, I'll do it but I need find a minimal example that it doesn't work beside arkworks :-) I'll try.

@Pratyush
Copy link
Member

I think you can just make an issue linking the playground and your branch. Re: minimization tips, the main differences that come to mind are

  • we're using macros in the constant
  • we're doing some relatively heavy computation at compile time, which might be exhausting the const execution time limit.

@mmagician
Copy link
Member

@drskalman Have you filed a bug report in the end?

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.

Add constructor for IsogenyMap
3 participants