Skip to content

fix(codegen): look at struct args (generics) when generating structs#9079

Closed
asterite wants to merge 5 commits intomasterfrom
ab/revert-codegen-generic-type-arguments
Closed

fix(codegen): look at struct args (generics) when generating structs#9079
asterite wants to merge 5 commits intomasterfrom
ab/revert-codegen-generic-type-arguments

Conversation

@asterite
Copy link
Collaborator

@asterite asterite commented Jul 1, 2025

Description

Problem

Resolves #9044

Summary

The fix in the previous PR was wrong. Nested structs were generated. It's just that at one point generic struct field types get replaced with bindings, and the bindings (possibly structs) end up in an args field. So what was missing is taking a look at args to find more structs to generate.

Additional Context

I added rm -rf ./test/test_lib/export to the test script because otherwise when you made changed to the Noir code some old code might remain there and error, and it can be a bit misleading.

Documentation

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation 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.

@socket-security
Copy link

socket-security bot commented Jul 1, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License

View full report

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 'Compilation Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 02ef0bd Previous: de2a1bd Ratio
rollup-root 1.7 s 1.37 s 1.24

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: 3052df2 Previous: de2a1bd Ratio
test_report_zkpassport_noir_rsa_ 2 s 1 s 2

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

CC: @TomAFrench

@asterite asterite mentioned this pull request Jul 1, 2025
5 tasks
@asterite
Copy link
Collaborator Author

asterite commented Jul 1, 2025

Even though this seems correct it ends up generating duplicated structs in some cases. I'm not going to work on this for now so I'll close this.

@asterite asterite closed this Jul 1, 2025
@asterite asterite deleted the ab/revert-codegen-generic-type-arguments branch July 1, 2025 17:32
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.

1 participant