Skip to content

Commit

Permalink
Fix the build and tests (due to rebasing)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-hoffman committed Oct 18, 2023
1 parent 8565c57 commit 6371cda
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions circom/tests/loops/inner_conditional_11.circom
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pragma circom 2.0.0;
// REQUIRES: circom
// RUN: rm -rf %t && mkdir %t && %circom --llvm -o %t %s | sed -n 's/.*Written successfully:.* \(.*\)/\1/p' | xargs cat | FileCheck %s --enable-var-scope
// XFAIL:.* // TEMPORARY: because EXTRACT_LOOP_BODY_TO_NEW_FUNC == false

template Sigma() {
signal input inp;
Expand Down
2 changes: 0 additions & 2 deletions circom/tests/subcmps/mapped.circom
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ pragma circom 2.0.0;

// REQUIRES: circom
// RUN: rm -rf %t && mkdir %t && %circom --llvm -o %t %s | sed -n 's/.*Written successfully:.* \(.*\)/\1/p' | xargs cat | FileCheck %s --enable-var-scope
// XFAIL:.*
// TODO: I think it has problems related to both https://veridise.atlassian.net/browse/VAN-582 and https://veridise.atlassian.net/browse/VAN-670

template A(n) {
signal input a[n];
Expand Down
1 change: 0 additions & 1 deletion circom/tests/subcmps/mapped2.circom
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pragma circom 2.0.0;

// REQUIRES: circom
// RUN: rm -rf %t && mkdir %t && %circom --llvm -o %t %s | sed -n 's/.*Written successfully:.* \(.*\)/\1/p' | xargs cat | FileCheck %s --enable-var-scope
// XFAIL:.* // pending https://veridise.atlassian.net/browse/VAN-670

template A(n) {
signal input a[n];
Expand Down
1 change: 1 addition & 0 deletions circom/tests/subcmps/subcmps2.circom
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pragma circom 2.0.6;
// REQUIRES: circom
// RUN: rm -rf %t && mkdir %t && %circom --llvm -o %t %s | sed -n 's/.*Written successfully:.* \(.*\)/\1/p' | xargs cat | FileCheck %s --enable-var-scope
// XFAIL:.* // TEMPORARY: because EXTRACT_LOOP_BODY_TO_NEW_FUNC == false

template Sum(n) {
signal input inp[n];
Expand Down
1 change: 1 addition & 0 deletions circom/tests/subcmps/subcmps3.circom
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pragma circom 2.0.0;
// REQUIRES: circom
// RUN: rm -rf %t && mkdir %t && %circom --llvm -o %t %s | sed -n 's/.*Written successfully:.* \(.*\)/\1/p' | xargs cat | FileCheck %s --enable-var-scope
// XFAIL:.* // TEMPORARY: because EXTRACT_LOOP_BODY_TO_NEW_FUNC == false

template Sum(n) {
signal input inp[n];
Expand Down
4 changes: 2 additions & 2 deletions circuit_passes/src/passes/loop_unroll/body_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,13 @@ impl LoopBodyExtractor {
println!("bucket {} refs by iteration: {:?}", id, column);
}
// ASSERT: same AddressType kind for this bucket in every (available) iteration
assert!(Self::all_same(Self::filter_map(column, |(x, _)| std::mem::discriminant(x))));
assert!(checks::all_same(Self::filter_map(column, |(x, _)| std::mem::discriminant(x))));

// If the computed index value for this bucket is NOT the same across all available
// iterations (i.e. where it is not None, see earlier comment) or if the AddressType
// is SubcmpSignal, then an extra function argument is needed for it.
if Self::filter_map_any(column, |(x, _)| matches!(x, AddressType::SubcmpSignal { .. }))
|| !Self::all_same(Self::filter_map(column, |(_, y)| *y))
|| !checks::all_same(Self::filter_map(column, |(_, y)| *y))
{
bucket_to_args.insert(*id, ArgIndex::Signal(next_idx));
next_idx += 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl ExtractedFunctionLocationUpdater {
// NOTE: This must happen before the modification step so it can use existing values from the bucket.
if let ArgIndex::SubCmp { counter, arena, .. } = ai {
let counter_address = AddressType::SubcmpSignal {
cmp_address: new_u32_value(bucket_meta, *counter),
cmp_address: build_u32_value(bucket_meta, *counter),
uniform_parallel_value: None,
counter_override: true,
is_output: false,
Expand All @@ -77,7 +77,7 @@ impl ExtractedFunctionLocationUpdater {
dest_is_output: false,
dest_address_type: counter_address.clone(),
dest: LocationRule::Indexed {
location: new_u32_value(bucket_meta, 0),
location: build_u32_value(bucket_meta, 0),
template_header: None,
},
bounded_fn: None,
Expand All @@ -96,7 +96,7 @@ impl ExtractedFunctionLocationUpdater {
message_id: bucket_meta.get_message_id(),
address_type: counter_address.clone(),
src: LocationRule::Indexed {
location: new_u32_value(bucket_meta, 0),
location: build_u32_value(bucket_meta, 0),
template_header: None,
},
bounded_fn: None,
Expand Down Expand Up @@ -141,7 +141,7 @@ impl ExtractedFunctionLocationUpdater {
message_id: bucket_meta.get_message_id(),
address_type: counter_address,
src: LocationRule::Indexed {
location: new_u32_value(bucket_meta, 0),
location: build_u32_value(bucket_meta, 0),
template_header: None,
},
bounded_fn: None,
Expand Down Expand Up @@ -204,7 +204,7 @@ impl ExtractedFunctionLocationUpdater {
input_information: InputInformation::NoInput,
},
LocationRule::Indexed {
location: new_u32_value(bucket_meta, 0), //use index 0 to ref the entire storage array
location: build_u32_value(bucket_meta, 0), //use index 0 to ref the entire storage array
template_header: None,
},
)
Expand Down
2 changes: 1 addition & 1 deletion code_producers/src/llvm_elements/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl<'a> TemplateCtx<'a> for ExtractedFunctionCtx<'a> {

fn load_subcmp_counter(
&self,
producer: &dyn LLVMIRProducer<'a>,
_producer: &dyn LLVMIRProducer<'a>,
id: AnyValueEnum<'a>,
implicit: bool,
) -> Option<PointerValue<'a>> {
Expand Down

0 comments on commit 6371cda

Please sign in to comment.