From e6243c7af1d82f3eb7ec1df569e5d92d6e282a41 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 02:53:12 -0500 Subject: [PATCH 1/4] feat(synapse-bench): opt-in CPU PMU diagnostics (pmu-diag, pmu-verify) Native perf_event_open backend through libc, per-core-class groups (A725/X925), typed INSTRUMENT_UNAVAILABLE refusals, control/instrumented windows, sealed protocol/raw/report evidence with a deterministic verifier. Default run, floor and bounds paths are untouched. Co-Authored-By: Claude Opus 5.5 --- crates/synapse-bench/src/lib.rs | 2 + crates/synapse-bench/src/main.rs | 85 ++ crates/synapse-bench/src/pmu.rs | 840 +++++++++++ crates/synapse-bench/src/pmu_diag.rs | 1454 ++++++++++++++++++++ crates/synapse-bench/src/pmu_diag/tests.rs | 861 ++++++++++++ 5 files changed, 3242 insertions(+) create mode 100644 crates/synapse-bench/src/pmu.rs create mode 100644 crates/synapse-bench/src/pmu_diag.rs create mode 100644 crates/synapse-bench/src/pmu_diag/tests.rs diff --git a/crates/synapse-bench/src/lib.rs b/crates/synapse-bench/src/lib.rs index c6ba08a..13ea952 100644 --- a/crates/synapse-bench/src/lib.rs +++ b/crates/synapse-bench/src/lib.rs @@ -25,6 +25,8 @@ pub mod git_arm; pub mod gitcmd; pub mod host; pub mod orchestrator; +pub mod pmu; +pub mod pmu_diag; pub mod query; pub mod recovery; pub mod rng; diff --git a/crates/synapse-bench/src/main.rs b/crates/synapse-bench/src/main.rs index 6127f10..9cc4a9d 100644 --- a/crates/synapse-bench/src/main.rs +++ b/crates/synapse-bench/src/main.rs @@ -12,6 +12,9 @@ //! [--repo-root ] [--source-rev R] [--hwmon-root ] //! synapse-bench bounds-verify --evidence //! synapse-bench bounds-report --evidence (prints report.json recomputed from protocol.json and raw.json) +//! synapse-bench pmu-diag --evidence --work-dir [--fixture-repo ] +//! [--source-rev R] [--sibling name=rev]... (opt-in CPU PMU diagnostics; see docs/BENCH_PMU_DIAGNOSTICS.md) +//! synapse-bench pmu-verify --evidence //! ``` use std::path::PathBuf; @@ -263,6 +266,86 @@ fn bounds_verify(args: &[String]) -> Result<(), String> { Ok(()) } +/// Opt-in CPU PMU diagnostics (issue #64). Separate from `run`, `floor` and `bounds`, +/// whose behaviour and output this subcommand never changes. +fn pmu_diag(args: &[String]) -> Result<(), String> { + use synapse_bench::pmu_diag::{run_diag, DiagConfig, SiblingRev}; + let opts = parse_pairs( + args, + &[ + "--evidence", + "--work-dir", + "--fixture-repo", + "--source-rev", + "--sibling", + ], + )?; + let get = |k: &str| { + opts.iter() + .rev() + .find(|(key, _)| key == k) + .map(|(_, v)| v.clone()) + }; + let siblings = opts + .iter() + .filter(|(k, _)| k == "--sibling") + .map(|(_, v)| { + v.split_once('=') + .filter(|(n, r)| !n.is_empty() && !r.is_empty()) + .map(|(n, r)| SiblingRev { + name: n.into(), + rev: r.into(), + }) + .ok_or(format!("--sibling needs name=rev, got {v:?}")) + }) + .collect::, _>>()?; + let cfg = DiagConfig { + evidence_dir: PathBuf::from(get("--evidence").ok_or("missing --evidence")?), + work_dir: PathBuf::from(get("--work-dir").ok_or("missing --work-dir")?), + fixture_repo: get("--fixture-repo").map(PathBuf::from), + source_rev: get("--source-rev").unwrap_or_else(|| "unknown".into()), + siblings, + invocation: std::env::args().collect(), + discovery: synapse_bench::pmu::discover_host(), + }; + let report = run_diag(&cfg)?; + for leg in &report.legs { + let p50 = |t: &synapse_bench::pmu_diag::TimingSummary| { + t.wall_ns_per_op + .as_ref() + .map_or("-".to_string(), |d| d.p50.to_string()) + }; + println!( + "{} [{}]: ns/op p50 control {} instrumented {}; PMU counted {}/{} windows, unavailable {:?}", + leg.leg, + leg.affinity.code(), + p50(&leg.control), + p50(&leg.instrumented), + leg.pmu.counted_windows, + leg.pmu.windows, + leg.pmu.unavailable + ); + } + for n in &report.not_run { + println!("{} [{}]: NOT_RUN: {}", n.leg, n.affinity.code(), n.reason); + } + Ok(()) +} + +fn pmu_verify(args: &[String]) -> Result<(), String> { + let opts = parse_pairs(args, &["--evidence"])?; + let dir = opts + .last() + .map(|(_, v)| PathBuf::from(v)) + .ok_or("missing --evidence")?; + let report = synapse_bench::pmu_diag::verify_evidence(&dir).map_err(|e| e.to_string())?; + println!( + "verified: report.json recomputed byte for byte from protocol.json ({}) and raw.json ({}); every PMU reading matches the recorded discovery and counter contract; every file in SHA256SUMS matches. Consistency only: authenticity comes from git history and review.", + report.protocol_sha256, report.raw_sha256 + ); + Ok(()) +} + /// Write the J3 vector corpus from the Rust crates; refuses to overwrite. fn crypto_vectors_write(args: &[String]) -> Result<(), String> { use std::io::Write; @@ -314,6 +397,8 @@ fn main() -> ExitCode { Some("bounds") => bounds(&args[1..]), Some("bounds-verify") => bounds_verify(&args[1..]), Some("bounds-report") => bounds_report(&args[1..]), + Some("pmu-diag") => pmu_diag(&args[1..]), + Some("pmu-verify") => pmu_verify(&args[1..]), Some("crypto-vectors-write") => crypto_vectors_write(&args[1..]), Some("crypto-vectors-verify") => crypto_vectors_verify(&args[1..]), _ => Err("usage: synapse-bench run ... | synapse-bench child ... (see crate docs)".into()), diff --git a/crates/synapse-bench/src/pmu.rs b/crates/synapse-bench/src/pmu.rs new file mode 100644 index 0000000..7597e02 --- /dev/null +++ b/crates/synapse-bench/src/pmu.rs @@ -0,0 +1,840 @@ +//! Opt-in ARM CPU PMU counters for diagnostics (issue #64). Never on by default. +//! +//! Nothing in the store, the service, or the default `run`/`floor`/`bounds` paths uses +//! this module. Only `synapse-bench pmu-diag` ([`crate::pmu_diag`]) opens counters, and +//! its controls run with [`PmuMode::Disabled`], which makes no system call at all. +//! +//! Backend: Linux `perf_event_open(2)` called through `libc::syscall`, one counting (not +//! sampling) event group per CPU PMU. Sources, quoted in `docs/BENCH_PMU_DIAGNOSTICS.md`: +//! - `perf_event_open(2)` (man-pages): attribute layout (`PERF_ATTR_SIZE_VER0` = 64 +//! bytes), `read_format` with `PERF_FORMAT_TOTAL_TIME_ENABLED | _RUNNING`, the +//! `inherit` bit (counts threads created after the open; not usable with +//! `PERF_FORMAT_GROUP`, so each counter is read on its own fd), the `ioctl` enable, +//! disable and reset requests, the `EACCES`/`EPERM` permission errors and +//! `/proc/sys/kernel/perf_event_paranoid`. +//! - Arm common architectural PMU event numbers, as the kernel defines them in +//! `include/linux/perf/arm_pmuv3.h`: `INST_RETIRED` 0x0008, `BR_MIS_PRED` 0x0010, +//! `CPU_CYCLES` 0x0011, `BR_PRED` 0x0012. They are only used after the PMU's own +//! sysfs event description (`events/` = `event=0x....`) confirms the same +//! number; an absent or different description is `UNSUPPORTED_EVENT`. +//! +//! Attribution: GB10 has two CPU PMUs, one per core class (Cortex-A725, MIDR part +//! 0xD87, and Cortex-X925, MIDR part 0xD85). Each event is opened on each PMU by that +//! PMU's dynamic `type`, so a count belongs to exactly one core class and only grows +//! while the measured task runs on that class. Counts are never scaled by +//! `time_enabled / time_running`. `exclude_kernel` and `exclude_hv` are set: counters +//! measure user-space execution only, and a task blocked in `fdatasync` is off CPU and +//! counts nothing, so storage wait is never attributed to branch prediction. +//! +//! Refusal: any open failure refuses the whole sample with `INSTRUMENT_UNAVAILABLE` and +//! a reason code (`PERMISSION_DENIED`, `UNSUPPORTED_EVENT`, `COUNTER_UNAVAILABLE`, +//! `NO_PMU`, `UNSUPPORTED_PLATFORM`, the vocabulary of Omega issue #453). A refused +//! sample carries no counts, never zeros. + +use serde::{Deserialize, Serialize}; +use std::path::Path; + +/// One architected event this module counts. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct EventSpec { + /// Lower-case sysfs name (`/sys/bus/event_source/devices//events/`). + pub name: &'static str, + /// Arm common architectural event number (`arm_pmuv3.h`). + pub arm_event: u16, +} + +/// The counted events, in group order (the first is the group leader). +pub const EVENTS: [EventSpec; 4] = [ + EventSpec { + name: "cpu_cycles", + arm_event: 0x0011, + }, + EventSpec { + name: "inst_retired", + arm_event: 0x0008, + }, + EventSpec { + name: "br_pred", + arm_event: 0x0012, + }, + EventSpec { + name: "br_mis_pred", + arm_event: 0x0010, + }, +]; + +/// Where the kernel exposes sysfs on a real host. +pub const SYSFS_ROOT: &str = "/sys"; + +/// CPU core class behind one PMU. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] +pub enum CoreClass { + CortexA725, + CortexX925, + /// The MIDR was unreadable or names another part. + Unknown, +} + +impl CoreClass { + /// Class from a `midr_el1` value (implementer 0x41 Arm; part number bits 15:4). + pub fn from_midr(midr: u64) -> Self { + let implementer = (midr >> 24) & 0xff; + let part = (midr >> 4) & 0xfff; + match (implementer, part) { + (0x41, 0xd87) => Self::CortexA725, + (0x41, 0xd85) => Self::CortexX925, + _ => Self::Unknown, + } + } + + pub fn code(self) -> &'static str { + match self { + Self::CortexA725 => "a725", + Self::CortexX925 => "x925", + Self::Unknown => "unknown", + } + } +} + +/// What the PMU's sysfs description says about one event. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct EventDiscovery { + pub name: String, + pub arm_event: u16, + /// Raw contents of `events/`, `None` when absent. + pub sysfs_encoding: Option, + /// True only when the sysfs encoding parses to exactly `arm_event`. + pub verified: bool, +} + +/// One CPU PMU found in sysfs. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct PmuDevice { + pub name: String, + /// Dynamic `perf_event_attr.type` from `/type`. + pub perf_type: u32, + pub cpus: Vec, + pub core_class: CoreClass, + /// `midr_el1` of the first listed CPU, as read. + pub midr: Option, + pub events: Vec, +} + +impl PmuDevice { + pub fn all_events_verified(&self) -> bool { + EVENTS.iter().all(|spec| { + self.events + .iter() + .any(|e| e.name == spec.name && e.arm_event == spec.arm_event && e.verified) + }) + } +} + +/// Everything discovered about the host's PMU access, recorded in `raw.json`. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Discovery { + pub sysfs_root: String, + /// `/proc/sys/kernel/perf_event_paranoid` (`None` when unreadable). + pub perf_event_paranoid: Option, + pub devices: Vec, +} + +/// Parse a kernel CPU list such as `0-4,10-14`. +pub fn parse_cpu_list(s: &str) -> Option> { + let mut out = Vec::new(); + for part in s.trim().split(',').filter(|p| !p.is_empty()) { + match part.split_once('-') { + Some((a, b)) => { + let (a, b): (usize, usize) = (a.parse().ok()?, b.parse().ok()?); + if a > b { + return None; + } + out.extend(a..=b); + } + None => out.push(part.parse().ok()?), + } + } + Some(out) +} + +/// Parse a sysfs event description `event=0x0011[,...]` to its event number. +pub fn parse_event_encoding(s: &str) -> Option { + s.trim() + .split(',') + .find_map(|kv| kv.trim().strip_prefix("event=")) + .and_then(|v| match v.strip_prefix("0x") { + Some(h) => u64::from_str_radix(h, 16).ok(), + None => v.parse().ok(), + }) +} + +fn read_trim(path: &Path) -> Option { + std::fs::read_to_string(path) + .ok() + .map(|s| s.trim().to_string()) +} + +/// Discover CPU PMUs under `sysfs_root` (`/sys` on a host; a temporary tree in tests). +/// A device counts as a CPU PMU when it has `type`, `cpus` and `events/cpu_cycles`. +pub fn discover(sysfs_root: &Path, paranoid_path: &Path) -> Discovery { + let mut devices = Vec::new(); + let dir = sysfs_root.join("bus/event_source/devices"); + let mut names: Vec = std::fs::read_dir(&dir) + .map(|rd| { + rd.filter_map(|e| e.ok()) + .map(|e| e.file_name().to_string_lossy().into_owned()) + .collect() + }) + .unwrap_or_default(); + names.sort(); + for name in names { + let d = dir.join(&name); + if !d.join("events/cpu_cycles").exists() { + continue; + } + let (Some(perf_type), Some(cpus)) = ( + read_trim(&d.join("type")).and_then(|t| t.parse::().ok()), + read_trim(&d.join("cpus")).and_then(|c| parse_cpu_list(&c)), + ) else { + continue; + }; + let midr = cpus.first().and_then(|c| { + read_trim(&sysfs_root.join(format!( + "devices/system/cpu/cpu{c}/regs/identification/midr_el1" + ))) + }); + let core_class = midr + .as_deref() + .and_then(|m| u64::from_str_radix(m.trim_start_matches("0x"), 16).ok()) + .map(CoreClass::from_midr) + .unwrap_or(CoreClass::Unknown); + let events = EVENTS + .iter() + .map(|spec| { + let enc = read_trim(&d.join("events").join(spec.name)); + let verified = enc + .as_deref() + .and_then(parse_event_encoding) + .is_some_and(|v| v == u64::from(spec.arm_event)); + EventDiscovery { + name: spec.name.into(), + arm_event: spec.arm_event, + sysfs_encoding: enc, + verified, + } + }) + .collect(); + devices.push(PmuDevice { + name, + perf_type, + cpus, + core_class, + midr, + events, + }); + } + Discovery { + sysfs_root: sysfs_root.display().to_string(), + perf_event_paranoid: read_trim(paranoid_path).and_then(|s| s.parse().ok()), + devices, + } +} + +/// Discovery on the running host. +pub fn discover_host() -> Discovery { + discover( + Path::new(SYSFS_ROOT), + Path::new("/proc/sys/kernel/perf_event_paranoid"), + ) +} + +/// Whether counters are opened at all. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +pub enum PmuMode { + /// No system call, no counter, no file descriptor (default and every control run). + Disabled, + Enabled, +} + +/// Affinity of the measured thread (and every thread it creates) during a window. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] +pub enum AffinityPolicy { + /// Scheduler's choice; a counter that ran part of the window cannot tell migration + /// from multiplexing and is reported as `PartialResidency`. + Unpinned, + /// Pinned to every CPU of one core class. + Pinned(CoreClass), +} + +impl AffinityPolicy { + pub fn parse(s: &str) -> Option { + match s { + "unpinned" => Some(Self::Unpinned), + "a725" => Some(Self::Pinned(CoreClass::CortexA725)), + "x925" => Some(Self::Pinned(CoreClass::CortexX925)), + _ => None, + } + } + + pub fn code(self) -> &'static str { + match self { + Self::Unpinned => "unpinned", + Self::Pinned(c) => c.code(), + } + } +} + +/// Why a sample has no counts. Serialized next to `status: INSTRUMENT_UNAVAILABLE`. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum UnavailableReason { + /// `EACCES` or `EPERM` (CAP_PERFMON missing or `perf_event_paranoid` too high). + PermissionDenied, + /// The PMU's sysfs description lacks the event or gives another number, or the + /// kernel refuses the type or config (`ENOENT`, `ENODEV`, `EOPNOTSUPP`). + UnsupportedEvent, + /// Any other open, enable, disable, or read failure (`EINVAL`, `EBUSY`, `EMFILE`...). + CounterUnavailable, + /// No CPU PMU in sysfs. + NoPmu, + /// Not Linux, or the kernel has no `perf_event_open` (`ENOSYS`). + UnsupportedPlatform, +} + +impl UnavailableReason { + /// Classify an errno from `perf_event_open`. + pub fn from_open_errno(errno: i32) -> Self { + match errno { + libc::EACCES | libc::EPERM => Self::PermissionDenied, + libc::ENOENT | libc::ENODEV | libc::EOPNOTSUPP => Self::UnsupportedEvent, + libc::ENOSYS => Self::UnsupportedPlatform, + _ => Self::CounterUnavailable, + } + } +} + +/// How a counter that was read relates to the window. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum CounterState { + /// `time_running == time_enabled > 0`: counted for the whole time the task ran. + Counted, + /// Pinned to this PMU's class and `0 < time_running < time_enabled`: the kernel + /// time-shared the hardware counter. The raw count covers only `time_running`. + Multiplexed, + /// Unpinned and `0 < time_running < time_enabled`: the task migrated between core + /// classes and/or the counter was multiplexed; the two cannot be told apart. + PartialResidency, + /// `time_running == 0` and count 0: the task never ran on this class. + NotScheduled, +} + +/// A read that contradicts the counter contract (refused, never repaired). +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum MalformedRead { + RunningExceedsEnabled { running: u64, enabled: u64 }, + CountWithoutRunningTime { value: u64 }, +} + +impl std::fmt::Display for MalformedRead { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RunningExceedsEnabled { running, enabled } => { + write!( + f, + "time_running {running} ns exceeds time_enabled {enabled} ns" + ) + } + Self::CountWithoutRunningTime { value } => { + write!(f, "count {value} with zero time_running") + } + } + } +} + +/// Classify one `(value, time_enabled, time_running)` read. Pure: used both when +/// sampling and when verifying sealed evidence. +pub fn classify( + value: u64, + enabled_ns: u64, + running_ns: u64, + pinned_to_this_class: bool, +) -> Result { + if running_ns > enabled_ns { + return Err(MalformedRead::RunningExceedsEnabled { + running: running_ns, + enabled: enabled_ns, + }); + } + if running_ns == 0 { + return if value == 0 { + Ok(CounterState::NotScheduled) + } else { + Err(MalformedRead::CountWithoutRunningTime { value }) + }; + } + Ok(if running_ns == enabled_ns { + CounterState::Counted + } else if pinned_to_this_class { + CounterState::Multiplexed + } else { + CounterState::PartialResidency + }) +} + +/// One counter read. `raw_count` is exactly what the kernel returned, never scaled. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct CounterReading { + pub event: String, + pub arm_event: u16, + pub pmu: String, + pub core_class: CoreClass, + pub raw_count: u64, + pub time_enabled_ns: u64, + pub time_running_ns: u64, + pub state: CounterState, +} + +/// Outcome of one instrumented window. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(tag = "status", rename_all = "SCREAMING_SNAKE_CASE")] +pub enum PmuSample { + /// Control run: no counters were opened. + Disabled, + /// Counters could not be used. No counts exist for this window. + InstrumentUnavailable { + reason: UnavailableReason, + detail: String, + }, + Counted { + readings: Vec, + }, +} + +/// `perf_event_attr` truncated to `PERF_ATTR_SIZE_VER0` (64 bytes), which every kernel +/// since 2.6.31 accepts (`perf_event_open(2)`, `size` field). Field order and widths +/// follow `include/uapi/linux/perf_event.h`. +#[repr(C)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub struct PerfEventAttr { + pub type_: u32, + pub size: u32, + pub config: u64, + pub sample_period: u64, + pub sample_type: u64, + pub read_format: u64, + /// Bit field: bit 0 `disabled`, 1 `inherit`, 5 `exclude_kernel`, 6 `exclude_hv`. + pub flags: u64, + pub wakeup_events: u32, + pub bp_type: u32, + pub config1: u64, +} + +pub const PERF_ATTR_SIZE_VER0: u32 = 64; +const _: () = assert!(std::mem::size_of::() == PERF_ATTR_SIZE_VER0 as usize); + +pub const PERF_FORMAT_TOTAL_TIME_ENABLED: u64 = 1 << 0; +pub const PERF_FORMAT_TOTAL_TIME_RUNNING: u64 = 1 << 1; +pub const ATTR_FLAG_DISABLED: u64 = 1 << 0; +pub const ATTR_FLAG_INHERIT: u64 = 1 << 1; +pub const ATTR_FLAG_EXCLUDE_KERNEL: u64 = 1 << 5; +pub const ATTR_FLAG_EXCLUDE_HV: u64 = 1 << 6; +/// `_IO('$', 0)`, `_IO('$', 1)`, `_IO('$', 3)`. +pub const PERF_EVENT_IOC_ENABLE: u64 = 0x2400; +pub const PERF_EVENT_IOC_DISABLE: u64 = 0x2401; +pub const PERF_EVENT_IOC_RESET: u64 = 0x2403; +pub const PERF_IOC_FLAG_GROUP: u64 = 1; +pub const PERF_FLAG_FD_CLOEXEC: u64 = 1 << 3; + +/// Attribute for one counting event on `pmu`: user space only, inherited by threads +/// created after the open; the group leader starts disabled. +pub fn event_attr(perf_type: u32, arm_event: u16, leader: bool) -> PerfEventAttr { + let mut flags = ATTR_FLAG_INHERIT | ATTR_FLAG_EXCLUDE_KERNEL | ATTR_FLAG_EXCLUDE_HV; + if leader { + flags |= ATTR_FLAG_DISABLED; + } + PerfEventAttr { + type_: perf_type, + size: PERF_ATTR_SIZE_VER0, + config: u64::from(arm_event), + read_format: PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_TOTAL_TIME_RUNNING, + flags, + ..Default::default() + } +} + +/// The system calls a session makes. [`LinuxPerf`] is the real one; tests script a +/// fake to exercise refusals and multiplexing on any host. +pub trait PerfBackend { + /// `perf_event_open(attr, pid = 0, cpu = -1, group_fd, PERF_FLAG_FD_CLOEXEC)`. + fn open(&mut self, attr: &PerfEventAttr, group_fd: i32) -> Result; + fn ioctl_group(&mut self, fd: i32, request: u64) -> Result<(), i32>; + /// `[value, time_enabled, time_running]`. + fn read3(&mut self, fd: i32) -> Result<[u64; 3], i32>; + fn close(&mut self, fd: i32); +} + +/// Real backend: `libc::syscall(SYS_perf_event_open, ...)`. +#[derive(Debug, Default)] +pub struct LinuxPerf; + +fn last_errno() -> i32 { + std::io::Error::last_os_error() + .raw_os_error() + .unwrap_or(libc::EIO) +} + +impl PerfBackend for LinuxPerf { + #[cfg(target_os = "linux")] + fn open(&mut self, attr: &PerfEventAttr, group_fd: i32) -> Result { + // SAFETY: `attr` points to a live, initialized 64-byte `perf_event_attr` whose + // `size` field says 64; the kernel only reads it (or writes `size` on E2BIG, + // which cannot happen for VER0). pid 0 = calling thread, cpu -1 = any CPU. + let fd = unsafe { + libc::syscall( + libc::SYS_perf_event_open, + attr as *const PerfEventAttr, + 0 as libc::pid_t, + -1 as libc::c_int, + group_fd as libc::c_int, + PERF_FLAG_FD_CLOEXEC as libc::c_ulong, + ) + }; + if fd < 0 { + Err(last_errno()) + } else { + Ok(fd as i32) + } + } + + #[cfg(not(target_os = "linux"))] + fn open(&mut self, _attr: &PerfEventAttr, _group_fd: i32) -> Result { + Err(libc::ENOSYS) + } + + fn ioctl_group(&mut self, fd: i32, request: u64) -> Result<(), i32> { + // SAFETY: `fd` is a perf event fd this session opened and still owns; the + // enable/disable/reset requests take an integer flag argument, no pointer. + let rc = unsafe { libc::ioctl(fd, request as _, PERF_IOC_FLAG_GROUP) }; + if rc < 0 { + Err(last_errno()) + } else { + Ok(()) + } + } + + fn read3(&mut self, fd: i32) -> Result<[u64; 3], i32> { + let mut buf = [0u64; 3]; + // SAFETY: `buf` is 24 writable bytes owned by this frame; `fd` is owned. + let n = unsafe { libc::read(fd, buf.as_mut_ptr().cast(), std::mem::size_of_val(&buf)) }; + if n < 0 { + Err(last_errno()) + } else if n as usize != std::mem::size_of_val(&buf) { + Err(libc::EIO) + } else { + Ok(buf) + } + } + + fn close(&mut self, fd: i32) { + // SAFETY: closes an fd this session opened exactly once. + unsafe { libc::close(fd) }; + } +} + +struct OpenEvent { + fd: i32, + spec: EventSpec, +} + +struct OpenGroup { + device: PmuDevice, + events: Vec, +} + +/// Counters for one measured window. Open before the window (and before the window +/// creates threads, so `inherit` covers them), then [`PmuSession::start`] and +/// [`PmuSession::stop`] around the measured work. +pub struct PmuSession { + backend: B, + groups: Vec, + refusal: Option<(UnavailableReason, String)>, + mode: PmuMode, + affinity: AffinityPolicy, +} + +impl PmuSession { + /// Open one group per discovered device. Fails closed: any refusal closes every + /// fd already opened and the session yields only `InstrumentUnavailable`. + /// `PmuMode::Disabled` touches nothing. + pub fn open( + backend: B, + mode: PmuMode, + discovery: &Discovery, + affinity: AffinityPolicy, + ) -> Self { + let mut s = Self { + groups: Vec::new(), + refusal: None, + mode, + affinity, + backend, + }; + if mode == PmuMode::Disabled { + return s; + } + if discovery.devices.is_empty() { + s.refusal = Some(( + UnavailableReason::NoPmu, + format!( + "no CPU PMU under {}/bus/event_source/devices", + discovery.sysfs_root + ), + )); + return s; + } + if let Some(d) = discovery.devices.iter().find(|d| !d.all_events_verified()) { + let missing: Vec = d + .events + .iter() + .filter(|e| !e.verified) + .map(|e| format!("{} (sysfs {:?})", e.name, e.sysfs_encoding)) + .collect(); + s.refusal = Some(( + UnavailableReason::UnsupportedEvent, + format!( + "{}: event description absent or not the architected number: {}", + d.name, + missing.join(", ") + ), + )); + return s; + } + for d in &discovery.devices { + let mut group = OpenGroup { + device: d.clone(), + events: Vec::new(), + }; + let mut leader_fd = -1; + for (i, spec) in EVENTS.iter().enumerate() { + let attr = event_attr(d.perf_type, spec.arm_event, i == 0); + match s.backend.open(&attr, leader_fd) { + Ok(fd) => { + if i == 0 { + leader_fd = fd; + } + group.events.push(OpenEvent { fd, spec: *spec }); + } + Err(errno) => { + s.groups.push(group); + s.close_all(); + s.refusal = Some(( + UnavailableReason::from_open_errno(errno), + format!( + "perf_event_open({} type {} event {:#06x} {}): {}", + d.name, + d.perf_type, + spec.arm_event, + spec.name, + std::io::Error::from_raw_os_error(errno) + ), + )); + return s; + } + } + } + s.groups.push(group); + } + s + } + + fn close_all(&mut self) { + for g in self.groups.drain(..) { + for e in g.events.iter().rev() { + self.backend.close(e.fd); + } + } + } + + fn group_ioctl(&mut self, request: u64, what: &str) { + if self.refusal.is_some() { + return; + } + let leaders: Vec<(String, i32)> = self + .groups + .iter() + .filter_map(|g| g.events.first().map(|e| (g.device.name.clone(), e.fd))) + .collect(); + for (name, fd) in leaders { + if let Err(errno) = self.backend.ioctl_group(fd, request) { + self.refusal = Some(( + UnavailableReason::CounterUnavailable, + format!( + "{what} {name}: {}", + std::io::Error::from_raw_os_error(errno) + ), + )); + return; + } + } + } + + /// Reset and enable every group (no-op when disabled or refused). + pub fn start(&mut self) { + if self.mode == PmuMode::Disabled { + return; + } + self.group_ioctl(PERF_EVENT_IOC_RESET, "reset"); + self.group_ioctl(PERF_EVENT_IOC_ENABLE, "enable"); + } + + /// Disable, read, classify, and close every counter. + pub fn stop(mut self) -> PmuSample { + if self.mode == PmuMode::Disabled { + return PmuSample::Disabled; + } + self.group_ioctl(PERF_EVENT_IOC_DISABLE, "disable"); + let mut readings = Vec::new(); + if self.refusal.is_none() { + 'outer: for gi in 0..self.groups.len() { + let dev = self.groups[gi].device.clone(); + let pinned_here = self.affinity == AffinityPolicy::Pinned(dev.core_class) + && dev.core_class != CoreClass::Unknown; + for ei in 0..self.groups[gi].events.len() { + let (fd, spec) = { + let e = &self.groups[gi].events[ei]; + (e.fd, e.spec) + }; + let raw = match self.backend.read3(fd) { + Ok(v) => v, + Err(errno) => { + self.refusal = Some(( + UnavailableReason::CounterUnavailable, + format!( + "read {} {}: {}", + dev.name, + spec.name, + std::io::Error::from_raw_os_error(errno) + ), + )); + break 'outer; + } + }; + match classify(raw[0], raw[1], raw[2], pinned_here) { + Ok(state) => readings.push(CounterReading { + event: spec.name.into(), + arm_event: spec.arm_event, + pmu: dev.name.clone(), + core_class: dev.core_class, + raw_count: raw[0], + time_enabled_ns: raw[1], + time_running_ns: raw[2], + state, + }), + Err(m) => { + self.refusal = Some(( + UnavailableReason::CounterUnavailable, + format!("{} {}: malformed read: {m}", dev.name, spec.name), + )); + break 'outer; + } + } + } + } + } + self.close_all(); + match self.refusal.take() { + Some((reason, detail)) => PmuSample::InstrumentUnavailable { reason, detail }, + None => PmuSample::Counted { readings }, + } + } +} + +impl Drop for PmuSession { + fn drop(&mut self) { + self.close_all(); + } +} + +/// The calling thread's CPU affinity, so a pinned window can restore it afterwards. +pub struct AffinityGuard { + #[cfg(target_os = "linux")] + saved: Option, +} + +/// Pin the calling thread (threads it creates inherit the mask) to `cpus`. +/// `AffinityPolicy::Unpinned` changes nothing. +pub fn apply_affinity( + policy: AffinityPolicy, + discovery: &Discovery, +) -> Result { + let cpus: Vec = match policy { + AffinityPolicy::Unpinned => { + return Ok(AffinityGuard { + #[cfg(target_os = "linux")] + saved: None, + }) + } + AffinityPolicy::Pinned(class) => discovery + .devices + .iter() + .filter(|d| d.core_class == class) + .flat_map(|d| d.cpus.iter().copied()) + .collect(), + }; + if cpus.is_empty() { + return Err(format!( + "affinity {}: no PMU in sysfs names that core class", + policy.code() + )); + } + pin_to(&cpus) +} + +#[cfg(target_os = "linux")] +fn pin_to(cpus: &[usize]) -> Result { + // SAFETY: `cpu_set_t` is a plain bit array; all-zero is the empty set. + let mut saved: libc::cpu_set_t = unsafe { std::mem::zeroed() }; + // SAFETY: `saved` is a valid, exclusively borrowed cpu_set_t of the given size. + let rc = + unsafe { libc::sched_getaffinity(0, std::mem::size_of::(), &mut saved) }; + if rc != 0 { + return Err(format!( + "sched_getaffinity: {}", + std::io::Error::last_os_error() + )); + } + // SAFETY: as above. + let mut set: libc::cpu_set_t = unsafe { std::mem::zeroed() }; + for &c in cpus { + if c >= libc::CPU_SETSIZE as usize { + return Err(format!("cpu {c} outside cpu_set_t")); + } + // SAFETY: `c` is checked against CPU_SETSIZE above. + unsafe { libc::CPU_SET(c, &mut set) }; + } + // SAFETY: `set` is a valid cpu_set_t; pid 0 is the calling thread. + let rc = unsafe { libc::sched_setaffinity(0, std::mem::size_of::(), &set) }; + if rc != 0 { + return Err(format!( + "sched_setaffinity: {}", + std::io::Error::last_os_error() + )); + } + Ok(AffinityGuard { saved: Some(saved) }) +} + +#[cfg(not(target_os = "linux"))] +fn pin_to(_cpus: &[usize]) -> Result { + Err("CPU affinity is only implemented on Linux".into()) +} + +impl Drop for AffinityGuard { + fn drop(&mut self) { + #[cfg(target_os = "linux")] + if let Some(saved) = self.saved.take() { + // SAFETY: restores the mask read by `pin_to` on the same thread. + unsafe { libc::sched_setaffinity(0, std::mem::size_of::(), &saved) }; + } + } +} diff --git a/crates/synapse-bench/src/pmu_diag.rs b/crates/synapse-bench/src/pmu_diag.rs new file mode 100644 index 0000000..295e24e --- /dev/null +++ b/crates/synapse-bench/src/pmu_diag.rs @@ -0,0 +1,1454 @@ +//! `synapse-bench pmu-diag`: opt-in CPU PMU diagnostics beside the existing physical-bound +//! benchmarks (issue #64). Diagnostic only: hardware counts are supporting units, never a +//! performance claim and never a qualification result. Seconds per operation stay the +//! measured unit; energy is not measured here (the `run`, `floor` and `bounds` paths keep +//! their SI and joule reporting unchanged). +//! +//! Evidence follows the A0 shape (`docs/A0_HOST_BOUNDS.md`): +//! - `protocol.json` is written (and committed) before the run: legs, repetitions, +//! affinity policies, seed, fixture revision. Nothing is tuned from these runs; any +//! later tuning needs its own held-out runs. +//! - `raw.json` holds integers only: per window the wall nanoseconds, getrusage CPU +//! microseconds, operation count, and the PMU sample exactly as read (or its refusal), +//! plus the manifest (invocation, host, compiler, kernel, `perf_event_paranoid`, +//! PMU discovery, fixture commit, source and sibling revisions). +//! - `report.json` is a pure function of the protocol and raw bytes; `pmu-verify` +//! recomputes it byte for byte, re-validates every PMU reading against the discovery +//! and the counter contract, and checks `SHA256SUMS`. +//! +//! Each repetition runs a control window (counters never opened) and then an +//! instrumented window on identical input, so instrumentation overhead is measured, not +//! assumed. Timing covers the measured work only: counters are opened before the clock +//! starts and read after it stops. + +use crate::fixture::{self, BaseTree, EditableFile}; +use crate::host::{collect_host_info, HostInfo}; +use crate::pmu::{ + apply_affinity, classify, AffinityPolicy, CoreClass, CounterState, Discovery, LinuxPerf, + PmuMode, PmuSample, PmuSession, UnavailableReason, EVENTS, +}; +use crate::rng::SplitMix64; +use crate::rusage::sample_self; +use crate::stats::nearest_rank; +use crate::synapse_arm::{self, AgentIdentity, BenchIdentities}; +use crate::workload::{generate_write_workload, EditOp, Proposal}; +use crate::write_phase::synapse_submit; +use serde::de::DeserializeOwned; +use serde::{Deserialize, Serialize}; +use sha2::{Digest, Sha256}; +use std::collections::BTreeMap; +use std::fs; +use std::path::{Path, PathBuf}; +use std::sync::Mutex; +use std::time::Instant; +use synapse_api::{ + ChangesetAdvisoryPayload, CrumbContextQueryPayload, DiffQueryPayload, PageRequest, + PageResponse, SynapseService, TreeQueryPayload, TreeTarget, DEFAULT_MAX_PAGE_SIZE, +}; +use synapse_core::{ChangesetId, FileMode, GitOid, WalSeq}; +use synapse_store::{FsyncPolicy, IngestOutcome, RecoveryPolicy, SharedStore, StoreLimits}; + +pub const PROTOCOL_FILE: &str = "protocol.json"; +pub const RAW_FILE: &str = "raw.json"; +pub const REPORT_FILE: &str = "report.json"; +pub const SUMS_FILE: &str = "SHA256SUMS"; +pub const PROTOCOL_SCHEMA: &str = "synapse-bench/pmu-diag-protocol/v1"; +pub const RAW_SCHEMA: &str = "synapse-bench/pmu-diag-raw/v1"; +pub const REPORT_SCHEMA: &str = "synapse-bench/pmu-diag-report/v1"; +/// The only window order protocol v1 allows. +pub const ORDER: &str = "control-then-instrumented"; + +/// CPU-only floor operations (a subset of `floor.rs` CPU probes, same inputs). +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum FloorOp { + #[serde(rename = "sha256_content_12k")] + Sha256Content12k, + Ed25519Verify, + EnvelopeValidate, + JsonDecodeSubmitRequest, +} + +/// Store commit path for a write leg. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum WriteArm { + /// `FsyncPolicy::EveryCommit` (the S1 arm). + EveryCommit, + /// WAL v2 `FsyncPolicy::GROUP_COMMIT_DEFAULT` through `SharedStore` (the S3 arm). + GroupCommit, +} + +/// One pre-registered leg. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)] +pub enum LegSpec { + Floor { + op: FloorOp, + iterations: u64, + }, + Write { + arm: WriteArm, + agents: usize, + ops_per_agent: usize, + }, + /// read_file, tree (all pages) and diff (all pages) against a populated service. + Query { + populate_agents: usize, + populate_ops_per_agent: usize, + samples: usize, + }, + /// crumb_context and changeset_advisory (no coordination plane) on the fixture base. + Crumb { + samples: usize, + }, +} + +impl LegSpec { + /// Stable identifier used in raw and report rows. + pub fn id(&self) -> String { + match self { + Self::Floor { op, .. } => format!("floor/{}", enum_code(op)), + Self::Write { arm, agents, .. } => format!("write/{}/agents={agents}", enum_code(arm)), + Self::Query { .. } => "query/read_tree_diff".into(), + Self::Crumb { .. } => "crumb/context_advisory".into(), + } + } + + fn needs_fixture(&self) -> bool { + !matches!(self, Self::Floor { .. }) + } + + fn validate(&self) -> Result<(), String> { + let ok = match self { + Self::Floor { iterations, .. } => *iterations > 0, + Self::Write { + agents, + ops_per_agent, + .. + } => *agents > 0 && *ops_per_agent > 0, + Self::Query { + populate_agents, + populate_ops_per_agent, + samples, + } => *populate_agents > 0 && *populate_ops_per_agent > 0 && *samples > 0, + Self::Crumb { samples } => *samples > 0, + }; + if ok { + Ok(()) + } else { + Err(format!("leg {}: every count must be positive", self.id())) + } + } +} + +fn enum_code(v: &T) -> String { + serde_json::to_value(v) + .ok() + .and_then(|v| v.as_str().map(str::to_string)) + .unwrap_or_default() +} + +/// Pre-registered plan (`protocol.json`). +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct Protocol { + pub schema: String, + pub purpose: String, + pub seed: u64, + /// Required when any leg needs the fixture (write, query, crumb). + pub fixture_rev: Option, + /// Repetitions per (leg, affinity); each is one control plus one instrumented window. + pub reps: usize, + pub order: String, + pub affinity: Vec, + pub legs: Vec, + /// Statement of what is held out (v1: nothing is tuned from these runs). + pub held_out: String, +} + +impl Protocol { + pub fn validate(&self) -> Result<(), String> { + if self.schema != PROTOCOL_SCHEMA { + return Err(format!( + "protocol schema {:?}, expected {PROTOCOL_SCHEMA:?}", + self.schema + )); + } + if self.order != ORDER { + return Err(format!( + "protocol order {:?}, expected {ORDER:?}", + self.order + )); + } + if self.reps == 0 || self.affinity.is_empty() || self.legs.is_empty() { + return Err("protocol needs reps > 0, at least one affinity and one leg".into()); + } + let mut ids = std::collections::BTreeSet::new(); + for leg in &self.legs { + leg.validate()?; + if !ids.insert(leg.id()) { + return Err(format!("leg {} listed twice", leg.id())); + } + } + let mut aff = std::collections::BTreeSet::new(); + if !self.affinity.iter().all(|a| aff.insert(*a)) { + return Err("affinity policy listed twice".into()); + } + if self.legs.iter().any(LegSpec::needs_fixture) + && self.fixture_rev.as_deref().is_none_or(str::is_empty) + { + return Err("write, query and crumb legs need fixture_rev".into()); + } + Ok(()) + } +} + +/// A named sibling repository revision recorded for attribution (for example the +/// Omega PMU probe contract, issue omega#453). +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct SiblingRev { + pub name: String, + pub rev: String, +} + +/// Who ran what, where, with which build. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Manifest { + pub invocation: Vec, + pub started_at: String, + pub host: HostInfo, + /// `debug` or `release` (from `cfg!(debug_assertions)`). + pub build_profile: String, + pub target_arch: String, + pub source_rev: String, + pub fixture_repo: Option, + /// The fixture revision resolved to a commit. + pub fixture_commit: Option, + pub siblings: Vec, + pub clock: String, + pub energy: String, +} + +/// One measured window, as read. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Window { + pub leg: String, + pub affinity: AffinityPolicy, + pub rep: usize, + pub instrumented: bool, + pub ops: u64, + pub wall_ns: u64, + /// getrusage(RUSAGE_SELF) deltas over the window: every thread of this process. + pub cpu_user_us: u64, + pub cpu_sys_us: u64, + pub error: Option, + pub pmu: PmuSample, +} + +/// A (leg, affinity) pair that produced no windows, with the reason. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct NotRun { + pub leg: String, + pub affinity: AffinityPolicy, + pub reason: String, +} + +/// `raw.json`. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct Raw { + pub schema: String, + pub protocol_sha256: String, + pub manifest: Manifest, + pub discovery: Discovery, + pub windows: Vec, + pub not_run: Vec, +} + +/// Nearest-rank distribution of integer samples. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Dist { + pub n: usize, + pub min: u64, + pub p50: u64, + pub max: u64, +} + +fn dist(values: &[u64]) -> Option { + let mut v = values.to_vec(); + v.sort_unstable(); + Some(Dist { + n: v.len(), + min: *v.first()?, + p50: nearest_rank(&v, 0.5)?, + max: *v.last()?, + }) +} + +/// Timing over the successful windows of one side (control or instrumented). +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct TimingSummary { + pub windows: usize, + pub errors: usize, + pub wall_ns: Option, + /// `wall_ns / ops` per window (integer division). + pub wall_ns_per_op: Option, + /// User plus system CPU microseconds per window (all threads). + pub cpu_us: Option, +} + +/// Raw counts of one event on one core class over the windows that counted it. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct EventSummary { + pub core_class: CoreClass, + pub event: String, + /// Raw count per window (never scaled). + pub raw_count: Dist, + pub raw_count_per_op: Dist, +} + +/// Ratios from counts summed over windows on one core class (same event group, so the +/// four counters share enable/run time). Integers: per mille. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ClassRatios { + pub core_class: CoreClass, + pub windows: usize, + /// `sum(INST_RETIRED) * 1000 / sum(CPU_CYCLES)`. + pub instructions_per_kilocycle: Option, + /// `sum(BR_MIS_PRED) * 1000 / sum(BR_PRED)`. + pub mispredicts_per_kilo_predicted_branches: Option, +} + +/// PMU outcome over the instrumented windows. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct PmuSummary { + pub windows: usize, + pub counted_windows: usize, + /// `INSTRUMENT_UNAVAILABLE` windows by reason code. + pub unavailable: BTreeMap, + /// Counter reads by state (`COUNTED`, `MULTIPLEXED`, ...). + pub states: BTreeMap, + pub events: Vec, + pub ratios: Vec, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct LegReport { + pub leg: String, + pub affinity: AffinityPolicy, + pub control: TimingSummary, + pub instrumented: TimingSummary, + /// `(instrumented p50 - control p50) * 1e6 / control p50` of wall_ns, parts per million. + pub overhead_ppm_p50: Option, + pub pmu: PmuSummary, +} + +/// `report.json`. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Report { + pub schema: String, + pub status: String, + pub protocol_sha256: String, + pub raw_sha256: String, + pub legs: Vec, + pub not_run: Vec, + pub notes: Vec, +} + +/// Why sealed evidence was refused. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum VerifyError { + Io(String), + Parse(String), + Protocol(String), + ProtocolDigest { + raw_says: String, + actual: String, + }, + /// A window or reading contradicts the protocol, the discovery, or the counter contract. + Mismatch(String), + ReportMismatch { + first_difference_at: usize, + }, + ChecksumsMissing(String), + ChecksumMismatch(String), +} + +impl std::fmt::Display for VerifyError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Io(m) => write!(f, "io: {m}"), + Self::Parse(m) => write!(f, "parse: {m}"), + Self::Protocol(m) => write!(f, "protocol: {m}"), + Self::ProtocolDigest { raw_says, actual } => write!( + f, + "raw.json names protocol {raw_says}, protocol.json is {actual}" + ), + Self::Mismatch(m) => write!(f, "mismatch: {m}"), + Self::ReportMismatch { + first_difference_at, + } => write!( + f, + "report.json differs from the recomputed report at byte {first_difference_at}" + ), + Self::ChecksumsMissing(m) => write!(f, "checksums missing: {m}"), + Self::ChecksumMismatch(m) => write!(f, "checksum mismatch: {m}"), + } + } +} + +pub fn sha256_hex(bytes: &[u8]) -> String { + hex::encode(Sha256::digest(bytes)) +} + +fn parse(bytes: &[u8], what: &str) -> Result { + serde_json::from_slice(bytes).map_err(|e| VerifyError::Parse(format!("{what}: {e}"))) +} + +/// Check every window and reading in `raw` against `protocol`, the recorded discovery, +/// and the counter contract. Refuses, never repairs. +pub fn validate_raw(protocol: &Protocol, raw: &Raw) -> Result<(), VerifyError> { + let mm = |m: String| Err(VerifyError::Mismatch(m)); + if raw.schema != RAW_SCHEMA { + return mm(format!( + "raw schema {:?}, expected {RAW_SCHEMA:?}", + raw.schema + )); + } + let legs: Vec = protocol.legs.iter().map(LegSpec::id).collect(); + for n in &raw.not_run { + if !legs.contains(&n.leg) || !protocol.affinity.contains(&n.affinity) { + return mm(format!( + "not_run names unknown leg {} / {:?}", + n.leg, n.affinity + )); + } + } + // Exactly one control and one instrumented window per (leg, affinity, rep), unless + // that (leg, affinity) is listed in not_run, in which case none. + let mut seen = std::collections::BTreeSet::new(); + for w in &raw.windows { + let key = (w.leg.clone(), w.affinity, w.rep, w.instrumented); + if !legs.contains(&w.leg) || !protocol.affinity.contains(&w.affinity) { + return mm(format!( + "window for unknown leg {} / {:?}", + w.leg, w.affinity + )); + } + if w.rep >= protocol.reps { + return mm(format!("{} rep {} beyond protocol reps", w.leg, w.rep)); + } + if !seen.insert(key) { + return mm(format!("duplicate window {} rep {}", w.leg, w.rep)); + } + validate_window(w, &raw.discovery)?; + } + for leg in &legs { + for aff in &protocol.affinity { + let skipped = raw + .not_run + .iter() + .any(|n| &n.leg == leg && n.affinity == *aff); + for rep in 0..protocol.reps { + for instrumented in [false, true] { + let present = seen.contains(&(leg.clone(), *aff, rep, instrumented)); + if present == skipped { + return mm(format!( + "{leg} {aff:?} rep {rep} instrumented={instrumented}: {}", + if skipped { + "window present for a not_run leg" + } else { + "window missing" + } + )); + } + } + } + } + } + Ok(()) +} + +fn validate_window(w: &Window, discovery: &Discovery) -> Result<(), VerifyError> { + let at = format!("{} {:?} rep {}", w.leg, w.affinity, w.rep); + let mm = |m: String| Err(VerifyError::Mismatch(format!("{at}: {m}"))); + match (&w.pmu, w.instrumented) { + (PmuSample::Disabled, false) => return Ok(()), + (PmuSample::Disabled, true) => return mm("instrumented window has no PMU sample".into()), + (_, false) => return mm("control window carries a PMU sample".into()), + (PmuSample::InstrumentUnavailable { .. }, true) => return Ok(()), + (PmuSample::Counted { .. }, true) => {} + } + let PmuSample::Counted { readings } = &w.pmu else { + unreachable!() + }; + if discovery.devices.is_empty() { + return mm("counts present but discovery found no PMU".into()); + } + let mut expected = std::collections::BTreeSet::new(); + for d in &discovery.devices { + for spec in EVENTS { + expected.insert((d.name.clone(), spec.name.to_string())); + } + } + let mut got = std::collections::BTreeSet::new(); + for r in readings { + let Some(dev) = discovery.devices.iter().find(|d| d.name == r.pmu) else { + return mm(format!("reading names PMU {} absent from discovery", r.pmu)); + }; + if dev.core_class != r.core_class { + return mm(format!( + "{} {}: core class {:?}, discovery says {:?}", + r.pmu, r.event, r.core_class, dev.core_class + )); + } + let Some(spec) = EVENTS.iter().find(|s| s.name == r.event) else { + return mm(format!("unknown event {}", r.event)); + }; + if spec.arm_event != r.arm_event { + return mm(format!( + "{} event {:#06x}, architected number is {:#06x}", + r.event, r.arm_event, spec.arm_event + )); + } + if !dev + .events + .iter() + .any(|e| e.name == r.event && e.verified && e.arm_event == r.arm_event) + { + return mm(format!("{} {} not verified by discovery", r.pmu, r.event)); + } + let pinned = w.affinity == AffinityPolicy::Pinned(dev.core_class) + && dev.core_class != CoreClass::Unknown; + match classify(r.raw_count, r.time_enabled_ns, r.time_running_ns, pinned) { + Ok(state) if state == r.state => {} + Ok(state) => { + return mm(format!( + "{} {}: state {:?} but times say {:?}", + r.pmu, r.event, r.state, state + )) + } + Err(e) => return mm(format!("{} {}: {e}", r.pmu, r.event)), + } + if !got.insert((r.pmu.clone(), r.event.clone())) { + return mm(format!("{} {} read twice", r.pmu, r.event)); + } + } + if got != expected { + return mm("readings do not cover every discovered PMU and event exactly once".into()); + } + Ok(()) +} + +fn timing(windows: &[&Window]) -> TimingSummary { + let ok: Vec<&&Window> = windows.iter().filter(|w| w.error.is_none()).collect(); + let wall: Vec = ok.iter().map(|w| w.wall_ns).collect(); + let per_op: Vec = ok + .iter() + .filter(|w| w.ops > 0) + .map(|w| w.wall_ns / w.ops) + .collect(); + let cpu: Vec = ok.iter().map(|w| w.cpu_user_us + w.cpu_sys_us).collect(); + TimingSummary { + windows: windows.len(), + errors: windows.len() - ok.len(), + wall_ns: dist(&wall), + wall_ns_per_op: dist(&per_op), + cpu_us: dist(&cpu), + } +} + +fn state_code(s: CounterState) -> String { + enum_code(&s) +} + +fn pmu_summary(windows: &[&Window], classes: &[CoreClass]) -> PmuSummary { + let mut s = PmuSummary { + windows: windows.len(), + counted_windows: 0, + unavailable: BTreeMap::new(), + states: BTreeMap::new(), + events: Vec::new(), + ratios: Vec::new(), + }; + let mut per: BTreeMap<(CoreClass, String), (Vec, Vec)> = BTreeMap::new(); + let mut sums: BTreeMap, usize)> = BTreeMap::new(); + for w in windows { + match &w.pmu { + PmuSample::InstrumentUnavailable { reason, .. } => { + *s.unavailable.entry(enum_code(reason)).or_default() += 1; + } + PmuSample::Counted { readings } if w.error.is_none() => { + s.counted_windows += 1; + let mut classes_here = std::collections::BTreeSet::new(); + for r in readings { + *s.states.entry(state_code(r.state)).or_default() += 1; + if r.state == CounterState::NotScheduled { + continue; + } + let e = per.entry((r.core_class, r.event.clone())).or_default(); + e.0.push(r.raw_count); + e.1.push(r.raw_count / w.ops.max(1)); + let c = sums.entry(r.core_class).or_default(); + *c.0.entry(r.event.clone()).or_default() += u128::from(r.raw_count); + classes_here.insert(r.core_class); + } + for c in classes_here { + sums.entry(c).or_default().1 += 1; + } + } + _ => {} + } + } + for class in classes { + for spec in EVENTS { + if let Some((counts, per_op)) = per.get(&(*class, spec.name.to_string())) { + if let (Some(raw_count), Some(raw_count_per_op)) = (dist(counts), dist(per_op)) { + s.events.push(EventSummary { + core_class: *class, + event: spec.name.into(), + raw_count, + raw_count_per_op, + }); + } + } + } + if let Some((m, n)) = sums.get(class) { + let ratio = |num: &str, den: &str| { + let (a, b) = (m.get(num).copied()?, m.get(den).copied()?); + (b > 0).then(|| (a * 1000 / b) as u64) + }; + s.ratios.push(ClassRatios { + core_class: *class, + windows: *n, + instructions_per_kilocycle: ratio("inst_retired", "cpu_cycles"), + mispredicts_per_kilo_predicted_branches: ratio("br_mis_pred", "br_pred"), + }); + } + } + s +} + +/// Pure function of the protocol and raw bytes; `pmu-verify` requires `report.json` to +/// equal its pretty JSON byte for byte. +pub fn compute_report(protocol_bytes: &[u8], raw_bytes: &[u8]) -> Result { + let protocol: Protocol = parse(protocol_bytes, PROTOCOL_FILE)?; + protocol.validate().map_err(VerifyError::Protocol)?; + let raw: Raw = parse(raw_bytes, RAW_FILE)?; + let actual = sha256_hex(protocol_bytes); + if raw.protocol_sha256 != actual { + return Err(VerifyError::ProtocolDigest { + raw_says: raw.protocol_sha256, + actual, + }); + } + validate_raw(&protocol, &raw)?; + let mut classes: Vec = raw.discovery.devices.iter().map(|d| d.core_class).collect(); + classes.sort(); + classes.dedup(); + let mut legs = Vec::new(); + for leg in &protocol.legs { + let id = leg.id(); + for aff in &protocol.affinity { + if raw + .not_run + .iter() + .any(|n| n.leg == id && n.affinity == *aff) + { + continue; + } + let side = |instr: bool| -> Vec<&Window> { + raw.windows + .iter() + .filter(|w| w.leg == id && w.affinity == *aff && w.instrumented == instr) + .collect() + }; + let (control, instrumented) = (side(false), side(true)); + let (c, i) = (timing(&control), timing(&instrumented)); + let overhead_ppm_p50 = match (&c.wall_ns, &i.wall_ns) { + (Some(c), Some(i)) if c.p50 > 0 => Some( + ((i128::from(i.p50) - i128::from(c.p50)) * 1_000_000 / i128::from(c.p50)) + as i64, + ), + _ => None, + }; + legs.push(LegReport { + leg: id.clone(), + affinity: *aff, + pmu: pmu_summary(&instrumented, &classes), + control: c, + instrumented: i, + overhead_ppm_p50, + }); + } + } + Ok(Report { + schema: REPORT_SCHEMA.into(), + status: "DIAGNOSTIC_ONLY".into(), + protocol_sha256: actual, + raw_sha256: sha256_hex(raw_bytes), + legs, + not_run: raw.not_run.clone(), + notes: vec![ + "Hardware counts are supporting diagnostics, not performance claims and not qualification. Seconds per operation are the measured unit.".into(), + "Counts are user-space only (exclude_kernel, exclude_hv) and never scaled by time_enabled/time_running; a task blocked in fdatasync is off CPU and counts nothing.".into(), + "INSTRUMENT_UNAVAILABLE windows carry no counts. Energy is not measured by pmu-diag.".into(), + ], + }) +} + +/// `SHA256SUMS` text over `names` in `dir` (sha256sum format). +pub fn sha256sums(dir: &Path, names: &[&str]) -> Result { + let mut out = String::new(); + for name in names { + let bytes = fs::read(dir.join(name)).map_err(|e| format!("read {name}: {e}"))?; + out.push_str(&format!("{} {name}\n", sha256_hex(&bytes))); + } + Ok(out) +} + +fn verify_sums(dir: &Path) -> Result<(), VerifyError> { + let text = fs::read_to_string(dir.join(SUMS_FILE)) + .map_err(|e| VerifyError::ChecksumsMissing(format!("read {SUMS_FILE}: {e}")))?; + let mut listed = Vec::new(); + for (i, line) in text.lines().enumerate() { + let (digest, name) = line + .split_once(" ") + .filter(|(d, n)| d.len() == 64 && !n.is_empty()) + .ok_or_else(|| VerifyError::Parse(format!("{SUMS_FILE} line {}: {line:?}", i + 1)))?; + let bytes = fs::read(dir.join(name)).map_err(|e| { + VerifyError::ChecksumMismatch(format!("{name} listed but unreadable: {e}")) + })?; + let actual = sha256_hex(&bytes); + if actual != digest { + return Err(VerifyError::ChecksumMismatch(format!( + "{name} is {actual}, {SUMS_FILE} lists {digest}" + ))); + } + listed.push(name.to_string()); + } + let missing: Vec<&str> = [PROTOCOL_FILE, RAW_FILE, REPORT_FILE] + .into_iter() + .filter(|n| !listed.iter().any(|l| l == n)) + .collect(); + if missing.is_empty() { + Ok(()) + } else { + Err(VerifyError::ChecksumsMissing(format!( + "{SUMS_FILE} does not list {}", + missing.join(", ") + ))) + } +} + +/// Recompute `report.json` from `protocol.json` and `raw.json`, require a byte-for-byte +/// match, then check `SHA256SUMS`. Consistency only: authenticity comes from git history. +pub fn verify_evidence(dir: &Path) -> Result { + let read = + |name: &str| fs::read(dir.join(name)).map_err(|e| VerifyError::Io(format!("{name}: {e}"))); + let (protocol, raw, sealed) = (read(PROTOCOL_FILE)?, read(RAW_FILE)?, read(REPORT_FILE)?); + let report = compute_report(&protocol, &raw)?; + let again = serde_json::to_vec_pretty(&report) + .map_err(|e| VerifyError::Parse(format!("serialize report: {e}")))?; + if again != sealed { + let first_difference_at = again + .iter() + .zip(&sealed) + .position(|(a, b)| a != b) + .unwrap_or(again.len().min(sealed.len())); + return Err(VerifyError::ReportMismatch { + first_difference_at, + }); + } + verify_sums(dir)?; + Ok(report) +} + +/// Host-side inputs for one `pmu-diag` run. +#[derive(Debug, Clone)] +pub struct DiagConfig { + /// Holds `protocol.json`; `raw.json`, `report.json` and `SHA256SUMS` are written here. + pub evidence_dir: PathBuf, + pub fixture_repo: Option, + /// Scratch directory on the store filesystem (removed per window). + pub work_dir: PathBuf, + pub source_rev: String, + pub siblings: Vec, + pub invocation: Vec, + pub discovery: Discovery, +} + +/// What a measured closure did. +struct Work { + ops: u64, + error: Option, +} + +/// Run one window: open counters (instrumented only), start the clock and the rusage +/// window, enable, run `work`, stop the clock, read the counters. +fn measure( + discovery: &Discovery, + affinity: AffinityPolicy, + instrumented: bool, + work: impl FnOnce() -> Work, +) -> (Work, u64, u64, u64, PmuSample) { + let mode = if instrumented { + PmuMode::Enabled + } else { + PmuMode::Disabled + }; + let mut session = PmuSession::open(LinuxPerf, mode, discovery, affinity); + let ru0 = sample_self().unwrap_or_default(); + session.start(); + let t = Instant::now(); + let done = work(); + let wall_ns = t.elapsed().as_nanos() as u64; + let sample = session.stop(); + let ru1 = sample_self().unwrap_or_default(); + ( + done, + wall_ns, + ru1.user_us.saturating_sub(ru0.user_us), + ru1.sys_us.saturating_sub(ru0.sys_us), + sample, + ) +} + +/// Loaded fixture shared by the write, query and crumb legs. +struct FixtureData { + base: BaseTree, + full: Vec<(String, FileMode, Vec)>, + files: Vec, +} + +/// One Synapse service plus the identities that sign its requests. +struct Svc { + svc: SynapseService, + ids: BenchIdentities, + base_oid: GitOid, + counter: u64, +} + +impl Svc { + fn open( + dir: &Path, + seed: u64, + agents: usize, + fsync: FsyncPolicy, + fx: &FixtureData, + ) -> Result { + let ids = synapse_arm::issue_identities(seed, agents, crate::unix_now_ms())?; + let mut svc = + synapse_arm::open_service(dir, &ids, fsync, RecoveryPolicy::StrictFailClosed)?; + let base_oid = synapse_arm::register_base(&mut svc, &fx.base.commit_hex, fx.full.clone())?; + Ok(Self { + svc, + ids, + base_oid, + counter: 0, + }) + } + + /// Signed read request, JSON round trip both ways (as `query.rs` does). + fn call( + &mut self, + payload: P, + api: impl FnOnce( + &mut SynapseService, + &synapse_auth::AuthenticatedRequest

, + u64, + ) -> synapse_core::SynapseResult, + ) -> Result + where + P: Serialize + DeserializeOwned, + R: Serialize + DeserializeOwned, + { + let resp = self.call_local(payload, api)?; + Ok(synapse_arm::wire_roundtrip(&resp)?.0) + } + + /// As [`Svc::call`] for responses without a JSON form (`CrumbContext`, + /// `ChangesetAdvisory`): the request is signed and round-tripped, the response is not. + fn call_local( + &mut self, + payload: P, + api: impl FnOnce( + &mut SynapseService, + &synapse_auth::AuthenticatedRequest

, + u64, + ) -> synapse_core::SynapseResult, + ) -> Result + where + P: Serialize + DeserializeOwned, + { + self.counter += 1; + let now = crate::unix_now_ms(); + let label = format!("pmu-diag/read/{}", self.counter); + let req = synapse_arm::build_read_request( + &self.ids.agents[0], + &self.ids.repo_id, + payload, + &label, + now, + )?; + let (decoded, _) = synapse_arm::wire_roundtrip(&req)?; + api(&mut self.svc, &decoded, now).map_err(|e| e.to_string()) + } + + fn all_pages( + &mut self, + make: impl Fn(PageRequest) -> P, + api: fn( + &mut SynapseService, + &synapse_auth::AuthenticatedRequest

, + u64, + ) -> synapse_core::SynapseResult>, + ) -> Result + where + P: Serialize + DeserializeOwned, + T: Serialize + DeserializeOwned, + { + let (mut cursor, mut snapshot): (Option, Option) = (None, None); + let mut items = 0; + loop { + let page = PageRequest { + cursor: cursor.clone(), + limit: DEFAULT_MAX_PAGE_SIZE, + min_visible_seq: None, + snapshot_seq: snapshot, + }; + let r = self.call(make(page), api)?; + items += r.items.len(); + snapshot = Some(r.snapshot_seq); + match r.next_cursor { + Some(next) => cursor = Some(next), + None => return Ok(items), + } + } + } +} + +fn floor_window(op: FloorOp, iterations: u64) -> impl FnOnce() -> Work { + use ed25519_dalek::{Signer, SigningKey, Verifier}; + let req = crate::floor::typical_request(); + let wire = serde_json::to_vec(&req).unwrap_or_default(); + let content = vec![0x42u8; crate::floor::TYPICAL_CONTENT_BYTES]; + let key = SigningKey::from_bytes(&[5u8; 32]); + let msg = vec![0x10u8; 256]; + let sig = key.sign(&msg); + let vk = key.verifying_key(); + move || { + for _ in 0..iterations { + match op { + FloorOp::Sha256Content12k => { + std::hint::black_box(Sha256::digest(std::hint::black_box(&content))); + } + FloorOp::Ed25519Verify => { + std::hint::black_box(vk.verify(std::hint::black_box(&msg), &sig).is_ok()); + } + FloorOp::EnvelopeValidate => { + std::hint::black_box(req.payload.envelope.validate().ok()); + } + FloorOp::JsonDecodeSubmitRequest => { + let r: Option< + synapse_auth::AuthenticatedRequest, + > = serde_json::from_slice(std::hint::black_box(&wire)).ok(); + std::hint::black_box(r); + } + } + } + Work { + ops: iterations, + error: None, + } + } +} + +/// Prepared service and workload for one write window (setup is outside the clock). +struct WriteSetup { + service: Mutex, + group: Option, + agents: Vec, + repo_id: synapse_core::RepoId, + base_oid: GitOid, + workload: Vec>, +} + +fn write_setup( + dir: &Path, + seed: u64, + rep: usize, + arm: WriteArm, + agents: usize, + ops_per_agent: usize, + fx: &FixtureData, +) -> Result { + let store_dir = dir.join("synapse-store"); + let (svc_dir, svc_fsync) = match arm { + WriteArm::EveryCommit => (store_dir.clone(), FsyncPolicy::EveryCommit), + // As the S3 arm: the service does admission and indexing; the measured store is + // the group-commit SharedStore. + WriteArm::GroupCommit => (dir.join("service-admission"), FsyncPolicy::EveryCommit), + }; + let s = Svc::open(&svc_dir, seed, agents, svc_fsync, fx)?; + let group = match arm { + WriteArm::EveryCommit => None, + WriteArm::GroupCommit => Some( + SharedStore::open( + &store_dir, + FsyncPolicy::GROUP_COMMIT_DEFAULT, + RecoveryPolicy::StrictFailClosed, + StoreLimits::default(), + ) + .map_err(|e| e.to_string())?, + ), + }; + Ok(WriteSetup { + workload: generate_write_workload(seed, rep, agents, ops_per_agent, &fx.files), + service: Mutex::new(s.svc), + group, + agents: s.ids.agents.clone(), + repo_id: s.ids.repo_id.clone(), + base_oid: s.base_oid, + }) +} + +fn write_window<'a>(setup: &'a WriteSetup, label: &'a str) -> impl FnOnce() -> Work + 'a { + move || { + let results: Vec> = std::thread::scope(|scope| { + let handles: Vec<_> = setup + .workload + .iter() + .enumerate() + .map(|(a, props)| { + scope.spawn(move || { + for p in props { + synapse_submit( + &setup.service, + setup.group.as_ref(), + &setup.agents[a], + &setup.repo_id, + setup.base_oid, + p, + &format!("{label}/a{a}/p{}", p.index), + )?; + } + Ok(props.len() as u64) + }) + }) + .collect(); + handles + .into_iter() + .map(|h| { + h.join() + .unwrap_or_else(|_| Err("agent thread panicked".into())) + }) + .collect() + }); + let mut ops = 0; + let mut error = None; + for r in results { + match r { + Ok(n) => ops += n, + Err(e) => error = error.or(Some(e)), + } + } + Work { ops, error } + } +} + +/// Populated query target: changesets and readable paths, chosen deterministically. +struct QueryPlan { + reads: Vec<(ChangesetId, String)>, + trees: Vec, + diffs: Vec, +} + +fn query_prepare( + dir: &Path, + seed: u64, + leg: &LegSpec, + fx: &FixtureData, +) -> Result<(Svc, QueryPlan), String> { + let LegSpec::Query { + populate_agents, + populate_ops_per_agent, + samples, + } = *leg + else { + return Err("not a query leg".into()); + }; + let mut s = Svc::open( + dir, + seed, + populate_agents, + FsyncPolicy::BatchWindow { max_records: 1024 }, + fx, + )?; + let workload = generate_write_workload( + seed, + 20_000, + populate_agents, + populate_ops_per_agent, + &fx.files, + ); + let mut readable = Vec::new(); + let mut changesets = Vec::new(); + for (a, props) in workload.iter().enumerate() { + for p in props { + let now = crate::unix_now_ms(); + let req = synapse_arm::build_submit_request( + &s.ids.agents[a], + &s.ids.repo_id, + s.base_oid, + p, + &format!("pmu-diag/query-pop/a{a}/p{}", p.index), + now, + )?; + let (decoded, _) = synapse_arm::wire_roundtrip(&req)?; + let cs = match s.svc.submit(&decoded, now).map_err(|e| e.to_string())? { + IngestOutcome::Committed { changeset_id, .. } + | IngestOutcome::IdempotentDuplicate { changeset_id, .. } => changeset_id, + }; + changesets.push(cs); + for e in &p.edits { + if let EditOp::Upsert { .. } = e.op { + readable.push((cs, e.path.clone())); + } + } + } + } + s.svc.store_mut().sync_wal().map_err(|e| e.to_string())?; + if readable.is_empty() || changesets.is_empty() { + return Err("query population has no upserted files".into()); + } + let mut rng = SplitMix64::derive(seed, &[0x0E_E7, 64]); + let plan = QueryPlan { + reads: (0..samples) + .map(|_| readable[rng.below(readable.len())].clone()) + .collect(), + trees: (0..samples) + .map(|_| changesets[rng.below(changesets.len())]) + .collect(), + diffs: (0..samples) + .map(|_| changesets[rng.below(changesets.len())]) + .collect(), + }; + Ok((s, plan)) +} + +fn query_window<'a>(s: &'a mut Svc, plan: &'a QueryPlan) -> impl FnOnce() -> Work + 'a { + move || { + let mut ops = 0; + let base = TreeTarget::BaseGitCommit(s.base_oid); + let run = |s: &mut Svc, ops: &mut u64| -> Result<(), String> { + for (cs, path) in &plan.reads { + s.call( + (TreeTarget::Changeset(*cs), path.clone(), None::), + |svc, req, now| svc.read_file(req, now), + )?; + *ops += 1; + } + for cs in &plan.trees { + let target = TreeTarget::Changeset(*cs); + s.all_pages( + |page| TreeQueryPayload { + target, + path_prefix: None, + page, + }, + SynapseService::tree, + )?; + *ops += 1; + } + for cs in &plan.diffs { + let target = TreeTarget::Changeset(*cs); + s.all_pages( + |page| DiffQueryPayload { base, target, page }, + SynapseService::diff, + )?; + *ops += 1; + } + Ok(()) + }; + let error = run(s, &mut ops).err(); + Work { ops, error } + } +} + +/// Paths for crumb queries, or `None` when the fixture base has no `.crumb` file. +fn crumb_paths(fx: &FixtureData, seed: u64, samples: usize) -> Option> { + if !fx + .base + .entries + .iter() + .any(|e| e.path == ".crumb" || e.path.ends_with("/.crumb")) + { + return None; + } + let paths: Vec<&str> = fx.base.entries.iter().map(|e| e.path.as_str()).collect(); + let mut rng = SplitMix64::derive(seed, &[0xC2_0B, 64]); + Some( + (0..samples) + .map(|_| paths[rng.below(paths.len())].to_string()) + .collect(), + ) +} + +fn crumb_window<'a>(s: &'a mut Svc, paths: &'a [String]) -> impl FnOnce() -> Work + 'a { + move || { + let base = TreeTarget::BaseGitCommit(s.base_oid); + let mut ops = 0; + let mut run = || -> Result<(), String> { + for p in paths { + s.call_local( + CrumbContextQueryPayload { + target: base, + path: p.clone(), + snapshot_seq: None, + }, + |svc, req, now| svc.crumb_context(req, now), + )?; + ops += 1; + s.call_local( + ChangesetAdvisoryPayload { + base, + latest: None, + paths: vec![p.clone()], + agent: "pmu-diag".into(), + snapshot_seq: None, + }, + |svc, req, now| svc.changeset_advisory(req, None, now), + )?; + ops += 1; + } + Ok(()) + }; + let error = run().err(); + Work { ops, error } + } +} + +fn record( + windows: &mut Vec, + leg: &str, + affinity: AffinityPolicy, + rep: usize, + instrumented: bool, + m: (Work, u64, u64, u64, PmuSample), +) { + let (work, wall_ns, cpu_user_us, cpu_sys_us, pmu) = m; + windows.push(Window { + leg: leg.into(), + affinity, + rep, + instrumented, + ops: work.ops, + wall_ns, + cpu_user_us, + cpu_sys_us, + error: work.error, + pmu, + }); +} + +/// Run every leg of `protocol.json` in `cfg.evidence_dir`; write raw, report, sums. +/// Refuses to overwrite an existing `raw.json`. +pub fn run_diag(cfg: &DiagConfig) -> Result { + let protocol_bytes = fs::read(cfg.evidence_dir.join(PROTOCOL_FILE)) + .map_err(|e| format!("read {PROTOCOL_FILE}: {e}"))?; + let protocol: Protocol = + serde_json::from_slice(&protocol_bytes).map_err(|e| format!("{PROTOCOL_FILE}: {e}"))?; + protocol.validate()?; + let raw_path = cfg.evidence_dir.join(RAW_FILE); + if raw_path.exists() { + return Err(format!( + "{} exists; evidence is never overwritten", + raw_path.display() + )); + } + fs::create_dir_all(&cfg.work_dir).map_err(|e| format!("mkdir work dir: {e}"))?; + let needs_fixture = protocol.legs.iter().any(LegSpec::needs_fixture); + let fx = if needs_fixture { + let repo = cfg + .fixture_repo + .as_deref() + .ok_or("write, query and crumb legs need --fixture-repo")?; + let rev = protocol.fixture_rev.as_deref().unwrap_or_default(); + let base = fixture::list_base_tree(repo, rev)?; + let full = fixture::load_full_base(repo, &base)?; + let files = fixture::editable_from_full_base(&base, &full); + Some(FixtureData { base, full, files }) + } else { + None + }; + let manifest = Manifest { + invocation: cfg.invocation.clone(), + started_at: crate::utc_timestamp(), + host: collect_host_info(&cfg.work_dir), + build_profile: if cfg!(debug_assertions) { + "debug" + } else { + "release" + } + .into(), + target_arch: std::env::consts::ARCH.into(), + source_rev: cfg.source_rev.clone(), + fixture_repo: cfg.fixture_repo.as_ref().map(|p| p.display().to_string()), + fixture_commit: fx.as_ref().map(|f| f.base.commit_hex.clone()), + siblings: cfg.siblings.clone(), + clock: "std::time::Instant (CLOCK_MONOTONIC), wall nanoseconds per window".into(), + energy: "NOT_MEASURED by pmu-diag (energy stays with run, floor and bounds)".into(), + }; + let mut windows = Vec::new(); + let mut not_run = Vec::new(); + let seed = protocol.seed; + let scratch = cfg.work_dir.join("pmu-diag"); + for leg in &protocol.legs { + let id = leg.id(); + for &aff in &protocol.affinity { + let _pin = match apply_affinity(aff, &cfg.discovery) { + Ok(g) => g, + Err(reason) => { + not_run.push(NotRun { + leg: id.clone(), + affinity: aff, + reason, + }); + continue; + } + }; + let leg_dir = scratch.join(id.replace(['/', '='], "_")).join(aff.code()); + let _ = fs::remove_dir_all(&leg_dir); + let outcome = run_leg( + cfg, + &protocol, + leg, + &id, + aff, + seed, + fx.as_ref(), + &leg_dir, + &mut windows, + ); + let _ = fs::remove_dir_all(&leg_dir); + if let Err(reason) = outcome { + windows.retain(|w| !(w.leg == id && w.affinity == aff)); + not_run.push(NotRun { + leg: id.clone(), + affinity: aff, + reason, + }); + } + } + } + let raw = Raw { + schema: RAW_SCHEMA.into(), + protocol_sha256: sha256_hex(&protocol_bytes), + manifest, + discovery: cfg.discovery.clone(), + windows, + not_run, + }; + let raw_bytes = serde_json::to_vec_pretty(&raw).map_err(|e| e.to_string())?; + let report = compute_report(&protocol_bytes, &raw_bytes).map_err(|e| e.to_string())?; + let report_bytes = serde_json::to_vec_pretty(&report).map_err(|e| e.to_string())?; + fs::write(&raw_path, &raw_bytes).map_err(|e| format!("write {RAW_FILE}: {e}"))?; + fs::write(cfg.evidence_dir.join(REPORT_FILE), &report_bytes) + .map_err(|e| format!("write {REPORT_FILE}: {e}"))?; + let sums = sha256sums(&cfg.evidence_dir, &[PROTOCOL_FILE, RAW_FILE, REPORT_FILE])?; + fs::write(cfg.evidence_dir.join(SUMS_FILE), sums) + .map_err(|e| format!("write {SUMS_FILE}: {e}"))?; + Ok(report) +} + +/// Run every repetition of one (leg, affinity). A setup failure (not a window error) +/// returns `Err` and the caller records the pair as not run. +#[allow(clippy::too_many_arguments)] +fn run_leg( + cfg: &DiagConfig, + protocol: &Protocol, + leg: &LegSpec, + id: &str, + aff: AffinityPolicy, + seed: u64, + fx: Option<&FixtureData>, + leg_dir: &Path, + windows: &mut Vec, +) -> Result<(), String> { + let d = &cfg.discovery; + let fixture = || fx.ok_or_else(|| "fixture not loaded".to_string()); + match leg { + LegSpec::Floor { op, iterations } => { + // One untimed warm-up pass so the first control window is not cold. + floor_window(*op, (*iterations / 10).max(1))(); + for rep in 0..protocol.reps { + for instrumented in [false, true] { + let m = measure(d, aff, instrumented, floor_window(*op, *iterations)); + record(windows, id, aff, rep, instrumented, m); + } + } + } + LegSpec::Write { + arm, + agents, + ops_per_agent, + } => { + let fx = fixture()?; + for rep in 0..protocol.reps { + for instrumented in [false, true] { + let dir = + leg_dir.join(format!("r{rep}-{}", if instrumented { "i" } else { "c" })); + let setup = write_setup(&dir, seed, rep, *arm, *agents, *ops_per_agent, fx)?; + let label = format!("pmu-diag/{id}/{}/r{rep}/{instrumented}", aff.code()); + let m = measure(d, aff, instrumented, write_window(&setup, &label)); + drop(setup); + let _ = fs::remove_dir_all(&dir); + record(windows, id, aff, rep, instrumented, m); + } + } + } + LegSpec::Query { .. } => { + let fx = fixture()?; + let (mut s, plan) = query_prepare(leg_dir, seed, leg, fx)?; + // Untimed warm-up: materialize every virtual tree the windows will read. + let warm = query_window(&mut s, &plan)(); + if let Some(e) = warm.error { + return Err(format!("query warm-up: {e}")); + } + for rep in 0..protocol.reps { + for instrumented in [false, true] { + let m = measure(d, aff, instrumented, query_window(&mut s, &plan)); + record(windows, id, aff, rep, instrumented, m); + } + } + } + LegSpec::Crumb { samples } => { + let fx = fixture()?; + let paths = crumb_paths(fx, seed, *samples).ok_or( + "fixture base has no .crumb file: no representative Crumb fixture (NOT_RUN)", + )?; + let mut s = Svc::open(leg_dir, seed, 1, FsyncPolicy::EveryCommit, fx)?; + let warm = crumb_window(&mut s, &paths)(); + if let Some(e) = warm.error { + return Err(format!("crumb warm-up: {e}")); + } + for rep in 0..protocol.reps { + for instrumented in [false, true] { + let m = measure(d, aff, instrumented, crumb_window(&mut s, &paths)); + record(windows, id, aff, rep, instrumented, m); + } + } + } + } + Ok(()) +} + +/// `UnavailableReason` codes as they appear in reports. +pub fn reason_code(r: UnavailableReason) -> String { + enum_code(&r) +} + +#[cfg(test)] +mod tests; diff --git a/crates/synapse-bench/src/pmu_diag/tests.rs b/crates/synapse-bench/src/pmu_diag/tests.rs new file mode 100644 index 0000000..ea95b76 --- /dev/null +++ b/crates/synapse-bench/src/pmu_diag/tests.rs @@ -0,0 +1,861 @@ +//! Issue #64 acceptance tests. Portable: no test needs PMU access; the real-host test +//! accepts either valid counts or a typed refusal and fails on anything else. + +use super::*; +use crate::fixture::test_support::{make_fixture_repo, temp_dir}; +use crate::gitcmd::{git_line, git_ok}; +use crate::pmu::{ + discover, event_attr, CounterReading, PerfBackend, PerfEventAttr, ATTR_FLAG_DISABLED, + ATTR_FLAG_EXCLUDE_HV, ATTR_FLAG_EXCLUDE_KERNEL, ATTR_FLAG_INHERIT, + PERF_FORMAT_TOTAL_TIME_ENABLED, PERF_FORMAT_TOTAL_TIME_RUNNING, +}; +use std::cell::RefCell; +use std::collections::VecDeque; +use std::rc::Rc; + +// ---------------------------------------------------------------- fake sysfs + +/// One fake PMU: name, type, cpu list, MIDR, and `(event name, sysfs text)` overrides. +struct FakePmu<'a> { + name: &'a str, + perf_type: u32, + cpus: &'a str, + midr: &'a str, + /// `None` removes the event file; `Some(text)` replaces the architected encoding. + overrides: &'a [(&'a str, Option<&'a str>)], +} + +const A725: FakePmu = FakePmu { + name: "armv8_pmuv3_0", + perf_type: 10, + cpus: "0-4,10-14", + midr: "0x00000000410fd871", + overrides: &[], +}; +const X925: FakePmu = FakePmu { + name: "armv8_pmuv3_1", + perf_type: 11, + cpus: "5-9,15-19", + midr: "0x00000000410fd851", + overrides: &[], +}; + +fn fake_sysfs(label: &str, pmus: &[FakePmu], paranoid: &str) -> (PathBuf, Discovery) { + let root = temp_dir(label); + let sys = root.join("sys"); + let devs = sys.join("bus/event_source/devices"); + fs::create_dir_all(devs.join("software")).unwrap(); + fs::write(devs.join("software/type"), "1\n").unwrap(); + for p in pmus { + let d = devs.join(p.name); + fs::create_dir_all(d.join("events")).unwrap(); + fs::write(d.join("type"), format!("{}\n", p.perf_type)).unwrap(); + fs::write(d.join("cpus"), format!("{}\n", p.cpus)).unwrap(); + for spec in EVENTS { + let text = match p.overrides.iter().find(|(n, _)| *n == spec.name) { + Some((_, None)) => continue, + Some((_, Some(t))) => t.to_string(), + None => format!("event={:#06x}", spec.arm_event), + }; + fs::write(d.join("events").join(spec.name), format!("{text}\n")).unwrap(); + } + for c in crate::pmu::parse_cpu_list(p.cpus).unwrap() { + let m = sys.join(format!("devices/system/cpu/cpu{c}/regs/identification")); + fs::create_dir_all(&m).unwrap(); + fs::write(m.join("midr_el1"), format!("{}\n", p.midr)).unwrap(); + } + } + let paranoid_path = root.join("perf_event_paranoid"); + fs::write(¶noid_path, format!("{paranoid}\n")).unwrap(); + let d = discover(&sys, ¶noid_path); + (root, d) +} + +// ---------------------------------------------------------------- fake backend + +#[derive(Default)] +struct FakeLog { + calls: Vec, + opened: Vec, + open_fds: Vec, +} + +/// Scripted `perf_event_open`: fails the `fail_at`-th open with `errno`, otherwise hands +/// out fds; reads pop from `reads` (or fail with EIO when empty). +struct FakePerf { + log: Rc>, + fail_at: Option<(usize, i32)>, + reads: VecDeque<[u64; 3]>, + next_fd: i32, +} + +impl FakePerf { + fn new(log: &Rc>) -> Self { + Self { + log: log.clone(), + fail_at: None, + reads: VecDeque::new(), + next_fd: 100, + } + } +} + +impl PerfBackend for FakePerf { + fn open(&mut self, attr: &PerfEventAttr, group_fd: i32) -> Result { + let mut log = self.log.borrow_mut(); + let n = log.opened.len(); + log.calls.push(format!( + "open type={} config={:#x} group={group_fd}", + attr.type_, attr.config + )); + log.opened.push(*attr); + if let Some((at, errno)) = self.fail_at { + if n == at { + return Err(errno); + } + } + self.next_fd += 1; + log.open_fds.push(self.next_fd); + Ok(self.next_fd) + } + fn ioctl_group(&mut self, fd: i32, request: u64) -> Result<(), i32> { + self.log + .borrow_mut() + .calls + .push(format!("ioctl {fd} {request:#x}")); + Ok(()) + } + fn read3(&mut self, fd: i32) -> Result<[u64; 3], i32> { + self.log.borrow_mut().calls.push(format!("read {fd}")); + self.reads.pop_front().ok_or(libc::EIO) + } + fn close(&mut self, fd: i32) { + let mut log = self.log.borrow_mut(); + log.calls.push(format!("close {fd}")); + log.open_fds.retain(|f| *f != fd); + } +} + +fn session_with( + discovery: &Discovery, + affinity: AffinityPolicy, + fail_at: Option<(usize, i32)>, + reads: &[[u64; 3]], +) -> (PmuSample, Rc>) { + let log = Rc::new(RefCell::new(FakeLog::default())); + let mut fake = FakePerf::new(&log); + fake.fail_at = fail_at; + fake.reads = reads.iter().copied().collect(); + let mut s = PmuSession::open(fake, PmuMode::Enabled, discovery, affinity); + s.start(); + let sample = s.stop(); + (sample, log) +} + +// ---------------------------------------------------------------- acceptance 1 + +#[test] +fn acceptance1_discovery_verifies_encodings_and_core_classes() { + let (_root, d) = fake_sysfs("disc", &[A725, X925], "2"); + assert_eq!(d.perf_event_paranoid, Some(2)); + assert_eq!(d.devices.len(), 2, "the software PMU is not a CPU PMU"); + assert_eq!(d.devices[0].core_class, CoreClass::CortexA725); + assert_eq!(d.devices[1].core_class, CoreClass::CortexX925); + assert_eq!(d.devices[0].cpus, vec![0, 1, 2, 3, 4, 10, 11, 12, 13, 14]); + assert!(d.devices.iter().all(|x| x.all_events_verified())); + assert_eq!(crate::pmu::parse_event_encoding("event=0x0010"), Some(0x10)); + assert_eq!(crate::pmu::parse_cpu_list("4-2"), None); +} + +#[test] +fn acceptance1_event_attr_is_user_only_inherited_counting() { + let a = event_attr(11, 0x10, true); + assert_eq!(std::mem::size_of::(), 64); + assert_eq!((a.type_, a.size, a.config), (11, 64, 0x10)); + assert_eq!(a.sample_period, 0, "counting, never sampling"); + assert_eq!( + a.read_format, + PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_TOTAL_TIME_RUNNING + ); + assert_eq!( + a.flags, + ATTR_FLAG_DISABLED | ATTR_FLAG_INHERIT | ATTR_FLAG_EXCLUDE_KERNEL | ATTR_FLAG_EXCLUDE_HV + ); + assert_eq!(event_attr(11, 0x08, false).flags & ATTR_FLAG_DISABLED, 0); +} + +#[test] +fn acceptance1_disabled_mode_makes_no_system_call() { + let (_root, d) = fake_sysfs("disabled", &[A725, X925], "2"); + let log = Rc::new(RefCell::new(FakeLog::default())); + let mut s = PmuSession::open( + FakePerf::new(&log), + PmuMode::Disabled, + &d, + AffinityPolicy::Unpinned, + ); + s.start(); + assert_eq!(s.stop(), PmuSample::Disabled); + assert!( + log.borrow().calls.is_empty(), + "calls: {:?}", + log.borrow().calls + ); +} + +#[test] +fn acceptance1_counted_reads_are_raw_and_attributed_per_core_class() { + let (_root, d) = fake_sysfs("counted", &[A725, X925], "2"); + // A725 group ran the whole window; X925 group never ran (task pinned elsewhere). + let reads = [ + [1000, 50, 50], + [800, 50, 50], + [90, 50, 50], + [7, 50, 50], + [0, 50, 0], + [0, 50, 0], + [0, 50, 0], + [0, 50, 0], + ]; + let (sample, log) = session_with( + &d, + AffinityPolicy::Pinned(CoreClass::CortexA725), + None, + &reads, + ); + let PmuSample::Counted { readings } = sample else { + panic!("expected counts, got {sample:?}") + }; + assert_eq!(readings.len(), 8); + assert_eq!(readings[0].core_class, CoreClass::CortexA725); + assert_eq!( + (readings[0].event.as_str(), readings[0].raw_count), + ("cpu_cycles", 1000) + ); + assert_eq!(readings[3].state, CounterState::Counted); + assert_eq!(readings[4].core_class, CoreClass::CortexX925); + assert_eq!(readings[4].state, CounterState::NotScheduled); + let log = log.borrow(); + assert!(log.open_fds.is_empty(), "every fd closed"); + // Each PMU's events are opened by that PMU's own type, siblings in the leader's group. + let types: Vec = log.opened.iter().map(|a| a.type_).collect(); + assert_eq!(types, vec![10, 10, 10, 10, 11, 11, 11, 11]); + assert!(log.calls[1].ends_with("group=101"), "{}", log.calls[1]); +} + +#[test] +fn acceptance1_multiplexed_and_partial_residency_are_labelled_not_scaled() { + let (_root, d) = fake_sysfs("mux", &[A725], "2"); + let reads = [[600, 100, 40]; 4]; + let (pinned, _) = session_with( + &d, + AffinityPolicy::Pinned(CoreClass::CortexA725), + None, + &reads, + ); + let PmuSample::Counted { readings } = pinned else { + panic!("{pinned:?}") + }; + assert!(readings + .iter() + .all(|r| r.state == CounterState::Multiplexed)); + assert!( + readings.iter().all(|r| r.raw_count == 600), + "never scaled to 1500" + ); + let (unpinned, _) = session_with(&d, AffinityPolicy::Unpinned, None, &reads); + let PmuSample::Counted { readings } = unpinned else { + panic!("{unpinned:?}") + }; + assert!(readings + .iter() + .all(|r| r.state == CounterState::PartialResidency)); +} + +#[test] +fn acceptance1_permission_denied_is_instrument_unavailable_without_counts() { + let (_root, d) = fake_sysfs("eacces", &[A725, X925], "4"); + // Fails on the first event of the second PMU, after four fds were opened. + let (sample, log) = session_with(&d, AffinityPolicy::Unpinned, Some((4, libc::EACCES)), &[]); + match &sample { + PmuSample::InstrumentUnavailable { reason, detail } => { + assert_eq!(*reason, UnavailableReason::PermissionDenied); + assert!(detail.contains("armv8_pmuv3_1"), "{detail}"); + } + other => panic!("expected refusal, got {other:?}"), + } + assert!( + log.borrow().open_fds.is_empty(), + "fds opened before the refusal are closed" + ); + assert!( + !log.borrow().calls.iter().any(|c| c.starts_with("read")), + "nothing read" + ); + let json = serde_json::to_value(&sample).unwrap(); + assert_eq!(json["status"], "INSTRUMENT_UNAVAILABLE"); + assert_eq!(json["reason"], "PERMISSION_DENIED"); + assert!( + json.get("readings").is_none(), + "a refusal carries no counts: {json}" + ); +} + +#[test] +fn acceptance1_unsupported_or_missing_pmu_refuses_before_any_open() { + let wrong = FakePmu { + overrides: &[("br_mis_pred", Some("event=0x0022"))], + ..A725 + }; + let missing = FakePmu { + overrides: &[("br_pred", None)], + ..X925 + }; + for (label, pmus) in [("wrong-enc", vec![wrong]), ("missing-ev", vec![missing])] { + let (_root, d) = fake_sysfs(label, &pmus, "2"); + let (sample, log) = session_with(&d, AffinityPolicy::Unpinned, None, &[]); + assert!( + matches!( + sample, + PmuSample::InstrumentUnavailable { + reason: UnavailableReason::UnsupportedEvent, + .. + } + ), + "{label}: {sample:?}" + ); + assert!( + log.borrow().calls.is_empty(), + "{label}: no open for an unverified event" + ); + } + let (_root, none) = fake_sysfs("no-pmu", &[], "2"); + let (sample, _) = session_with(&none, AffinityPolicy::Unpinned, None, &[]); + assert!(matches!( + sample, + PmuSample::InstrumentUnavailable { + reason: UnavailableReason::NoPmu, + .. + } + )); + let (_root, d) = fake_sysfs("enoent", &[A725], "2"); + let (sample, _) = session_with(&d, AffinityPolicy::Unpinned, Some((0, libc::ENOENT)), &[]); + assert!(matches!( + sample, + PmuSample::InstrumentUnavailable { + reason: UnavailableReason::UnsupportedEvent, + .. + } + )); + assert_eq!( + UnavailableReason::from_open_errno(libc::ENOSYS), + UnavailableReason::UnsupportedPlatform + ); + assert_eq!( + UnavailableReason::from_open_errno(libc::EBUSY), + UnavailableReason::CounterUnavailable + ); +} + +#[test] +fn acceptance1_malformed_reads_are_refused_never_repaired() { + assert!(classify(5, 10, 11, true).is_err(), "running beyond enabled"); + assert!( + classify(5, 10, 0, true).is_err(), + "count with no running time" + ); + let (_root, d) = fake_sysfs("malformed", &[A725], "2"); + for reads in [ + vec![[5, 10, 11]; 4], + vec![[5, 10, 0]; 4], + vec![[5, 10, 10]; 2], + ] { + let (sample, log) = session_with(&d, AffinityPolicy::Unpinned, None, &reads); + assert!( + matches!( + sample, + PmuSample::InstrumentUnavailable { + reason: UnavailableReason::CounterUnavailable, + .. + } + ), + "{reads:?}: {sample:?}" + ); + assert!(log.borrow().open_fds.is_empty()); + } +} + +#[test] +fn acceptance1_real_host_sample_is_counted_or_typed_unavailable() { + // Runs on any host: CI (no PMU or no permission) and the Spark alike. + let d = crate::pmu::discover_host(); + let mut s = PmuSession::open(LinuxPerf, PmuMode::Enabled, &d, AffinityPolicy::Unpinned); + s.start(); + let mut x = 0u64; + for i in 0..100_000u64 { + x = std::hint::black_box(x.wrapping_mul(31).wrapping_add(i)); + } + let sample = s.stop(); + let w = Window { + leg: "floor/sha256_content_12k".into(), + affinity: AffinityPolicy::Unpinned, + rep: 0, + instrumented: true, + ops: 1, + wall_ns: 1, + cpu_user_us: 0, + cpu_sys_us: 0, + error: None, + pmu: sample.clone(), + }; + validate_window(&w, &d).unwrap_or_else(|e| panic!("{e}: {sample:?}")); + if let PmuSample::Counted { readings } = &sample { + assert!(readings + .iter() + .any(|r| r.event == "inst_retired" && r.raw_count > 0)); + } +} + +// ---------------------------------------------------------------- schema + +fn floor_protocol() -> Protocol { + Protocol { + schema: PROTOCOL_SCHEMA.into(), + purpose: "test".into(), + seed: 7, + fixture_rev: None, + reps: 2, + order: ORDER.into(), + affinity: vec![AffinityPolicy::Unpinned], + legs: vec![LegSpec::Floor { + op: FloorOp::Sha256Content12k, + iterations: 50, + }], + held_out: "nothing tuned".into(), + } +} + +#[test] +fn acceptance1_schema_protocol_refuses_bad_plans() { + assert!(floor_protocol().validate().is_ok()); + let mut p = floor_protocol(); + p.schema = "synapse-bench/pmu-diag-protocol/v0".into(); + assert!(p.validate().is_err()); + let mut p = floor_protocol(); + p.order = "instrumented-then-control".into(); + assert!(p.validate().is_err()); + let mut p = floor_protocol(); + p.legs.push(p.legs[0].clone()); + assert!(p.validate().unwrap_err().contains("twice")); + let mut p = floor_protocol(); + p.legs.push(LegSpec::Crumb { samples: 1 }); + assert!(p.validate().unwrap_err().contains("fixture_rev")); + let mut p = floor_protocol(); + p.reps = 0; + assert!(p.validate().is_err()); + let json = serde_json::to_string(&floor_protocol()).unwrap(); + let extra = json.replacen('{', "{\"tuned\":true,", 1); + assert!( + serde_json::from_str::(&extra).is_err(), + "unknown fields refused" + ); + let leg: LegSpec = serde_json::from_str( + r#"{"kind":"write","arm":"group_commit","agents":8,"ops_per_agent":4}"#, + ) + .unwrap(); + assert_eq!(leg.id(), "write/group_commit/agents=8"); +} + +/// Write a protocol and run `pmu-diag` against it with `discovery`. +fn run_in( + label: &str, + protocol: &Protocol, + fixture_repo: Option, + discovery: Discovery, +) -> (PathBuf, Report) { + let root = temp_dir(label); + let ev = root.join("evidence"); + fs::create_dir_all(&ev).unwrap(); + fs::write( + ev.join(PROTOCOL_FILE), + serde_json::to_vec_pretty(protocol).unwrap(), + ) + .unwrap(); + let cfg = DiagConfig { + evidence_dir: ev.clone(), + fixture_repo, + work_dir: root.join("work"), + source_rev: "0123abcd".into(), + siblings: vec![SiblingRev { + name: "omega".into(), + rev: "feedface".into(), + }], + invocation: vec!["synapse-bench".into(), "pmu-diag".into()], + discovery, + }; + let report = run_diag(&cfg).unwrap(); + (ev, report) +} + +fn read_raw(ev: &Path) -> Raw { + serde_json::from_slice(&fs::read(ev.join(RAW_FILE)).unwrap()).unwrap() +} + +/// Rewrite `raw.json` with `edit`, then regenerate report and sums so only the +/// semantic checks (not the digests) can catch the change. +fn tamper_consistently(ev: &Path, edit: impl FnOnce(&mut Raw)) -> VerifyError { + let names = [PROTOCOL_FILE, RAW_FILE, REPORT_FILE, SUMS_FILE]; + let saved: Vec> = names + .iter() + .map(|n| fs::read(ev.join(n)).unwrap()) + .collect(); + let err = tamper_once(ev, edit); + for (n, bytes) in names.iter().zip(saved) { + fs::write(ev.join(n), bytes).unwrap(); + } + err +} + +fn tamper_once(ev: &Path, edit: impl FnOnce(&mut Raw)) -> VerifyError { + let mut raw = read_raw(ev); + edit(&mut raw); + let raw_bytes = serde_json::to_vec_pretty(&raw).unwrap(); + fs::write(ev.join(RAW_FILE), &raw_bytes).unwrap(); + let protocol = fs::read(ev.join(PROTOCOL_FILE)).unwrap(); + match compute_report(&protocol, &raw_bytes) { + Ok(r) => { + fs::write(ev.join(REPORT_FILE), serde_json::to_vec_pretty(&r).unwrap()).unwrap(); + let sums = sha256sums(ev, &[PROTOCOL_FILE, RAW_FILE, REPORT_FILE]).unwrap(); + fs::write(ev.join(SUMS_FILE), sums).unwrap(); + verify_evidence(ev).expect_err("tampered evidence verified") + } + Err(e) => e, + } +} + +fn counted(class: CoreClass, pmu: &str, state: CounterState, t: [u64; 3]) -> Vec { + EVENTS + .iter() + .map(|spec| CounterReading { + event: spec.name.into(), + arm_event: spec.arm_event, + pmu: pmu.into(), + core_class: class, + raw_count: t[0], + time_enabled_ns: t[1], + time_running_ns: t[2], + state, + }) + .collect() +} + +#[test] +fn acceptance1_verify_refuses_mismatched_pmu_output() { + let (_root, d) = fake_sysfs("mismatch-disc", &[A725], "2"); + let good = || PmuSample::Counted { + readings: counted( + CoreClass::CortexA725, + "armv8_pmuv3_0", + CounterState::Counted, + [9, 5, 5], + ), + }; + // The run itself sees no PMU (no real counter is opened from a fake sysfs); the + // edits below install the fake discovery and synthetic, contract-valid counts. + let (_e, empty) = fake_sysfs("mismatch-empty", &[], "2"); + let (ev, _) = run_in("mismatch", &floor_protocol(), None, empty); + let set_counts = |raw: &mut Raw, s: PmuSample| { + for w in raw.windows.iter_mut().filter(|w| w.instrumented) { + w.pmu = s.clone(); + } + }; + // Baseline: synthetic valid counts verify (the control for every refusal below). + let mut raw = read_raw(&ev); + raw.discovery = d.clone(); + set_counts(&mut raw, good()); + let bytes = serde_json::to_vec_pretty(&raw).unwrap(); + let protocol = fs::read(ev.join(PROTOCOL_FILE)).unwrap(); + let report = compute_report(&protocol, &bytes).expect("valid counts verify"); + assert_eq!(report.legs[0].pmu.counted_windows, 2); + assert_eq!( + report.legs[0].pmu.ratios[0].instructions_per_kilocycle, + Some(1000) + ); + + type Edit = Box)>; + let cases: Vec<(&str, Edit)> = vec![ + ( + "unknown pmu", + Box::new(|r| r[0].pmu = "armv8_pmuv3_9".into()), + ), + ( + "wrong class", + Box::new(|r| r[1].core_class = CoreClass::CortexX925), + ), + ("wrong event number", Box::new(|r| r[2].arm_event = 0x22)), + ( + "state contradicts times", + Box::new(|r| r[3].state = CounterState::Multiplexed), + ), + ( + "running beyond enabled", + Box::new(|r| r[0].time_running_ns = 6), + ), + ( + "missing event", + Box::new(|r| { + r.pop(); + }), + ), + ( + "duplicate event", + Box::new(|r| { + let x = r[0].clone(); + r[1] = x; + }), + ), + ]; + for (label, edit) in cases { + let mut readings = counted( + CoreClass::CortexA725, + "armv8_pmuv3_0", + CounterState::Counted, + [9, 5, 5], + ); + edit(&mut readings); + let d2 = d.clone(); + let err = tamper_consistently(&ev, move |raw| { + raw.discovery = d2; + for w in raw.windows.iter_mut().filter(|w| w.instrumented) { + w.pmu = PmuSample::Counted { + readings: readings.clone(), + }; + } + }); + assert!(matches!(err, VerifyError::Mismatch(_)), "{label}: {err}"); + } + // Window-level contract. + let err = tamper_consistently(&ev, |raw| raw.windows[0].pmu = good()); + assert!( + matches!(err, VerifyError::Mismatch(ref m) if m.contains("control")), + "{err}" + ); + let err = tamper_consistently(&ev, |raw| { + let i = raw.windows.iter().position(|w| w.instrumented).unwrap(); + raw.windows[i].pmu = PmuSample::Disabled; + }); + assert!(matches!(err, VerifyError::Mismatch(_)), "{err}"); + let err = tamper_consistently(&ev, |raw| { + raw.windows.pop(); + }); + assert!( + matches!(err, VerifyError::Mismatch(ref m) if m.contains("missing")), + "{err}" + ); + let err = tamper_consistently(&ev, move |raw| { + raw.discovery.devices.clear(); + set_counts(raw, good()); + }); + assert!( + matches!(err, VerifyError::Mismatch(ref m) if m.contains("no PMU")), + "{err}" + ); +} + +// ---------------------------------------------------------------- acceptance 3 + +#[test] +fn acceptance3_report_recomputes_from_raw_and_digests_verify() { + let (_root, d) = fake_sysfs("a3-disc", &[], "4"); + let (ev, report) = run_in("a3", &floor_protocol(), None, d); + assert_eq!(report.status, "DIAGNOSTIC_ONLY"); + let again = verify_evidence(&ev).expect("fresh evidence verifies"); + assert_eq!(again, report); + let leg = &report.legs[0]; + assert_eq!((leg.control.windows, leg.instrumented.windows), (2, 2)); + assert_eq!(leg.pmu.unavailable.get("NO_PMU"), Some(&2)); + assert!( + leg.pmu.events.is_empty(), + "no counts invented for refused windows" + ); + assert!(leg.overhead_ppm_p50.is_some()); + assert!(run_diag(&DiagConfig { + evidence_dir: ev.clone(), + fixture_repo: None, + work_dir: ev.join("w"), + source_rev: String::new(), + siblings: vec![], + invocation: vec![], + discovery: crate::pmu::discover(Path::new("/nonexistent"), Path::new("/nonexistent")), + }) + .unwrap_err() + .contains("never overwritten")); + + // Tampering: each sealed file is checked. + let raw0 = fs::read(ev.join(RAW_FILE)).unwrap(); + let report0 = fs::read(ev.join(REPORT_FILE)).unwrap(); + let protocol0 = fs::read(ev.join(PROTOCOL_FILE)).unwrap(); + let sums0 = fs::read(ev.join(SUMS_FILE)).unwrap(); + let restore = || { + fs::write(ev.join(RAW_FILE), &raw0).unwrap(); + fs::write(ev.join(REPORT_FILE), &report0).unwrap(); + fs::write(ev.join(PROTOCOL_FILE), &protocol0).unwrap(); + fs::write(ev.join(SUMS_FILE), &sums0).unwrap(); + }; + let mut raw = read_raw(&ev); + raw.windows[0].wall_ns += 1; + fs::write(ev.join(RAW_FILE), serde_json::to_vec_pretty(&raw).unwrap()).unwrap(); + assert!(matches!( + verify_evidence(&ev), + Err(VerifyError::ReportMismatch { .. }) + )); + restore(); + let p = String::from_utf8(protocol0.clone()) + .unwrap() + .replace("\"reps\": 2", "\"reps\": 1"); + fs::write(ev.join(PROTOCOL_FILE), p).unwrap(); + assert!(matches!( + verify_evidence(&ev), + Err(VerifyError::ProtocolDigest { .. }) + )); + restore(); + let r = String::from_utf8(report0.clone()) + .unwrap() + .replace("DIAGNOSTIC_ONLY", "QUALIFIED"); + fs::write(ev.join(REPORT_FILE), r).unwrap(); + assert!(matches!( + verify_evidence(&ev), + Err(VerifyError::ReportMismatch { .. }) + )); + restore(); + fs::write(ev.join(SUMS_FILE), "").unwrap(); + assert!(matches!( + verify_evidence(&ev), + Err(VerifyError::ChecksumsMissing(_)) + )); + restore(); + let mut raw = read_raw(&ev); + raw.manifest.source_rev = "edited".into(); + let raw_bytes = serde_json::to_vec_pretty(&raw).unwrap(); + fs::write(ev.join(RAW_FILE), &raw_bytes).unwrap(); + let r = compute_report(&protocol0, &raw_bytes).unwrap(); + fs::write(ev.join(REPORT_FILE), serde_json::to_vec_pretty(&r).unwrap()).unwrap(); + assert!(matches!( + verify_evidence(&ev), + Err(VerifyError::ChecksumMismatch(_)) + )); + restore(); + verify_evidence(&ev).unwrap(); +} + +// ---------------------------------------------------------------- manifest attribution and legs + +const ROOT_CRUMB: &str = + r#"{"schema_version":"1.0.0","name":"root","purpose":"Root.","invariants":["root rule"]}"#; + +#[test] +fn acceptance1_manifest_attribution_and_every_leg_kind_runs() { + let root = temp_dir("legs-fixture"); + make_fixture_repo(&root, 6, 40); + let repo = root.join("fixture"); + fs::write(repo.join(".crumb"), ROOT_CRUMB).unwrap(); + git_ok(&repo, &[], &[], &["add", "-A"], None).unwrap(); + git_ok(&repo, &[], &[], &["commit", "-q", "-m", "crumb"], None).unwrap(); + let head = git_line(&repo, &["rev-parse", "HEAD"]).unwrap(); + let protocol = Protocol { + schema: PROTOCOL_SCHEMA.into(), + purpose: "test".into(), + seed: 11, + fixture_rev: Some("main".into()), + reps: 1, + order: ORDER.into(), + affinity: vec![ + AffinityPolicy::Unpinned, + AffinityPolicy::Pinned(CoreClass::CortexX925), + ], + legs: vec![ + LegSpec::Floor { + op: FloorOp::EnvelopeValidate, + iterations: 5, + }, + LegSpec::Write { + arm: WriteArm::EveryCommit, + agents: 2, + ops_per_agent: 1, + }, + LegSpec::Write { + arm: WriteArm::GroupCommit, + agents: 2, + ops_per_agent: 1, + }, + LegSpec::Query { + populate_agents: 2, + populate_ops_per_agent: 2, + samples: 2, + }, + LegSpec::Crumb { samples: 2 }, + ], + held_out: "nothing tuned".into(), + }; + // No PMU in this discovery: pinned legs cannot resolve a core class -> NOT_RUN. + let (_s, d) = fake_sysfs("legs-disc", &[], "4"); + let (ev, report) = run_in("legs", &protocol, Some(repo.clone()), d); + let raw = read_raw(&ev); + let m = &raw.manifest; + assert_eq!(m.fixture_commit.as_deref(), Some(head.as_str())); + assert_eq!( + m.fixture_repo.as_deref(), + Some(repo.display().to_string().as_str()) + ); + assert_eq!(m.source_rev, "0123abcd"); + assert_eq!(m.siblings[0].name, "omega"); + assert_eq!(m.invocation, vec!["synapse-bench", "pmu-diag"]); + assert!(!m.host.rustc_version.is_empty() && !m.host.kernel_release.is_empty()); + assert!(m.energy.starts_with("NOT_MEASURED")); + assert_eq!(raw.discovery.perf_event_paranoid, Some(4)); + assert_eq!(raw.not_run.len(), 5, "{:?}", raw.not_run); + assert!(raw + .not_run + .iter() + .all(|n| n.affinity == AffinityPolicy::Pinned(CoreClass::CortexX925))); + assert_eq!(report.legs.len(), 5); + for leg in &report.legs { + assert_eq!(leg.control.errors + leg.instrumented.errors, 0, "{leg:?}"); + assert_eq!(leg.affinity, AffinityPolicy::Unpinned); + } + let ops = |id: &str| { + raw.windows + .iter() + .find(|w| w.leg == id) + .map(|w| w.ops) + .unwrap() + }; + assert_eq!(ops("floor/envelope_validate"), 5); + assert_eq!(ops("write/every_commit/agents=2"), 2); + assert_eq!(ops("write/group_commit/agents=2"), 2); + assert_eq!(ops("query/read_tree_diff"), 6); + assert_eq!(ops("crumb/context_advisory"), 4); + for w in &raw.windows { + assert_eq!(w.instrumented, w.pmu != PmuSample::Disabled, "{w:?}"); + } + verify_evidence(&ev).unwrap(); +} + +#[test] +fn acceptance1_crumb_leg_without_crumb_fixture_is_not_run() { + let root = temp_dir("nocrumb-fixture"); + make_fixture_repo(&root, 3, 20); + let mut protocol = floor_protocol(); + protocol.fixture_rev = Some("main".into()); + protocol.reps = 1; + protocol.legs = vec![LegSpec::Crumb { samples: 1 }]; + let (_s, d) = fake_sysfs("nocrumb-disc", &[], "2"); + let (ev, report) = run_in("nocrumb", &protocol, Some(root.join("fixture")), d); + assert!(report.legs.is_empty()); + assert!( + report.not_run[0].reason.contains("no .crumb"), + "{:?}", + report.not_run + ); + verify_evidence(&ev).unwrap(); +} From 168fc4e197dc4468803d278aff515386101ef7ee Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 02:54:15 -0500 Subject: [PATCH 2/4] evidence(bench-pmu): pre-register host sample protocol; red proof by guard reversal Co-Authored-By: Claude Opus 5.5 --- .../host-sample-2026-10-16/protocol.json | 26 ++++++++++ .../red-green/red-mutations.txt | 47 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 evidence/bench-pmu-diagnostics/host-sample-2026-10-16/protocol.json create mode 100644 evidence/bench-pmu-diagnostics/red-green/red-mutations.txt diff --git a/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/protocol.json b/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/protocol.json new file mode 100644 index 0000000..7109699 --- /dev/null +++ b/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/protocol.json @@ -0,0 +1,26 @@ +{ + "schema": "synapse-bench/pmu-diag-protocol/v1", + "purpose": "Issue #64 host sample: short diagnostic run of every leg kind on the GB10 Spark, unprivileged, both core classes pinned. Diagnostic only, not qualification; seconds per operation are the measured unit; hardware counts (if permitted) are supporting units.", + "seed": 64, + "fixture_rev": "e863c87b581ddd0d33183667d6d4842d2de1f4fe", + "reps": 3, + "order": "control-then-instrumented", + "affinity": ["a725", "x925"], + "legs": [ + {"kind": "floor", "op": "sha256_content_12k", "iterations": 20000}, + {"kind": "floor", "op": "ed25519_verify", "iterations": 2000}, + {"kind": "floor", "op": "envelope_validate", "iterations": 2000}, + {"kind": "floor", "op": "json_decode_submit_request", "iterations": 2000}, + {"kind": "write", "arm": "every_commit", "agents": 1, "ops_per_agent": 4}, + {"kind": "write", "arm": "every_commit", "agents": 4, "ops_per_agent": 4}, + {"kind": "write", "arm": "every_commit", "agents": 8, "ops_per_agent": 4}, + {"kind": "write", "arm": "every_commit", "agents": 32, "ops_per_agent": 4}, + {"kind": "write", "arm": "group_commit", "agents": 1, "ops_per_agent": 4}, + {"kind": "write", "arm": "group_commit", "agents": 4, "ops_per_agent": 4}, + {"kind": "write", "arm": "group_commit", "agents": 8, "ops_per_agent": 4}, + {"kind": "write", "arm": "group_commit", "agents": 32, "ops_per_agent": 4}, + {"kind": "query", "populate_agents": 4, "populate_ops_per_agent": 4, "samples": 20}, + {"kind": "crumb", "samples": 20} + ], + "held_out": "Nothing is tuned from this run. Any later optimisation decision needs its own pre-registered, held-out runs." +} diff --git a/evidence/bench-pmu-diagnostics/red-green/red-mutations.txt b/evidence/bench-pmu-diagnostics/red-green/red-mutations.txt new file mode 100644 index 0000000..ea17125 --- /dev/null +++ b/evidence/bench-pmu-diagnostics/red-green/red-mutations.txt @@ -0,0 +1,47 @@ +Red proof by guard reversal (issue #64). Each block reverts one guard in the implementation +(diff lines shown), runs 'cargo test -p synapse-bench --lib pmu', and lists the failing tests. +A first 'discovery-unchecked' mutant (fall back to the first PMU when a reading names an unknown one) +survived: the coverage check (every discovered PMU and event read exactly once) still refused the +edited evidence, so it was replaced by 'class-unchecked' below. Base commit e6243c7. + +=== mutation disabled-mode-opens (crates/synapse-bench/src/pmu.rs) +- if mode == PmuMode::Disabled { +- return s; +- } +thread 'pmu_diag::tests::acceptance1_disabled_mode_makes_no_system_call' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:199:5: +test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 58 filtered out; finished in 0.51s +=== mutation counts-scaled (crates/synapse-bench/src/pmu.rs) +- raw_count: raw[0], ++ raw_count: raw[0] * raw[1] / raw[2].max(1), +thread 'pmu_diag::tests::acceptance1_multiplexed_and_partial_residency_are_labelled_not_scaled' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:262:5: +test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 58 filtered out; finished in 0.44s +=== mutation multiplex-unlabelled (crates/synapse-bench/src/pmu.rs) +- Ok(if running_ns == enabled_ns { ++ Ok(if running_ns <= enabled_ns { +thread 'pmu_diag::tests::acceptance1_multiplexed_and_partial_residency_are_labelled_not_scaled' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:259:5: +test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 58 filtered out; finished in 0.36s +=== mutation refusal-yields-counts (crates/synapse-bench/src/pmu.rs) +- Some((reason, detail)) => PmuSample::InstrumentUnavailable { reason, detail }, ++ Some(_) => PmuSample::Counted { readings }, +thread 'pmu_diag::tests::acceptance1_real_host_sample_is_counted_or_typed_unavailable' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:411:48: +thread 'pmu_diag::tests::acceptance1_unsupported_or_missing_pmu_refuses_before_any_open' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:317:9: +thread 'pmu_diag::tests::acceptance1_malformed_reads_are_refused_never_repaired' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:374:9: +thread 'pmu_diag::tests::acceptance1_permission_denied_is_instrument_unavailable_without_counts' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:285:18: +thread 'pmu_diag::tests::acceptance1_verify_refuses_mismatched_pmu_output' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:496:33: +thread 'pmu_diag::tests::acceptance3_report_recomputes_from_raw_and_digests_verify' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:496:33: +thread 'pmu_diag::tests::acceptance1_manifest_attribution_and_every_leg_kind_runs' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:496:33: +test result: FAILED. 7 passed; 7 failed; 0 ignored; 0 measured; 58 filtered out; finished in 0.26s +=== mutation encoding-unchecked (crates/synapse-bench/src/pmu.rs) +- .is_some_and(|v| v == u64::from(spec.arm_event)); ++ .is_some(); +thread 'pmu_diag::tests::acceptance1_unsupported_or_missing_pmu_refuses_before_any_open' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:317:9: +test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 58 filtered out; finished in 0.28s +=== mutation sums-unchecked (crates/synapse-bench/src/pmu_diag.rs) +- verify_sums(dir)?; +thread 'pmu_diag::tests::acceptance3_report_recomputes_from_raw_and_digests_verify' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:732:5: +test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 58 filtered out; finished in 0.30s +=== mutation class-unchecked (crates/synapse-bench/src/pmu_diag.rs) +- if dev.core_class != r.core_class { ++ if false { +thread 'pmu_diag::tests::acceptance1_verify_refuses_mismatched_pmu_output' panicked at crates/synapse-bench/src/pmu_diag/tests.rs:530:33: +test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 58 filtered out; finished in 0.28s From 601b5980076c27893e7f7f5906cfa33769b6bed3 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 02:56:18 -0500 Subject: [PATCH 3/4] fix(synapse-bench): protocol affinity uses the short codes unpinned/a725/x925 Co-Authored-By: Claude Opus 5.5 --- crates/synapse-bench/src/pmu.rs | 15 +++++++++++++++ crates/synapse-bench/src/pmu_diag/tests.rs | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/crates/synapse-bench/src/pmu.rs b/crates/synapse-bench/src/pmu.rs index 7597e02..d94b72f 100644 --- a/crates/synapse-bench/src/pmu.rs +++ b/crates/synapse-bench/src/pmu.rs @@ -257,7 +257,9 @@ pub enum PmuMode { } /// Affinity of the measured thread (and every thread it creates) during a window. +/// Serialized as `unpinned`, `a725` or `x925`. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] +#[serde(try_from = "String", into = "String")] pub enum AffinityPolicy { /// Scheduler's choice; a counter that ran part of the window cannot tell migration /// from multiplexing and is reported as `PartialResidency`. @@ -266,6 +268,19 @@ pub enum AffinityPolicy { Pinned(CoreClass), } +impl TryFrom for AffinityPolicy { + type Error = String; + fn try_from(s: String) -> Result { + Self::parse(&s).ok_or_else(|| format!("affinity {s:?}: expected unpinned, a725 or x925")) + } +} + +impl From for String { + fn from(a: AffinityPolicy) -> String { + a.code().to_string() + } +} + impl AffinityPolicy { pub fn parse(s: &str) -> Option { match s { diff --git a/crates/synapse-bench/src/pmu_diag/tests.rs b/crates/synapse-bench/src/pmu_diag/tests.rs index ea95b76..ae9700f 100644 --- a/crates/synapse-bench/src/pmu_diag/tests.rs +++ b/crates/synapse-bench/src/pmu_diag/tests.rs @@ -438,6 +438,14 @@ fn floor_protocol() -> Protocol { #[test] fn acceptance1_schema_protocol_refuses_bad_plans() { assert!(floor_protocol().validate().is_ok()); + // Affinity is written in protocols as the same short codes the CLI and doc use. + let codes: Vec = + serde_json::from_str(r#"["unpinned","a725","x925"]"#).unwrap(); + assert_eq!( + serde_json::to_string(&codes).unwrap(), + r#"["unpinned","a725","x925"]"# + ); + assert!(serde_json::from_str::(r#""Unpinned""#).is_err()); let mut p = floor_protocol(); p.schema = "synapse-bench/pmu-diag-protocol/v0".into(); assert!(p.validate().is_err()); From 02895afe8a903fbd640e2825d2393eb14bf68753 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 03:00:02 -0500 Subject: [PATCH 4/4] evidence(bench-pmu): GB10 host sample (wall times measured, PMU PERMISSION_DENIED) and doc Co-Authored-By: Claude Opus 5.5 --- docs/BENCH_PMU_DIAGNOSTICS.md | 175 ++ .../host-sample-2026-10-16/SHA256SUMS | 3 + .../host-sample-2026-10-16/raw.json | 2663 +++++++++++++++++ .../host-sample-2026-10-16/report.json | 1666 +++++++++++ .../bench-pmu-diagnostics/red-green/green.txt | 19 + 5 files changed, 4526 insertions(+) create mode 100644 docs/BENCH_PMU_DIAGNOSTICS.md create mode 100644 evidence/bench-pmu-diagnostics/host-sample-2026-10-16/SHA256SUMS create mode 100644 evidence/bench-pmu-diagnostics/host-sample-2026-10-16/raw.json create mode 100644 evidence/bench-pmu-diagnostics/host-sample-2026-10-16/report.json create mode 100644 evidence/bench-pmu-diagnostics/red-green/green.txt diff --git a/docs/BENCH_PMU_DIAGNOSTICS.md b/docs/BENCH_PMU_DIAGNOSTICS.md new file mode 100644 index 0000000..8ab1721 --- /dev/null +++ b/docs/BENCH_PMU_DIAGNOSTICS.md @@ -0,0 +1,175 @@ +# Bench PMU Diagnostics (issue #64) + +`synapse-bench pmu-diag` adds optional CPU performance-counter readings beside the existing +physical-bound benchmarks. It is **diagnostic only**: seconds per operation stay the measured unit, +hardware counts are supporting units, and nothing here is a qualification result or a performance +claim. Energy is not measured by this path (`raw.json` says `NOT_MEASURED`); the `run`, `floor` and +`bounds` subcommands and their SI and joule reporting are unchanged. + +Diagnostics are opt-in. Nothing runs unless `pmu-diag` is invoked with a protocol file. The default +benchmark output, the existing subcommands and CI (`scripts/ci/portable.sh`) are untouched. In +disabled mode no `perf_event_open` call is made at all (test +`acceptance1_disabled_mode_makes_no_system_call`). + +## 1. Acceptance and Where It Is Met + +| Issue #64 acceptance | How it is met | Proof | +| :--- | :--- | :--- | +| Portable tests: schema validity | Protocol, raw and report schemas are versioned (`synapse-bench/pmu-diag-*/v1`) and refuse unknown fields; the protocol refuses a wrong schema, an order other than control-then-instrumented, duplicate legs, zero sizes | `acceptance1_schema_protocol_refuses_bad_plans` | +| Portable tests: counter unavailable | `perf_event_open` failing with `EACCES`/`EPERM` gives `INSTRUMENT_UNAVAILABLE` / `PERMISSION_DENIED` with the OS error text and **no counts**; `ENOENT`/`ENODEV`/`EOPNOTSUPP` give `UNSUPPORTED_EVENT`; `ENOSYS` gives `UNSUPPORTED_PLATFORM`; any other failure `COUNTER_UNAVAILABLE` | `acceptance1_permission_denied_is_instrument_unavailable_without_counts` | +| Portable tests: unsupported | No CPU PMU in sysfs (a device with `events/cpu_cycles` and a `cpus` list) gives `NO_PMU`; a PMU whose sysfs event encoding differs from the ARM number, or that lacks one of the four events, refuses with `UNSUPPORTED_EVENT` before any open | `acceptance1_unsupported_or_missing_pmu_refuses_before_any_open`, `acceptance1_discovery_verifies_encodings_and_core_classes` | +| Portable tests: multiplexed | A counter with `time_running < time_enabled` is labelled `MULTIPLEXED` (pinned to its class) or `PARTIAL_RESIDENCY` (unpinned: migration and multiplexing cannot be told apart); the raw count is kept **unscaled**. `time_running = 0` with count 0 is `NOT_SCHEDULED` | `acceptance1_multiplexed_and_partial_residency_are_labelled_not_scaled` | +| Portable tests: disabled-mode no-op | Disabled mode returns `DISABLED` without touching the backend | `acceptance1_disabled_mode_makes_no_system_call` | +| Portable tests: malformed or mismatched PMU output | Short reads, wrong member counts, `time_running > time_enabled`, a count without running time are refused, never repaired. `pmu-verify` refuses raw evidence whose readings name an unknown PMU or event, a wrong core class, a missing or duplicated event, or a state that does not match the times | `acceptance1_malformed_reads_are_refused_never_repaired`, `acceptance1_verify_refuses_mismatched_pmu_output` | +| Portable tests: correct manifest attribution | Every reading carries PMU name, perf type, core class (from MIDR), ARM event number and sysfs encoding; the manifest records invocation, host, compiler, kernel, `perf_event_paranoid`, PMU discovery, fixture repo and commit, source and sibling revisions | `acceptance1_counted_reads_are_raw_and_attributed_per_core_class`, `acceptance1_manifest_attribution_and_every_leg_kind_runs`, `acceptance1_event_attr_is_user_only_inherited_counting` | +| Spark run of 1/4/8/32-agent write legs and query legs with matched baselines; wall-time and PMU distributions and overhead, else `NOT_RUN` | Run on this Spark (section 2). **Wall time: measured.** **PMU counts: `NOT_RUN`**: the host has `perf_event_paranoid = 4`, so every instrumented window is `INSTRUMENT_UNAVAILABLE` / `PERMISSION_DENIED` (84 of 84). Lowering the sysctl or running privileged is an operator decision and was not done | `evidence/bench-pmu-diagnostics/host-sample-2026-10-16/` | +| Derived numbers recompute from raw evidence; digest/manifest checks pass | `report.json` is a pure function of `protocol.json` and `raw.json` (integers only); `pmu-verify` recomputes it byte for byte, re-validates every PMU reading and checks `SHA256SUMS` | `acceptance3_report_recomputes_from_raw_and_digests_verify`; `synapse-bench pmu-verify` on the host sample passes | +| One PR scoped to `crates/synapse-bench/**` and benchmark evidence | New modules `pmu.rs`, `pmu_diag.rs` (+ tests), two subcommands in `main.rs`, two lines in `lib.rs`; no change to synapse-store, synapse-api or synapse-crumb | the diff | + +Also covered: a crumb leg on a fixture without `.crumb` files is recorded under `not_run`, never faked +(`acceptance1_crumb_leg_without_crumb_fixture_is_not_run`); on whatever host runs the tests, a real +open either counts or returns a typed unavailable state (`acceptance1_real_host_sample_is_counted_or_typed_unavailable`). + +Red before green: each guard was reverted one at a time and its test failed +(`evidence/bench-pmu-diagnostics/red-green/red-mutations.txt`: disabled-mode-opens, counts-scaled, +multiplex-unlabelled, refusal-yields-counts, encoding-unchecked, class-unchecked, sums-unchecked). One +mutant (fall back to the first PMU for an unknown name) survived because the coverage check still refused +the edited evidence; it is recorded there. All 14 tests pass (`red-green/green.txt`). + +**Deviation from the issue text.** The issue asks to consume the Omega #453 PMU contract. Omega #453 is +still open and has not landed. This PR therefore carries a small native backend in `synapse-bench` +(`perf_event_open` through the existing `libc` dependency, no new crates) and uses Omega #453's status +vocabulary (`COUNTER_UNAVAILABLE`, `PERMISSION_DENIED`, `MULTIPLEXED`, `UNSUPPORTED_EVENT`) so it can +switch to that contract when it lands. + +## 2. Host Sample (diagnostic, not qualification) + +Host: GB10 Spark, 20 CPUs (10 Cortex-X925, 10 Cortex-A725), kernel 7.0.0-1019-nvidia, ext4 on +`/dev/nvme0n1p2`, `perf_event_paranoid = 4`. Binary built from `601b598`. The protocol was committed +(`168fc4e`, 07:54:15 UTC) before the run started (07:56:56 UTC); `raw.json` carries its SHA-256. The +commit in between (`601b598`) only changed how affinity is parsed and left the protocol bytes unchanged. +Whole run: 51 s wall. Three repetitions per leg and affinity; each repetition is a control window +(counters never opened) followed by an instrumented window on identical input. + +Discovery found both PMUs and verified every event encoding against the ARM numbers: +`armv8_pmuv3_0` (perf type 10, CPUs 0-4 and 10-14, MIDR part 0xD87 Cortex-A725) and `armv8_pmuv3_1` +(type 11, CPUs 5-9 and 15-19, part 0xD85 Cortex-X925). Every instrumented open was refused: +`perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)`. + +Wall nanoseconds per operation, median of 3 (full min/p50/max and CPU-time distributions are in +`report.json`). Overhead is `(instrumented p50 - control p50) / control p50`. Because every open was +refused, the instrumented side differs from the control only by one failed system call, so these +overheads measure run-to-run noise, not counter cost. + +| Leg | Affinity | Control ns/op | Instrumented ns/op | Overhead (ppm) | +| :--- | :--- | ---: | ---: | ---: | +| floor/sha256_content_12k | a725 | 5,947 | 5,941 | -998 | +| floor/sha256_content_12k | x925 | 5,591 | 5,591 | 142 | +| floor/ed25519_verify | a725 | 49,096 | 49,116 | 403 | +| floor/ed25519_verify | x925 | 23,838 | 23,831 | -316 | +| floor/envelope_validate | a725 | 55,642 | 55,652 | 183 | +| floor/envelope_validate | x925 | 27,706 | 27,705 | -51 | +| floor/json_decode_submit_request | a725 | 170,888 | 170,810 | -458 | +| floor/json_decode_submit_request | x925 | 84,576 | 84,599 | 273 | +| write/every_commit, 1 agent | a725 | 18,901,382 | 17,563,601 | -70,776 | +| write/every_commit, 1 agent | x925 | 17,340,747 | 16,910,196 | -24,828 | +| write/every_commit, 4 agents | a725 | 15,949,643 | 16,494,380 | 34,153 | +| write/every_commit, 4 agents | x925 | 17,351,934 | 16,127,962 | -70,538 | +| write/every_commit, 8 agents | a725 | 16,459,075 | 15,196,846 | -76,688 | +| write/every_commit, 8 agents | x925 | 16,209,404 | 15,523,021 | -42,344 | +| write/every_commit, 32 agents | a725 | 17,047,042 | 16,517,166 | -31,083 | +| write/every_commit, 32 agents | x925 | 15,915,449 | 15,999,518 | 5,282 | +| write/group_commit, 1 agent | a725 | 2,137,378 | 2,239,238 | 47,656 | +| write/group_commit, 1 agent | x925 | 1,813,332 | 1,657,427 | -85,977 | +| write/group_commit, 4 agents | a725 | 796,566 | 843,486 | 58,903 | +| write/group_commit, 4 agents | x925 | 659,727 | 660,281 | 839 | +| write/group_commit, 8 agents | a725 | 395,578 | 412,826 | 43,602 | +| write/group_commit, 8 agents | x925 | 323,440 | 324,335 | 2,768 | +| write/group_commit, 32 agents | a725 | 318,176 | 306,580 | -36,445 | +| write/group_commit, 32 agents | x925 | 186,150 | 177,818 | -44,759 | +| query/read_tree_diff | a725 | 617,578 | 615,837 | -2,818 | +| query/read_tree_diff | x925 | 333,933 | 334,493 | 1,674 | +| crumb/context_advisory | a725 | 252,178 | 250,992 | -4,706 | +| crumb/context_advisory | x925 | 131,462 | 131,023 | -3,343 | + +Reading the table: the CPU-bound legs (floor, query, crumb) repeat within 0.1 to 0.5 percent. The write +legs move by up to about 9 percent between back-to-back windows, because each write window is only +4 operations per agent and is dominated by storage flush time. The X925 cores run the CPU-bound legs about +twice as fast as the A725 cores. None of this is a qualification figure: 3 repetitions, short windows, +one host. + +PMU counts, IPC and mispredict ratios: **`NOT_RUN`** (`INSTRUMENT_UNAVAILABLE` / `PERMISSION_DENIED`, +84 of 84 instrumented windows). Joules: `NOT_MEASURED`. + +## 3. Method + +- **Events** (ARM PMUv3 common events): `CPU_CYCLES` 0x11, `INST_RETIRED` 0x08, `BR_PRED` 0x12, + `BR_MIS_PRED` 0x10. Source: Linux `include/linux/perf/arm_pmuv3.h` in the installed kernel headers + (`/usr/src/linux-headers-7.0.0-1019-nvidia`, `ARMV8_PMUV3_PERFCTR_INST_RETIRED 0x0008`, + `..._BR_MIS_PRED 0x0010`, `..._CPU_CYCLES 0x0011`, `..._BR_PRED 0x0012`). Each event is also read from + `/sys/bus/event_source/devices//events/` and must equal `event=0x00NN`, or the PMU is refused. +- **Core classes.** Each PMU's `cpus` list is read from sysfs and its class taken from the MIDR part number + (`/sys/devices/system/cpu/cpuN/regs/identification/midr_el1`): 0xD87 Cortex-A725, 0xD85 Cortex-X925. + Readings are attributed to the PMU that produced them, never merged across classes. +- **Open.** `perf_event_open(2)` per PMU, one group of the four events (leader opened disabled), + `pid = 0, cpu = -1`, `inherit = 1` so every thread the window creates is counted, + `exclude_kernel = 1, exclude_hv = 1` (user-space work only, which is also what paranoid level 2 allows), + `read_format = TOTAL_TIME_ENABLED | TOTAL_TIME_RUNNING`. Members are read one by one because the man page + states `inherit` "does not work for some combinations of read_format values, such as + PERF_FORMAT_GROUP". Group members are scheduled together, so ratios within one group compare the same + intervals even when the group was multiplexed. Source: `man 2 perf_event_open` (ioctl + `PERF_EVENT_IOC_ENABLE`/`DISABLE`/`RESET`, error codes, `perf_event_paranoid` levels) and + `/usr/include/linux/perf_event.h` (`PERF_ATTR_SIZE_VER0` = 64 bytes, ioctl numbers, `PERF_FLAG_FD_CLOEXEC`). +- **Fail closed.** If any event of any PMU fails to open, the whole window is `INSTRUMENT_UNAVAILABLE` + with the reason and OS error; no partial counts are kept. Counts are never scaled by + `enabled / running`; the times are recorded so a reader can see multiplexing. +- **Affinity.** `unpinned`, `a725` or `x925`, set with `sched_setaffinity` on the measuring thread before + the window (threads it creates inherit it) and restored afterwards. +- **Timing.** `CLOCK_MONOTONIC` wall nanoseconds around the measured work only; counters are opened before + the clock starts and read after it stops. CPU time is `getrusage(RUSAGE_SELF)` user plus system + microseconds over the window. Wall time minus CPU time shows off-CPU time (storage waits); with + `exclude_kernel` the counters see only user-space work, so CPU work and storage wait stay separate. +- **Legs.** `floor` (SHA-256 of 12 KiB, Ed25519 verify, envelope validate, JSON decode of a submit + request), `write` (every-commit or group-commit arm, N agents each submitting M operations, through the + same `synapse_submit` path as `run`), `query` (populate then `read_tree_diff`), `crumb` (context and + changeset advisory; `NOT_RUN` when the fixture has no `.crumb`). Setup is outside the clock; floor, + query and crumb legs run one warm-up pass first. + +## 4. Formulas (recompute by hand) + +All values in `raw.json` are integers. Per side (control or instrumented) over windows without an error: + +- `wall_ns_per_op = wall_ns / ops` (integer division) per window; `cpu_us = cpu_user_us + cpu_sys_us`. +- Distributions are `n`, `min`, `p50` (nearest rank, rank `ceil(0.5 n)`), `max`. +- `overhead_ppm_p50 = (instrumented p50 wall_ns - control p50 wall_ns) * 1,000,000 / control p50 wall_ns` + (integer, truncated toward zero). +- Per core class and event, over readings that are not `NOT_SCHEDULED`: distributions of `raw_count` + and `raw_count / ops`. +- `instructions_per_kilocycle = sum(INST_RETIRED) * 1000 / sum(CPU_CYCLES)`; + `mispredicts_per_kilo_predicted_branches = sum(BR_MIS_PRED) * 1000 / sum(BR_PRED)`, summed per class + over counted windows. Absent when the denominator is 0 or nothing was counted. + +## 5. Limits + +- No counts on this host without an operator change (`perf_event_paranoid` 4). The code path that reads + real counts is covered by tests with a fake backend and by the real-host test, which on this host takes + the typed-unavailable branch. Real counted output on GB10 is **UNVERIFIED**. +- The overhead of open, enable, disable and read on a permitted host is therefore not measured here. +- `pmu-verify` is a consistency check: anyone can edit `raw.json` and regenerate the report and checksums. + Authenticity comes from git history and review. +- Diagnostic only. Nothing was tuned from this run; any optimisation decision needs its own + pre-registered, held-out runs. + +## 6. Reproduction + +``` +cargo build --release -p synapse-bench +synapse-bench pmu-diag --evidence

--work-dir \ + --fixture-repo --source-rev [--sibling name=rev]... +synapse-bench pmu-verify --evidence evidence/bench-pmu-diagnostics/host-sample-2026-10-16 +cd evidence/bench-pmu-diagnostics/host-sample-2026-10-16 && sha256sum -c SHA256SUMS +``` + +The run refuses to overwrite an existing `raw.json` and writes `report.json` and `SHA256SUMS` when it +finishes. To get counts on a Spark, an operator must permit unprivileged user-space counting +(`perf_event_paranoid` at 2 or lower) or run with `CAP_PERFMON`; the tool never changes this itself. diff --git a/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/SHA256SUMS b/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/SHA256SUMS new file mode 100644 index 0000000..58894fd --- /dev/null +++ b/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/SHA256SUMS @@ -0,0 +1,3 @@ +92a7a56db93ea33e3fad4f722ba8d4139d3e33b9909703a7bfbc85233de973bd protocol.json +fe8274b9c97bb5a1df76628f9dac7f5d0b68a7e50973121b93d84b6355160a1f raw.json +3f1e11c61a6c5f68dd3d137324b3913cbbcb8631bf1c0e81e0fb77f116f0b4d2 report.json diff --git a/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/raw.json b/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/raw.json new file mode 100644 index 0000000..6e6c497 --- /dev/null +++ b/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/raw.json @@ -0,0 +1,2663 @@ +{ + "schema": "synapse-bench/pmu-diag-raw/v1", + "protocol_sha256": "92a7a56db93ea33e3fad4f722ba8d4139d3e33b9909703a7bfbc85233de973bd", + "manifest": { + "invocation": [ + "./target/release/synapse-bench", + "pmu-diag", + "--evidence", + "evidence/bench-pmu-diagnostics/host-sample-2026-10-16", + "--work-dir", + "../work/scratch", + "--fixture-repo", + "../work/fixture-synapse", + "--source-rev", + "601b5980076c27893e7f7f5906cfa33769b6bed3" + ], + "started_at": "2026-10-16T07:56:56Z", + "host": { + "hostname": "spark-b87b", + "kernel_release": "7.0.0-1019-nvidia", + "arch": "aarch64", + "cpu_models": [ + "Cortex-X925", + "Cortex-A725" + ], + "cpu_model_source": "lscpu", + "logical_cpus": 20, + "mem_total_kib": 127598752, + "git_version": "git version 2.43.0", + "rustc_version": "rustc 1.98.1 (48a229cea 2026-09-01)", + "cargo_version": "cargo 1.98.1 (797e8a9bc 2026-08-05)", + "work_dir": "../work/scratch", + "work_dir_fs_type": "ext4", + "work_dir_source": "/dev/nvme0n1p2", + "work_dir_free_bytes_at_start": 340811395072 + }, + "build_profile": "release", + "target_arch": "aarch64", + "source_rev": "601b5980076c27893e7f7f5906cfa33769b6bed3", + "fixture_repo": "../work/fixture-synapse", + "fixture_commit": "e863c87b581ddd0d33183667d6d4842d2de1f4fe", + "siblings": [], + "clock": "std::time::Instant (CLOCK_MONOTONIC), wall nanoseconds per window", + "energy": "NOT_MEASURED by pmu-diag (energy stays with run, floor and bounds)" + }, + "discovery": { + "sysfs_root": "/sys", + "perf_event_paranoid": 4, + "devices": [ + { + "name": "armv8_pmuv3_0", + "perf_type": 10, + "cpus": [ + 0, + 1, + 2, + 3, + 4, + 10, + 11, + 12, + 13, + 14 + ], + "core_class": "CortexA725", + "midr": "0x00000000410fd871", + "events": [ + { + "name": "cpu_cycles", + "arm_event": 17, + "sysfs_encoding": "event=0x0011", + "verified": true + }, + { + "name": "inst_retired", + "arm_event": 8, + "sysfs_encoding": "event=0x0008", + "verified": true + }, + { + "name": "br_pred", + "arm_event": 18, + "sysfs_encoding": "event=0x0012", + "verified": true + }, + { + "name": "br_mis_pred", + "arm_event": 16, + "sysfs_encoding": "event=0x0010", + "verified": true + } + ] + }, + { + "name": "armv8_pmuv3_1", + "perf_type": 11, + "cpus": [ + 5, + 6, + 7, + 8, + 9, + 15, + 16, + 17, + 18, + 19 + ], + "core_class": "CortexX925", + "midr": "0x00000000410fd851", + "events": [ + { + "name": "cpu_cycles", + "arm_event": 17, + "sysfs_encoding": "event=0x0011", + "verified": true + }, + { + "name": "inst_retired", + "arm_event": 8, + "sysfs_encoding": "event=0x0008", + "verified": true + }, + { + "name": "br_pred", + "arm_event": 18, + "sysfs_encoding": "event=0x0012", + "verified": true + }, + { + "name": "br_mis_pred", + "arm_event": 16, + "sysfs_encoding": "event=0x0010", + "verified": true + } + ] + } + ] + }, + "windows": [ + { + "leg": "floor/sha256_content_12k", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 20000, + "wall_ns": 118953994, + "cpu_user_us": 118899, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 20000, + "wall_ns": 118835178, + "cpu_user_us": 118813, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 20000, + "wall_ns": 118829433, + "cpu_user_us": 118830, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 20000, + "wall_ns": 118817978, + "cpu_user_us": 118809, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 20000, + "wall_ns": 119040362, + "cpu_user_us": 119041, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 20000, + "wall_ns": 119042411, + "cpu_user_us": 119043, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 20000, + "wall_ns": 111791035, + "cpu_user_us": 111792, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 20000, + "wall_ns": 111839803, + "cpu_user_us": 111840, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 20000, + "wall_ns": 111829818, + "cpu_user_us": 111829, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 20000, + "wall_ns": 112155757, + "cpu_user_us": 111796, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 20000, + "wall_ns": 111823883, + "cpu_user_us": 111823, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 20000, + "wall_ns": 111753242, + "cpu_user_us": 111753, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 2000, + "wall_ns": 98218432, + "cpu_user_us": 98216, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 2000, + "wall_ns": 98232400, + "cpu_user_us": 98223, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 2000, + "wall_ns": 98190255, + "cpu_user_us": 98191, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 2000, + "wall_ns": 98242880, + "cpu_user_us": 98243, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 2000, + "wall_ns": 98192751, + "cpu_user_us": 98194, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 2000, + "wall_ns": 98194143, + "cpu_user_us": 98195, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 2000, + "wall_ns": 47685102, + "cpu_user_us": 47687, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 2000, + "wall_ns": 47662158, + "cpu_user_us": 47663, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 2000, + "wall_ns": 47677871, + "cpu_user_us": 47678, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 2000, + "wall_ns": 47909936, + "cpu_user_us": 47644, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 2000, + "wall_ns": 47660110, + "cpu_user_us": 47660, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 2000, + "wall_ns": 47662798, + "cpu_user_us": 47663, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 2000, + "wall_ns": 111284407, + "cpu_user_us": 111289, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 2000, + "wall_ns": 111336615, + "cpu_user_us": 111338, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 2000, + "wall_ns": 111267126, + "cpu_user_us": 111257, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 2000, + "wall_ns": 111230823, + "cpu_user_us": 111232, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 2000, + "wall_ns": 111295270, + "cpu_user_us": 111078, + "cpu_sys_us": 208, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 2000, + "wall_ns": 111304871, + "cpu_user_us": 111306, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 2000, + "wall_ns": 55412913, + "cpu_user_us": 55415, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 2000, + "wall_ns": 55410065, + "cpu_user_us": 55410, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 2000, + "wall_ns": 55768452, + "cpu_user_us": 55425, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 2000, + "wall_ns": 55416418, + "cpu_user_us": 55417, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 2000, + "wall_ns": 55410753, + "cpu_user_us": 55411, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 2000, + "wall_ns": 55405809, + "cpu_user_us": 55406, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 2000, + "wall_ns": 341815736, + "cpu_user_us": 341812, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 2000, + "wall_ns": 341615527, + "cpu_user_us": 341615, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 2000, + "wall_ns": 341777879, + "cpu_user_us": 341756, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 2000, + "wall_ns": 341621047, + "cpu_user_us": 341620, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 2000, + "wall_ns": 341604934, + "cpu_user_us": 341604, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 2000, + "wall_ns": 341683223, + "cpu_user_us": 341633, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 2000, + "wall_ns": 167358844, + "cpu_user_us": 167356, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 2000, + "wall_ns": 169286889, + "cpu_user_us": 169286, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 2000, + "wall_ns": 169152088, + "cpu_user_us": 169152, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 2000, + "wall_ns": 169198280, + "cpu_user_us": 169197, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 2000, + "wall_ns": 169330089, + "cpu_user_us": 169326, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 2000, + "wall_ns": 168684309, + "cpu_user_us": 168684, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 4, + "wall_ns": 64066347, + "cpu_user_us": 0, + "cpu_sys_us": 5930, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 4, + "wall_ns": 63804826, + "cpu_user_us": 3381, + "cpu_sys_us": 2011, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 4, + "wall_ns": 78173994, + "cpu_user_us": 2808, + "cpu_sys_us": 3983, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 4, + "wall_ns": 74880083, + "cpu_user_us": 6438, + "cpu_sys_us": 995, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 4, + "wall_ns": 75605528, + "cpu_user_us": 4737, + "cpu_sys_us": 1999, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 4, + "wall_ns": 70254404, + "cpu_user_us": 3282, + "cpu_sys_us": 2994, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 4, + "wall_ns": 64879424, + "cpu_user_us": 2270, + "cpu_sys_us": 1002, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 4, + "wall_ns": 58204228, + "cpu_user_us": 1998, + "cpu_sys_us": 997, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 4, + "wall_ns": 71102874, + "cpu_user_us": 4107, + "cpu_sys_us": 10, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 4, + "wall_ns": 68157623, + "cpu_user_us": 4050, + "cpu_sys_us": 7, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 4, + "wall_ns": 69362990, + "cpu_user_us": 0, + "cpu_sys_us": 4318, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 4, + "wall_ns": 67640786, + "cpu_user_us": 3641, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 16, + "wall_ns": 281778646, + "cpu_user_us": 18469, + "cpu_sys_us": 10977, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 16, + "wall_ns": 302938690, + "cpu_user_us": 19034, + "cpu_sys_us": 10033, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 16, + "wall_ns": 251389131, + "cpu_user_us": 17563, + "cpu_sys_us": 4993, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 16, + "wall_ns": 250013922, + "cpu_user_us": 11390, + "cpu_sys_us": 10033, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 16, + "wall_ns": 255194292, + "cpu_user_us": 12998, + "cpu_sys_us": 7032, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 16, + "wall_ns": 263910094, + "cpu_user_us": 15632, + "cpu_sys_us": 4109, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 16, + "wall_ns": 298631621, + "cpu_user_us": 9193, + "cpu_sys_us": 8909, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 16, + "wall_ns": 307946899, + "cpu_user_us": 15033, + "cpu_sys_us": 3002, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 16, + "wall_ns": 242341549, + "cpu_user_us": 9874, + "cpu_sys_us": 3926, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 16, + "wall_ns": 245278305, + "cpu_user_us": 13211, + "cpu_sys_us": 1009, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 16, + "wall_ns": 277630953, + "cpu_user_us": 7506, + "cpu_sys_us": 7029, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 16, + "wall_ns": 258047398, + "cpu_user_us": 8733, + "cpu_sys_us": 4996, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 32, + "wall_ns": 526690418, + "cpu_user_us": 36257, + "cpu_sys_us": 10369, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 32, + "wall_ns": 486299093, + "cpu_user_us": 23785, + "cpu_sys_us": 20948, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 32, + "wall_ns": 493249042, + "cpu_user_us": 16625, + "cpu_sys_us": 21923, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 32, + "wall_ns": 472599912, + "cpu_user_us": 35140, + "cpu_sys_us": 5221, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 32, + "wall_ns": 572301247, + "cpu_user_us": 27707, + "cpu_sys_us": 17055, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 32, + "wall_ns": 577533089, + "cpu_user_us": 31318, + "cpu_sys_us": 13096, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 32, + "wall_ns": 501434295, + "cpu_user_us": 19381, + "cpu_sys_us": 9032, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 32, + "wall_ns": 496736679, + "cpu_user_us": 16785, + "cpu_sys_us": 11019, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 32, + "wall_ns": 518700937, + "cpu_user_us": 13543, + "cpu_sys_us": 11077, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 32, + "wall_ns": 465932585, + "cpu_user_us": 12113, + "cpu_sys_us": 11170, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 32, + "wall_ns": 526608124, + "cpu_user_us": 22301, + "cpu_sys_us": 3226, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 32, + "wall_ns": 572710079, + "cpu_user_us": 15573, + "cpu_sys_us": 11919, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 128, + "wall_ns": 2190005572, + "cpu_user_us": 129743, + "cpu_sys_us": 52214, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 128, + "wall_ns": 2114197268, + "cpu_user_us": 128829, + "cpu_sys_us": 51425, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 128, + "wall_ns": 2182021406, + "cpu_user_us": 109206, + "cpu_sys_us": 72733, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 128, + "wall_ns": 2079355581, + "cpu_user_us": 85150, + "cpu_sys_us": 90991, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 128, + "wall_ns": 2158768611, + "cpu_user_us": 100600, + "cpu_sys_us": 84972, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 128, + "wall_ns": 2122737948, + "cpu_user_us": 121464, + "cpu_sys_us": 64833, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 128, + "wall_ns": 2105417250, + "cpu_user_us": 77288, + "cpu_sys_us": 30534, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 128, + "wall_ns": 2047938318, + "cpu_user_us": 76709, + "cpu_sys_us": 30979, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 128, + "wall_ns": 1917250390, + "cpu_user_us": 63832, + "cpu_sys_us": 46471, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 128, + "wall_ns": 1908593351, + "cpu_user_us": 57612, + "cpu_sys_us": 49940, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 128, + "wall_ns": 2037177570, + "cpu_user_us": 73202, + "cpu_sys_us": 36068, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 128, + "wall_ns": 2102942621, + "cpu_user_us": 71374, + "cpu_sys_us": 42325, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 4, + "wall_ns": 8457592, + "cpu_user_us": 3535, + "cpu_sys_us": 147, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 4, + "wall_ns": 8156726, + "cpu_user_us": 3433, + "cpu_sys_us": 40, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 4, + "wall_ns": 9455518, + "cpu_user_us": 5118, + "cpu_sys_us": 106, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 4, + "wall_ns": 8956955, + "cpu_user_us": 5070, + "cpu_sys_us": 2, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 4, + "wall_ns": 8549512, + "cpu_user_us": 4589, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 4, + "wall_ns": 9704048, + "cpu_user_us": 4945, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 4, + "wall_ns": 6032536, + "cpu_user_us": 1976, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 4, + "wall_ns": 5977063, + "cpu_user_us": 1964, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 4, + "wall_ns": 7785219, + "cpu_user_us": 3216, + "cpu_sys_us": 121, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 4, + "wall_ns": 8059685, + "cpu_user_us": 3346, + "cpu_sys_us": 33, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 4, + "wall_ns": 7253328, + "cpu_user_us": 2011, + "cpu_sys_us": 904, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 4, + "wall_ns": 6629708, + "cpu_user_us": 2598, + "cpu_sys_us": 60, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 16, + "wall_ns": 14093869, + "cpu_user_us": 18406, + "cpu_sys_us": 2043, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 16, + "wall_ns": 14652561, + "cpu_user_us": 20045, + "cpu_sys_us": 198, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 16, + "wall_ns": 12706884, + "cpu_user_us": 11846, + "cpu_sys_us": 2892, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 16, + "wall_ns": 13495785, + "cpu_user_us": 12784, + "cpu_sys_us": 1399, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 16, + "wall_ns": 12745060, + "cpu_user_us": 13241, + "cpu_sys_us": 334, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 16, + "wall_ns": 11930623, + "cpu_user_us": 13178, + "cpu_sys_us": 115, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 16, + "wall_ns": 10767703, + "cpu_user_us": 11383, + "cpu_sys_us": 247, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 16, + "wall_ns": 10564501, + "cpu_user_us": 10608, + "cpu_sys_us": 1173, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 16, + "wall_ns": 10555638, + "cpu_user_us": 8585, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 16, + "wall_ns": 11737133, + "cpu_user_us": 7623, + "cpu_sys_us": 961, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 16, + "wall_ns": 10017346, + "cpu_user_us": 7390, + "cpu_sys_us": 146, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 16, + "wall_ns": 9964962, + "cpu_user_us": 6855, + "cpu_sys_us": 986, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 32, + "wall_ns": 13012470, + "cpu_user_us": 22831, + "cpu_sys_us": 5225, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 32, + "wall_ns": 13210455, + "cpu_user_us": 27183, + "cpu_sys_us": 1004, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 32, + "wall_ns": 11878142, + "cpu_user_us": 21290, + "cpu_sys_us": 3371, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 32, + "wall_ns": 12620995, + "cpu_user_us": 21475, + "cpu_sys_us": 2946, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 32, + "wall_ns": 12658515, + "cpu_user_us": 22932, + "cpu_sys_us": 1987, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 32, + "wall_ns": 13765275, + "cpu_user_us": 21775, + "cpu_sys_us": 3321, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 32, + "wall_ns": 9562431, + "cpu_user_us": 16652, + "cpu_sys_us": 289, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 32, + "wall_ns": 10325060, + "cpu_user_us": 16061, + "cpu_sys_us": 1230, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 32, + "wall_ns": 10350084, + "cpu_user_us": 14022, + "cpu_sys_us": 220, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 32, + "wall_ns": 10378740, + "cpu_user_us": 14494, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 32, + "wall_ns": 12531730, + "cpu_user_us": 14711, + "cpu_sys_us": 961, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 32, + "wall_ns": 12398769, + "cpu_user_us": 15023, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 128, + "wall_ns": 36518241, + "cpu_user_us": 105819, + "cpu_sys_us": 5386, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 128, + "wall_ns": 37480455, + "cpu_user_us": 94761, + "cpu_sys_us": 16904, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 128, + "wall_ns": 40726604, + "cpu_user_us": 108022, + "cpu_sys_us": 10404, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 128, + "wall_ns": 39242291, + "cpu_user_us": 108232, + "cpu_sys_us": 10242, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 128, + "wall_ns": 41118815, + "cpu_user_us": 107902, + "cpu_sys_us": 13054, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 128, + "wall_ns": 41527186, + "cpu_user_us": 114925, + "cpu_sys_us": 4932, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 128, + "wall_ns": 24066111, + "cpu_user_us": 60929, + "cpu_sys_us": 3081, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 128, + "wall_ns": 22760806, + "cpu_user_us": 60330, + "cpu_sys_us": 3837, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 128, + "wall_ns": 23827293, + "cpu_user_us": 63255, + "cpu_sys_us": 4004, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 128, + "wall_ns": 21319180, + "cpu_user_us": 59960, + "cpu_sys_us": 5928, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 128, + "wall_ns": 23576875, + "cpu_user_us": 64873, + "cpu_sys_us": 2948, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 128, + "wall_ns": 24361313, + "cpu_user_us": 64506, + "cpu_sys_us": 3379, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 60, + "wall_ns": 37113188, + "cpu_user_us": 37096, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 60, + "wall_ns": 37075860, + "cpu_user_us": 36113, + "cpu_sys_us": 965, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 60, + "wall_ns": 37054692, + "cpu_user_us": 37057, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 60, + "wall_ns": 36940868, + "cpu_user_us": 36943, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 60, + "wall_ns": 36753714, + "cpu_user_us": 36756, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 60, + "wall_ns": 36950244, + "cpu_user_us": 36069, + "cpu_sys_us": 854, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 60, + "wall_ns": 20052148, + "cpu_user_us": 20056, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 60, + "wall_ns": 20069589, + "cpu_user_us": 20071, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 60, + "wall_ns": 20036036, + "cpu_user_us": 20038, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 60, + "wall_ns": 20026580, + "cpu_user_us": 20028, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 60, + "wall_ns": 20027188, + "cpu_user_us": 19071, + "cpu_sys_us": 951, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 60, + "wall_ns": 20096164, + "cpu_user_us": 20098, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "a725", + "rep": 0, + "instrumented": false, + "ops": 40, + "wall_ns": 10087155, + "cpu_user_us": 10091, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "a725", + "rep": 0, + "instrumented": true, + "ops": 40, + "wall_ns": 10001490, + "cpu_user_us": 10004, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "a725", + "rep": 1, + "instrumented": false, + "ops": 40, + "wall_ns": 10036274, + "cpu_user_us": 10038, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "a725", + "rep": 1, + "instrumented": true, + "ops": 40, + "wall_ns": 10039682, + "cpu_user_us": 10042, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "a725", + "rep": 2, + "instrumented": false, + "ops": 40, + "wall_ns": 10094915, + "cpu_user_us": 10097, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "a725", + "rep": 2, + "instrumented": true, + "ops": 40, + "wall_ns": 10072930, + "cpu_user_us": 10075, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "x925", + "rep": 0, + "instrumented": false, + "ops": 40, + "wall_ns": 5276451, + "cpu_user_us": 5279, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "x925", + "rep": 0, + "instrumented": true, + "ops": 40, + "wall_ns": 5268627, + "cpu_user_us": 5269, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "x925", + "rep": 1, + "instrumented": false, + "ops": 40, + "wall_ns": 5258514, + "cpu_user_us": 5259, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "x925", + "rep": 1, + "instrumented": true, + "ops": 40, + "wall_ns": 5240931, + "cpu_user_us": 5241, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "x925", + "rep": 2, + "instrumented": false, + "ops": 40, + "wall_ns": 5210818, + "cpu_user_us": 5211, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "DISABLED" + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "x925", + "rep": 2, + "instrumented": true, + "ops": 40, + "wall_ns": 5191459, + "cpu_user_us": 5192, + "cpu_sys_us": 0, + "error": null, + "pmu": { + "status": "INSTRUMENT_UNAVAILABLE", + "reason": "PERMISSION_DENIED", + "detail": "perf_event_open(armv8_pmuv3_0 type 10 event 0x0011 cpu_cycles): Permission denied (os error 13)" + } + } + ], + "not_run": [] +} \ No newline at end of file diff --git a/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/report.json b/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/report.json new file mode 100644 index 0000000..0c70a84 --- /dev/null +++ b/evidence/bench-pmu-diagnostics/host-sample-2026-10-16/report.json @@ -0,0 +1,1666 @@ +{ + "schema": "synapse-bench/pmu-diag-report/v1", + "status": "DIAGNOSTIC_ONLY", + "protocol_sha256": "92a7a56db93ea33e3fad4f722ba8d4139d3e33b9909703a7bfbc85233de973bd", + "raw_sha256": "fe8274b9c97bb5a1df76628f9dac7f5d0b68a7e50973121b93d84b6355160a1f", + "legs": [ + { + "leg": "floor/sha256_content_12k", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 118829433, + "p50": 118953994, + "max": 119040362 + }, + "wall_ns_per_op": { + "n": 3, + "min": 5941, + "p50": 5947, + "max": 5952 + }, + "cpu_us": { + "n": 3, + "min": 118830, + "p50": 118899, + "max": 119041 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 118817978, + "p50": 118835178, + "max": 119042411 + }, + "wall_ns_per_op": { + "n": 3, + "min": 5940, + "p50": 5941, + "max": 5952 + }, + "cpu_us": { + "n": 3, + "min": 118809, + "p50": 118813, + "max": 119043 + } + }, + "overhead_ppm_p50": -998, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "floor/sha256_content_12k", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 111791035, + "p50": 111823883, + "max": 111829818 + }, + "wall_ns_per_op": { + "n": 3, + "min": 5589, + "p50": 5591, + "max": 5591 + }, + "cpu_us": { + "n": 3, + "min": 111792, + "p50": 111823, + "max": 111829 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 111753242, + "p50": 111839803, + "max": 112155757 + }, + "wall_ns_per_op": { + "n": 3, + "min": 5587, + "p50": 5591, + "max": 5607 + }, + "cpu_us": { + "n": 3, + "min": 111753, + "p50": 111796, + "max": 111840 + } + }, + "overhead_ppm_p50": 142, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 98190255, + "p50": 98192751, + "max": 98218432 + }, + "wall_ns_per_op": { + "n": 3, + "min": 49095, + "p50": 49096, + "max": 49109 + }, + "cpu_us": { + "n": 3, + "min": 98191, + "p50": 98194, + "max": 98216 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 98194143, + "p50": 98232400, + "max": 98242880 + }, + "wall_ns_per_op": { + "n": 3, + "min": 49097, + "p50": 49116, + "max": 49121 + }, + "cpu_us": { + "n": 3, + "min": 98195, + "p50": 98223, + "max": 98243 + } + }, + "overhead_ppm_p50": 403, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "floor/ed25519_verify", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 47660110, + "p50": 47677871, + "max": 47685102 + }, + "wall_ns_per_op": { + "n": 3, + "min": 23830, + "p50": 23838, + "max": 23842 + }, + "cpu_us": { + "n": 3, + "min": 47660, + "p50": 47678, + "max": 47687 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 47662158, + "p50": 47662798, + "max": 47909936 + }, + "wall_ns_per_op": { + "n": 3, + "min": 23831, + "p50": 23831, + "max": 23954 + }, + "cpu_us": { + "n": 3, + "min": 47644, + "p50": 47663, + "max": 47663 + } + }, + "overhead_ppm_p50": -316, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 111267126, + "p50": 111284407, + "max": 111295270 + }, + "wall_ns_per_op": { + "n": 3, + "min": 55633, + "p50": 55642, + "max": 55647 + }, + "cpu_us": { + "n": 3, + "min": 111257, + "p50": 111286, + "max": 111289 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 111230823, + "p50": 111304871, + "max": 111336615 + }, + "wall_ns_per_op": { + "n": 3, + "min": 55615, + "p50": 55652, + "max": 55668 + }, + "cpu_us": { + "n": 3, + "min": 111232, + "p50": 111306, + "max": 111338 + } + }, + "overhead_ppm_p50": 183, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "floor/envelope_validate", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 55410753, + "p50": 55412913, + "max": 55768452 + }, + "wall_ns_per_op": { + "n": 3, + "min": 27705, + "p50": 27706, + "max": 27884 + }, + "cpu_us": { + "n": 3, + "min": 55411, + "p50": 55415, + "max": 55425 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 55405809, + "p50": 55410065, + "max": 55416418 + }, + "wall_ns_per_op": { + "n": 3, + "min": 27702, + "p50": 27705, + "max": 27708 + }, + "cpu_us": { + "n": 3, + "min": 55406, + "p50": 55410, + "max": 55417 + } + }, + "overhead_ppm_p50": -51, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 341604934, + "p50": 341777879, + "max": 341815736 + }, + "wall_ns_per_op": { + "n": 3, + "min": 170802, + "p50": 170888, + "max": 170907 + }, + "cpu_us": { + "n": 3, + "min": 341604, + "p50": 341756, + "max": 341812 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 341615527, + "p50": 341621047, + "max": 341683223 + }, + "wall_ns_per_op": { + "n": 3, + "min": 170807, + "p50": 170810, + "max": 170841 + }, + "cpu_us": { + "n": 3, + "min": 341615, + "p50": 341620, + "max": 341633 + } + }, + "overhead_ppm_p50": -458, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "floor/json_decode_submit_request", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 167358844, + "p50": 169152088, + "max": 169330089 + }, + "wall_ns_per_op": { + "n": 3, + "min": 83679, + "p50": 84576, + "max": 84665 + }, + "cpu_us": { + "n": 3, + "min": 167356, + "p50": 169152, + "max": 169326 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 168684309, + "p50": 169198280, + "max": 169286889 + }, + "wall_ns_per_op": { + "n": 3, + "min": 84342, + "p50": 84599, + "max": 84643 + }, + "cpu_us": { + "n": 3, + "min": 168684, + "p50": 169197, + "max": 169286 + } + }, + "overhead_ppm_p50": 273, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 64066347, + "p50": 75605528, + "max": 78173994 + }, + "wall_ns_per_op": { + "n": 3, + "min": 16016586, + "p50": 18901382, + "max": 19543498 + }, + "cpu_us": { + "n": 3, + "min": 5930, + "p50": 6736, + "max": 6791 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 63804826, + "p50": 70254404, + "max": 74880083 + }, + "wall_ns_per_op": { + "n": 3, + "min": 15951206, + "p50": 17563601, + "max": 18720020 + }, + "cpu_us": { + "n": 3, + "min": 5392, + "p50": 6276, + "max": 7433 + } + }, + "overhead_ppm_p50": -70776, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/every_commit/agents=1", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 64879424, + "p50": 69362990, + "max": 71102874 + }, + "wall_ns_per_op": { + "n": 3, + "min": 16219856, + "p50": 17340747, + "max": 17775718 + }, + "cpu_us": { + "n": 3, + "min": 3272, + "p50": 4117, + "max": 4318 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 58204228, + "p50": 67640786, + "max": 68157623 + }, + "wall_ns_per_op": { + "n": 3, + "min": 14551057, + "p50": 16910196, + "max": 17039405 + }, + "cpu_us": { + "n": 3, + "min": 2995, + "p50": 3641, + "max": 4057 + } + }, + "overhead_ppm_p50": -24828, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 251389131, + "p50": 255194292, + "max": 281778646 + }, + "wall_ns_per_op": { + "n": 3, + "min": 15711820, + "p50": 15949643, + "max": 17611165 + }, + "cpu_us": { + "n": 3, + "min": 20030, + "p50": 22556, + "max": 29446 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 250013922, + "p50": 263910094, + "max": 302938690 + }, + "wall_ns_per_op": { + "n": 3, + "min": 15625870, + "p50": 16494380, + "max": 18933668 + }, + "cpu_us": { + "n": 3, + "min": 19741, + "p50": 21423, + "max": 29067 + } + }, + "overhead_ppm_p50": 34153, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/every_commit/agents=4", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 242341549, + "p50": 277630953, + "max": 298631621 + }, + "wall_ns_per_op": { + "n": 3, + "min": 15146346, + "p50": 17351934, + "max": 18664476 + }, + "cpu_us": { + "n": 3, + "min": 13800, + "p50": 14535, + "max": 18102 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 245278305, + "p50": 258047398, + "max": 307946899 + }, + "wall_ns_per_op": { + "n": 3, + "min": 15329894, + "p50": 16127962, + "max": 19246681 + }, + "cpu_us": { + "n": 3, + "min": 13729, + "p50": 14220, + "max": 18035 + } + }, + "overhead_ppm_p50": -70538, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 493249042, + "p50": 526690418, + "max": 572301247 + }, + "wall_ns_per_op": { + "n": 3, + "min": 15414032, + "p50": 16459075, + "max": 17884413 + }, + "cpu_us": { + "n": 3, + "min": 38548, + "p50": 44762, + "max": 46626 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 472599912, + "p50": 486299093, + "max": 577533089 + }, + "wall_ns_per_op": { + "n": 3, + "min": 14768747, + "p50": 15196846, + "max": 18047909 + }, + "cpu_us": { + "n": 3, + "min": 40361, + "p50": 44414, + "max": 44733 + } + }, + "overhead_ppm_p50": -76688, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/every_commit/agents=8", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 501434295, + "p50": 518700937, + "max": 526608124 + }, + "wall_ns_per_op": { + "n": 3, + "min": 15669821, + "p50": 16209404, + "max": 16456503 + }, + "cpu_us": { + "n": 3, + "min": 24620, + "p50": 25527, + "max": 28413 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 465932585, + "p50": 496736679, + "max": 572710079 + }, + "wall_ns_per_op": { + "n": 3, + "min": 14560393, + "p50": 15523021, + "max": 17897189 + }, + "cpu_us": { + "n": 3, + "min": 23283, + "p50": 27492, + "max": 27804 + } + }, + "overhead_ppm_p50": -42344, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 2158768611, + "p50": 2182021406, + "max": 2190005572 + }, + "wall_ns_per_op": { + "n": 3, + "min": 16865379, + "p50": 17047042, + "max": 17109418 + }, + "cpu_us": { + "n": 3, + "min": 181939, + "p50": 181957, + "max": 185572 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 2079355581, + "p50": 2114197268, + "max": 2122737948 + }, + "wall_ns_per_op": { + "n": 3, + "min": 16244965, + "p50": 16517166, + "max": 16583890 + }, + "cpu_us": { + "n": 3, + "min": 176141, + "p50": 180254, + "max": 186297 + } + }, + "overhead_ppm_p50": -31083, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/every_commit/agents=32", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 1917250390, + "p50": 2037177570, + "max": 2105417250 + }, + "wall_ns_per_op": { + "n": 3, + "min": 14978518, + "p50": 15915449, + "max": 16448572 + }, + "cpu_us": { + "n": 3, + "min": 107822, + "p50": 109270, + "max": 110303 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 1908593351, + "p50": 2047938318, + "max": 2102942621 + }, + "wall_ns_per_op": { + "n": 3, + "min": 14910885, + "p50": 15999518, + "max": 16429239 + }, + "cpu_us": { + "n": 3, + "min": 107552, + "p50": 107688, + "max": 113699 + } + }, + "overhead_ppm_p50": 5282, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 8457592, + "p50": 8549512, + "max": 9455518 + }, + "wall_ns_per_op": { + "n": 3, + "min": 2114398, + "p50": 2137378, + "max": 2363879 + }, + "cpu_us": { + "n": 3, + "min": 3682, + "p50": 4589, + "max": 5224 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 8156726, + "p50": 8956955, + "max": 9704048 + }, + "wall_ns_per_op": { + "n": 3, + "min": 2039181, + "p50": 2239238, + "max": 2426012 + }, + "cpu_us": { + "n": 3, + "min": 3473, + "p50": 4945, + "max": 5072 + } + }, + "overhead_ppm_p50": 47656, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/group_commit/agents=1", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 6032536, + "p50": 7253328, + "max": 7785219 + }, + "wall_ns_per_op": { + "n": 3, + "min": 1508134, + "p50": 1813332, + "max": 1946304 + }, + "cpu_us": { + "n": 3, + "min": 1976, + "p50": 2915, + "max": 3337 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 5977063, + "p50": 6629708, + "max": 8059685 + }, + "wall_ns_per_op": { + "n": 3, + "min": 1494265, + "p50": 1657427, + "max": 2014921 + }, + "cpu_us": { + "n": 3, + "min": 1964, + "p50": 2658, + "max": 3379 + } + }, + "overhead_ppm_p50": -85977, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 12706884, + "p50": 12745060, + "max": 14093869 + }, + "wall_ns_per_op": { + "n": 3, + "min": 794180, + "p50": 796566, + "max": 880866 + }, + "cpu_us": { + "n": 3, + "min": 13575, + "p50": 14738, + "max": 20449 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 11930623, + "p50": 13495785, + "max": 14652561 + }, + "wall_ns_per_op": { + "n": 3, + "min": 745663, + "p50": 843486, + "max": 915785 + }, + "cpu_us": { + "n": 3, + "min": 13293, + "p50": 14183, + "max": 20243 + } + }, + "overhead_ppm_p50": 58903, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/group_commit/agents=4", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 10017346, + "p50": 10555638, + "max": 10767703 + }, + "wall_ns_per_op": { + "n": 3, + "min": 626084, + "p50": 659727, + "max": 672981 + }, + "cpu_us": { + "n": 3, + "min": 7536, + "p50": 8585, + "max": 11630 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 9964962, + "p50": 10564501, + "max": 11737133 + }, + "wall_ns_per_op": { + "n": 3, + "min": 622810, + "p50": 660281, + "max": 733570 + }, + "cpu_us": { + "n": 3, + "min": 7841, + "p50": 8584, + "max": 11781 + } + }, + "overhead_ppm_p50": 839, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 11878142, + "p50": 12658515, + "max": 13012470 + }, + "wall_ns_per_op": { + "n": 3, + "min": 371191, + "p50": 395578, + "max": 406639 + }, + "cpu_us": { + "n": 3, + "min": 24661, + "p50": 24919, + "max": 28056 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 12620995, + "p50": 13210455, + "max": 13765275 + }, + "wall_ns_per_op": { + "n": 3, + "min": 394406, + "p50": 412826, + "max": 430164 + }, + "cpu_us": { + "n": 3, + "min": 24421, + "p50": 25096, + "max": 28187 + } + }, + "overhead_ppm_p50": 43602, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/group_commit/agents=8", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 9562431, + "p50": 10350084, + "max": 12531730 + }, + "wall_ns_per_op": { + "n": 3, + "min": 298825, + "p50": 323440, + "max": 391616 + }, + "cpu_us": { + "n": 3, + "min": 14242, + "p50": 15672, + "max": 16941 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 10325060, + "p50": 10378740, + "max": 12398769 + }, + "wall_ns_per_op": { + "n": 3, + "min": 322658, + "p50": 324335, + "max": 387461 + }, + "cpu_us": { + "n": 3, + "min": 14494, + "p50": 15023, + "max": 17291 + } + }, + "overhead_ppm_p50": 2768, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 36518241, + "p50": 40726604, + "max": 41118815 + }, + "wall_ns_per_op": { + "n": 3, + "min": 285298, + "p50": 318176, + "max": 321240 + }, + "cpu_us": { + "n": 3, + "min": 111205, + "p50": 118426, + "max": 120956 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 37480455, + "p50": 39242291, + "max": 41527186 + }, + "wall_ns_per_op": { + "n": 3, + "min": 292816, + "p50": 306580, + "max": 324431 + }, + "cpu_us": { + "n": 3, + "min": 111665, + "p50": 118474, + "max": 119857 + } + }, + "overhead_ppm_p50": -36445, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "write/group_commit/agents=32", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 23576875, + "p50": 23827293, + "max": 24066111 + }, + "wall_ns_per_op": { + "n": 3, + "min": 184194, + "p50": 186150, + "max": 188016 + }, + "cpu_us": { + "n": 3, + "min": 64010, + "p50": 67259, + "max": 67821 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 21319180, + "p50": 22760806, + "max": 24361313 + }, + "wall_ns_per_op": { + "n": 3, + "min": 166556, + "p50": 177818, + "max": 190322 + }, + "cpu_us": { + "n": 3, + "min": 64167, + "p50": 65888, + "max": 67885 + } + }, + "overhead_ppm_p50": -44759, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 36753714, + "p50": 37054692, + "max": 37113188 + }, + "wall_ns_per_op": { + "n": 3, + "min": 612561, + "p50": 617578, + "max": 618553 + }, + "cpu_us": { + "n": 3, + "min": 36756, + "p50": 37057, + "max": 37096 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 36940868, + "p50": 36950244, + "max": 37075860 + }, + "wall_ns_per_op": { + "n": 3, + "min": 615681, + "p50": 615837, + "max": 617931 + }, + "cpu_us": { + "n": 3, + "min": 36923, + "p50": 36943, + "max": 37078 + } + }, + "overhead_ppm_p50": -2818, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "query/read_tree_diff", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 20027188, + "p50": 20036036, + "max": 20052148 + }, + "wall_ns_per_op": { + "n": 3, + "min": 333786, + "p50": 333933, + "max": 334202 + }, + "cpu_us": { + "n": 3, + "min": 20022, + "p50": 20038, + "max": 20056 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 20026580, + "p50": 20069589, + "max": 20096164 + }, + "wall_ns_per_op": { + "n": 3, + "min": 333776, + "p50": 334493, + "max": 334936 + }, + "cpu_us": { + "n": 3, + "min": 20028, + "p50": 20071, + "max": 20098 + } + }, + "overhead_ppm_p50": 1674, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "a725", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 10036274, + "p50": 10087155, + "max": 10094915 + }, + "wall_ns_per_op": { + "n": 3, + "min": 250906, + "p50": 252178, + "max": 252372 + }, + "cpu_us": { + "n": 3, + "min": 10038, + "p50": 10091, + "max": 10097 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 10001490, + "p50": 10039682, + "max": 10072930 + }, + "wall_ns_per_op": { + "n": 3, + "min": 250037, + "p50": 250992, + "max": 251823 + }, + "cpu_us": { + "n": 3, + "min": 10004, + "p50": 10042, + "max": 10075 + } + }, + "overhead_ppm_p50": -4706, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + }, + { + "leg": "crumb/context_advisory", + "affinity": "x925", + "control": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 5210818, + "p50": 5258514, + "max": 5276451 + }, + "wall_ns_per_op": { + "n": 3, + "min": 130270, + "p50": 131462, + "max": 131911 + }, + "cpu_us": { + "n": 3, + "min": 5211, + "p50": 5259, + "max": 5279 + } + }, + "instrumented": { + "windows": 3, + "errors": 0, + "wall_ns": { + "n": 3, + "min": 5191459, + "p50": 5240931, + "max": 5268627 + }, + "wall_ns_per_op": { + "n": 3, + "min": 129786, + "p50": 131023, + "max": 131715 + }, + "cpu_us": { + "n": 3, + "min": 5192, + "p50": 5241, + "max": 5269 + } + }, + "overhead_ppm_p50": -3343, + "pmu": { + "windows": 3, + "counted_windows": 0, + "unavailable": { + "PERMISSION_DENIED": 3 + }, + "states": {}, + "events": [], + "ratios": [] + } + } + ], + "not_run": [], + "notes": [ + "Hardware counts are supporting diagnostics, not performance claims and not qualification. Seconds per operation are the measured unit.", + "Counts are user-space only (exclude_kernel, exclude_hv) and never scaled by time_enabled/time_running; a task blocked in fdatasync is off CPU and counts nothing.", + "INSTRUMENT_UNAVAILABLE windows carry no counts. Energy is not measured by pmu-diag." + ] +} \ No newline at end of file diff --git a/evidence/bench-pmu-diagnostics/red-green/green.txt b/evidence/bench-pmu-diagnostics/red-green/green.txt new file mode 100644 index 0000000..eb91615 --- /dev/null +++ b/evidence/bench-pmu-diagnostics/red-green/green.txt @@ -0,0 +1,19 @@ +# green: cargo test --locked -p synapse-bench pmu at 601b598, 2026-10-16T07:58:06Z +test pmu_diag::tests::acceptance1_event_attr_is_user_only_inherited_counting ... ok +test pmu_diag::tests::acceptance1_schema_protocol_refuses_bad_plans ... ok +test pmu_diag::tests::acceptance1_real_host_sample_is_counted_or_typed_unavailable ... ok +test pmu_diag::tests::acceptance1_multiplexed_and_partial_residency_are_labelled_not_scaled ... ok +test pmu_diag::tests::acceptance1_malformed_reads_are_refused_never_repaired ... ok +test pmu_diag::tests::acceptance1_counted_reads_are_raw_and_attributed_per_core_class ... ok +test pmu_diag::tests::acceptance1_disabled_mode_makes_no_system_call ... ok +test pmu_diag::tests::acceptance1_permission_denied_is_instrument_unavailable_without_counts ... ok +test pmu_diag::tests::acceptance1_discovery_verifies_encodings_and_core_classes ... ok +test pmu_diag::tests::acceptance1_unsupported_or_missing_pmu_refuses_before_any_open ... ok +test pmu_diag::tests::acceptance1_crumb_leg_without_crumb_fixture_is_not_run ... ok +test pmu_diag::tests::acceptance1_verify_refuses_mismatched_pmu_output ... ok +test pmu_diag::tests::acceptance3_report_recomputes_from_raw_and_digests_verify ... ok +test pmu_diag::tests::acceptance1_manifest_attribution_and_every_leg_kind_runs ... ok +test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 58 filtered out; finished in 0.37s +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 6 filtered out; finished in 0.00s +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 15 filtered out; finished in 0.00s