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

chore: Remove Value::Array in favor of Instruction::MakeArray #2494

Closed
wants to merge 37 commits into from

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Aug 30, 2023

Description

Problem*

Resolves #1733

Summary*

This PR is an experiment to see if removing Value::Array simplifies the code at all. Since it is the only Value that may contain other ValueIds, removing it means we no longer have to specially handle and recur on Value::Array when working on ValueIds.

So far though, preliminary results of this PR are that there are no large gains made from removing it.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

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

@jfecher
Copy link
Contributor Author

jfecher commented Aug 31, 2023

Closing this PR, I don't think it's a large code improvement

@jfecher
Copy link
Contributor Author

jfecher commented Sep 1, 2023

Reopening this, after some second thought I think this may still be valuable.

@jfecher jfecher reopened this Sep 1, 2023
@jfecher jfecher mentioned this pull request Sep 1, 2023
5 tasks
@jfecher jfecher marked this pull request as ready for review September 6, 2023 16:23
Comment on lines +1248 to +1251
let expected_opcodes = vec![
Opcode::Arithmetic(&Expression::one() - &Expression::from(Witness(1))),
Opcode::MemoryInit { block_id: BlockId(0), init: vec![Witness(1)] },
Opcode::Arithmetic(&Expression::one() - &Expression::from(Witness(2))),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm unsure why this memory init is needed now. Did we need it before as well? Neither array is used dynamically.

@jfecher
Copy link
Contributor Author

jfecher commented Sep 6, 2023

Still one last bug in brillig_nested_arrays:

error: Internal Consistency Evaluators Errors: 

                    This is likely a bug. Consider Opening an issue at https://github.com/noir-lang/noir/issues
  ┌─ std/lib.nr:1:1
  │
1 │ mod hash;
  │ - ICE: "Called AcirValue::into_var on an array"
  │

@jfecher
Copy link
Contributor Author

jfecher commented Dec 15, 2023

Closing this PR, there are too many confilcts to update it. I think the idea of a MakeArray instruction is still a good one and we should revisit this eventually.

@jfecher jfecher closed this Dec 15, 2023
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 MakeArray instruction to the ssa refactor
1 participant