Skip to content

Commit

Permalink
Merge branch 'master' into mv/check-contracts-mem-report
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm authored Dec 13, 2024
2 parents 2b79703 + f065c66 commit 84032be
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,8 @@ jobs:
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset }
# TODO: Bring these back once they no longer time out
# - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private }
# - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public }

name: External repo compilation report - ${{ matrix.project.repo }}/${{ matrix.project.path }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion acvm-repo/acvm/src/compiler/optimizers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn optimize<F: AcirField>(acir: Circuit<F>) -> (Circuit<F>, AcirTransformati
/// Applies [`ProofSystemCompiler`][crate::ProofSystemCompiler] independent optimizations to a [`Circuit`].
///
/// Accepts an injected `acir_opcode_positions` to allow optimizations to be applied in a loop.
#[tracing::instrument(level = "trace", name = "optimize_acir" skip(acir))]
#[tracing::instrument(level = "trace", name = "optimize_acir" skip(acir, acir_opcode_positions))]
pub(super) fn optimize_internal<F: AcirField>(
acir: Circuit<F>,
acir_opcode_positions: Vec<usize>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl DependencyContext {
function: &Function,
all_functions: &BTreeMap<FunctionId, Function>,
) {
trace!("processing instructions of block {} of function {}", block, function);
trace!("processing instructions of block {} of function {}", block, function.id());

for instruction in function.dfg[block].instructions() {
let mut arguments = Vec::new();
Expand Down Expand Up @@ -319,11 +319,6 @@ impl DependencyContext {
Value::Function(callee) => match all_functions[&callee].runtime() {
RuntimeType::Brillig(_) => {
// Record arguments/results for each Brillig call for the check
trace!(
"Brillig function {} called at {}",
all_functions[&callee],
instruction
);
self.tainted.insert(
*instruction,
BrilligTaintedIds::new(&arguments, &results),
Expand Down Expand Up @@ -376,7 +371,7 @@ impl DependencyContext {
}
}

trace!("resulting Brillig involved values: {:?}", self.tainted);
trace!("Number tainted Brillig calls: {}", self.tainted.len());
}

/// Every Brillig call not properly constrained should remain in the tainted set
Expand All @@ -392,7 +387,11 @@ impl DependencyContext {
})
.collect();

trace!("making following reports for function {}: {:?}", function.name(), warnings);
trace!(
"making {} under constrained reports for function {}",
warnings.len(),
function.name()
);
warnings
}

Expand All @@ -407,8 +406,6 @@ impl DependencyContext {
/// Check if any of the recorded Brillig calls have been properly constrained
/// by given values after recording partial constraints, if so stop tracking them
fn clear_constrained(&mut self, constrained_values: &[ValueId], function: &Function) {
trace!("attempting to clear Brillig calls constrained by values: {:?}", constrained_values);

// Remove numeric constants
let constrained_values =
constrained_values.iter().filter(|v| function.dfg.get_numeric_constant(**v).is_none());
Expand Down
2 changes: 2 additions & 0 deletions test_programs/compilation_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ for dir in ${tests_to_profile[@]}; do

cd $base_path/$dir

# The default package to run is the supplied list hardcoded at the top of the script
PACKAGE_NAME=$dir
# Otherwise default to the current directory as the package we want to run
if [ "$#" -ne 0 ]; then
PACKAGE_NAME=$(basename $current_dir)
fi
Expand Down

0 comments on commit 84032be

Please sign in to comment.