Skip to content

Conversation

@guipublic
Copy link
Contributor

Description

Problem

Resolves #10540

Summary

Additional Context

User Documentation

Check one:

  • No user documentation needed.
  • Changes in docs/ included in this PR.
  • [For Experimental Features] Changes in docs/ to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'ACVM Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 31ae5a1 Previous: 84f4b3a Ratio
perfectly_parallel_batch_inversion_opcodes 2794536 ns/iter (± 18304) 2268790 ns/iter (± 6112) 1.23

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 2f059c0 Previous: f00ead9 Ratio
test_report_zkpassport_noir-ecdsa_ 3 s 1 s 3

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 65cc774 Previous: c695737 Ratio
sha512-100-bytes 0.07 s 0.056 s 1.25

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Comment on lines +63 to +67
for existing in &self.direct {
// Check if two types overlap, by instantiating both types (replacing NamedGenerics
// with fresh TypeVariables) and then checking if they can unify.
let instantiate_existing = Self::instantiate_named_generics(&existing.typ, interner);
let instantiate_typ = Self::instantiate_named_generics(typ, interner);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for existing in &self.direct {
// Check if two types overlap, by instantiating both types (replacing NamedGenerics
// with fresh TypeVariables) and then checking if they can unify.
let instantiate_existing = Self::instantiate_named_generics(&existing.typ, interner);
let instantiate_typ = Self::instantiate_named_generics(typ, interner);
if self.direct.is_empty() {
return None;
}
let instantiate_typ = Self::instantiate_named_generics(typ, interner);
for existing in &self.direct {
// Check if two types overlap, by instantiating both types (replacing NamedGenerics
// with fresh TypeVariables) and then checking if they can unify.
let instantiate_existing = Self::instantiate_named_generics(&existing.typ, interner);

Comment on lines +107 to +108
if !seen.contains(&id) {
seen.insert(id);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if !seen.contains(&id) {
seen.insert(id);
if !seen.insert(id) {

| Type::Unit
| Type::Quoted(..)
| Type::Error
| Type::TypeVariable(..)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I have seen a TypeVariable be bound to a NamedGeneric

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't explain it, but the example was here: #11385 (comment)

})
.collect();

typ.substitute(&substitutions)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my understanding: substitute does not actually bind type variables in the typ, it replaces the types that have them (TypeVariable and NamedGeneric) with the substitutions, so NamedGeneric itself is unchanged, right?

If that's right, the docs of substitute could be made clearer.

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.

Overlapping impls are not detected by the compiler

3 participants