diff --git a/tools/attack/adv-accept-3/src/main.rs b/tools/attack/adv-accept-3/src/main.rs index 353f93c55..efdd5d5db 100644 --- a/tools/attack/adv-accept-3/src/main.rs +++ b/tools/attack/adv-accept-3/src/main.rs @@ -140,6 +140,10 @@ struct Props { lossy_base: u32, /// longest dependency path through one shadow pass (256 instructions) shadow_pass_depth: u32, + /// multiplies (mul, mulhi, mad) in the shadow block (of 256), the fixed-datapath chip's dearest op + shadow_muls: u32, + /// multiplies (mul, mulhi, mad) in the base program (of 48 non-load ops) + base_muls: u32, } /// Dependency depth over a sequence of instructions, carrying per-register (alu depth, load depth). `shfl` reads @@ -211,9 +215,14 @@ fn props(p: &Program) -> Props { last[i.dst as usize] = Some(i.op); } let lossy_last_writes = last.iter().filter(|o| matches!(o, Some(Op::Or | Op::Mul | Op::MulHi))).count() as u32; + let is_mul = |o: Op| matches!(o, Op::Mul | Op::MulHi | Op::Mad); + let shadow_muls = p.shadow.iter().filter(|i| is_mul(i.op)).count() as u32; + let base_muls = p.instrs.iter().filter(|i| is_mul(i.op)).count() as u32; Props { cp_loads, cp_alu, + shadow_muls, + base_muls, predictable_sites_it0: pred_it0, opmix_chi2_milli: (chi2 * 1000.0) as u32, opmix_max_pct: if nonload > 0 { maxc * 100 / nonload } else { 0 }, @@ -224,11 +233,11 @@ fn props(p: &Program) -> Props { } fn props_header() -> &'static str { - "cp_loads\tcp_alu\tpred_it0\tchi2_milli\topmax_pct\tlossy_last\tlossy_base\tshadow_depth" + "cp_loads\tcp_alu\tpred_it0\tchi2_milli\topmax_pct\tlossy_last\tlossy_base\tshadow_depth\tshadow_muls\tbase_muls" } fn props_row(q: &Props) -> String { - format!("{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}", q.cp_loads, q.cp_alu, q.predictable_sites_it0, q.opmix_chi2_milli, q.opmix_max_pct, q.lossy_last_writes, q.lossy_base, q.shadow_pass_depth) + format!("{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}", q.cp_loads, q.cp_alu, q.predictable_sites_it0, q.opmix_chi2_milli, q.opmix_max_pct, q.lossy_last_writes, q.lossy_base, q.shadow_pass_depth, q.shadow_muls, q.base_muls) } fn reject_part(r: &Reject) -> &'static str { diff --git a/tools/attack/adv-accept-3/target-remote/release/adv3 b/tools/attack/adv-accept-3/target-remote/release/adv3 index 063d099c9..eab47b83e 100755 Binary files a/tools/attack/adv-accept-3/target-remote/release/adv3 and b/tools/attack/adv-accept-3/target-remote/release/adv3 differ