chore: pull across macro ordering changes#10466
Merged
TomAFrench merged 7 commits intosync-noirfrom Dec 9, 2024
Merged
Conversation
Contributor
|
Seems like a simple reordering of annotations makes this work (waiting for CI). One thing that I found curious: #[event]
#[derive(Serialize)]
struct ContractInstanceDeployed {^^^ that fails, while this works: #[derive(Serialize)]
#[event]
struct ContractInstanceDeployed {Makes sense, since let any = fresh_type_variable();
let maybe_serialize_impl = typ.get_trait_impl(quote { protocol_types::traits::Serialize<$any> }.as_trait_constraint());
assert(maybe_serialize_impl.is_some(), "A nice error message to convey #[derive(Serialize)] must come before #[event]");And to my surprise, |
#10460) Skip computation of numerator and denominator of z_perm at indexes that are not part of the active ranges, and refine the threshold in commit_structured for `z_perm`. New benchmarks: **Now: 5.6 s difference** We still see a difference between committing to z_perm between an ambient trace of 2^19 and 2^20, caused by the fact that the active ranges complement are larger (i.e. the ranges in the trace blocks where z_perm is constant) because the blocks themselves are larger. We make sure to at least avoid computing and committing to z_perm after the final active wire index.
Member
Author
|
Ah excellent! Much easier than I feared. |
Member
Author
|
Hmm, I'm not entirely sure why there would be an impl in that case. @jfecher can you shed light here? |
Contributor
#[derive_via(derive_serialize)]
trait Serialize<let N: u32> {}
comptime fn derive_serialize(s: StructDefinition) -> Quoted {
let t = s.as_type();
quote[impl Serialize<0> for $t {}]
}
#[find_serialize]
#[derive(Serialize)]
struct Foo {}
comptime fn find_serialize(s: StructDefinition) {
let any = std::meta::typ::fresh_type_variable();
let serialize = quote { Serialize<$any> }.as_trait_constraint();
let serialize_impl = s.as_type().get_trait_impl(serialize);
assert(serialize_impl.is_some(), "#[derive(Serialize)] must come before #[find_serialize]");
}Errors as expected for me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR pulls across the changes from noir-lang/noir#6326 so we can see how it affects the aztec-nr macros.