Skip to content

Commit

Permalink
Merge branch 'master' into mocked-backend
Browse files Browse the repository at this point in the history
* master:
  fix(aztec): fix compilation of `aztec_library.rs` (#2567)
  feat(ssa): Replace values which have previously been constrained with simplified value (#2483)
  fix: Black box func slice handling (#2562)
  chore: Temporarily disable `noir_wasm` test (#2566)
  fix: Make def collector ordering more deterministic (#2515)
  chore: refactor `constant_folding` pass (#2533)
  chore: Cleanup mem2reg pass (#2531)
  chore: Replace hashers of hashmaps in dfg with fxhashes (#2490)
  chore: remove duplicate span from FunctionReturnType (#2546)
  • Loading branch information
TomAFrench committed Sep 5, 2023
2 parents 5aa6ce8 + a8d0328 commit af6c92d
Show file tree
Hide file tree
Showing 67 changed files with 899 additions and 633 deletions.
84 changes: 42 additions & 42 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,45 +113,45 @@ jobs:
path: ${{ env.UPLOAD_PATH }}
retention-days: 3

test:
needs: [build-wasm, build-nargo]
name: Test noir_wasm
runs-on: ubuntu-latest
steps:
- name: Checkout noir-lang/noir
uses: actions/checkout@v4

- name: Download wasm package artifact
uses: actions/download-artifact@v3
with:
name: noir_wasm
path: ./crates/wasm/result

- name: Download nargo binary
uses: actions/download-artifact@v3
with:
name: nargo
path: ./nargo

- name: Compile test program with Nargo CLI
working-directory: ./crates/wasm/noir-script
run: |
nargo_binary=${{ github.workspace }}/nargo/nargo
chmod +x $nargo_binary
$nargo_binary compile
- name: Install dependencies
working-directory: ./crates/wasm
run: yarn install

- name: Install playwright deps
working-directory: ./crates/wasm
run: |
npx playwright install
npx playwright install-deps
- name: Run tests
working-directory: ./crates/wasm
run: |
yarn test:browser
yarn test:node
# test:
# needs: [build-wasm, build-nargo]
# name: Test noir_wasm
# runs-on: ubuntu-latest
# steps:
# - name: Checkout noir-lang/noir
# uses: actions/checkout@v4

# - name: Download wasm package artifact
# uses: actions/download-artifact@v3
# with:
# name: noir_wasm
# path: ./crates/wasm/result

# - name: Download nargo binary
# uses: actions/download-artifact@v3
# with:
# name: nargo
# path: ./nargo

# - name: Compile test program with Nargo CLI
# working-directory: ./crates/wasm/noir-script
# run: |
# nargo_binary=${{ github.workspace }}/nargo/nargo
# chmod +x $nargo_binary
# $nargo_binary compile

# - name: Install dependencies
# working-directory: ./crates/wasm
# run: yarn install

# - name: Install playwright deps
# working-directory: ./crates/wasm
# run: |
# npx playwright install
# npx playwright install-deps

# - name: Run tests
# working-directory: ./crates/wasm
# run: |
# yarn test:browser
# yarn test:node
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified crates/nargo_cli/tests/acir_artifacts/6_array/target/acir.gz
Binary file not shown.
Binary file modified crates/nargo_cli/tests/acir_artifacts/6_array/target/witness.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified crates/nargo_cli/tests/acir_artifacts/schnorr/target/acir.gz
Binary file not shown.
Binary file modified crates/nargo_cli/tests/acir_artifacts/schnorr/target/witness.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified crates/nargo_cli/tests/acir_artifacts/tuples/target/acir.gz
Binary file not shown.
Binary file modified crates/nargo_cli/tests/acir_artifacts/tuples/target/witness.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,22 @@ fn main(
input_aggregation_object : [Field; 16],
proof_b : [Field; 94],
) -> pub [Field; 16] {

let verification_key : [Field] = verification_key;
let proof : [Field] = proof;
let proof_b : [Field] = proof_b;
let public_inputs : [Field] = public_inputs;


let output_aggregation_object_a = std::verify_proof(
verification_key,
proof,
public_inputs,
key_hash,
verification_key.as_slice(),
proof.as_slice(),
public_inputs.as_slice(),
key_hash,
input_aggregation_object
);

let output_aggregation_object = std::verify_proof(
verification_key,
proof_b,
public_inputs,
verification_key.as_slice(),
proof_b.as_slice(),
public_inputs.as_slice(),
key_hash,
output_aggregation_object_a
);

let mut output = [0; 16];
for i in 0..16 {
output[i] = output_aggregation_object[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ type Foo<T> = [T; 2];

type Bar = Field;

type Three = Two<u8>;
type Two<A> = One<A, u32>;
type One<A, B> = (A, B);
type Two<A> = One<A, u32>;
type Three = Two<u8>;

struct MyStruct {
foo: Bar,
Expand Down
1 change: 1 addition & 0 deletions crates/noirc_evaluator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ noirc_frontend.workspace = true
noirc_errors.workspace = true
noirc_abi.workspace = true
acvm.workspace = true
fxhash = "0.2.1"
iter-extended.workspace = true
thiserror.workspace = true
num-bigint = "0.4"
Expand Down
13 changes: 6 additions & 7 deletions crates/noirc_evaluator/src/brillig/brillig_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ pub(crate) mod brillig_directive;
pub(crate) mod brillig_fn;
pub(crate) mod brillig_slice_ops;

use crate::ssa::ir::{function::Function, post_order::PostOrder};

use std::collections::HashMap;

use self::{brillig_block::BrilligBlock, brillig_fn::FunctionContext};

use super::brillig_ir::{artifact::BrilligArtifact, BrilligContext};
use crate::ssa::ir::{function::Function, post_order::PostOrder};
use fxhash::FxHashMap as HashMap;

Check warning on line 10 in crates/noirc_evaluator/src/brillig/brillig_gen.rs

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (fxhash)

/// Converting an SSA function into Brillig bytecode.
pub(crate) fn convert_ssa_function(func: &Function, enable_debug_trace: bool) -> BrilligArtifact {
let mut reverse_post_order = Vec::new();
reverse_post_order.extend_from_slice(PostOrder::with_function(func).as_slice());
reverse_post_order.reverse();

let mut function_context =
FunctionContext { function_id: func.id(), ssa_value_to_brillig_variable: HashMap::new() };
let mut function_context = FunctionContext {
function_id: func.id(),
ssa_value_to_brillig_variable: HashMap::default(),
};

let mut brillig_context = BrilligContext::new(enable_debug_trace);

Expand Down
Loading

0 comments on commit af6c92d

Please sign in to comment.