open-standards/eoc/eoc-rs/crates/eoc-meter
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 1bae1ea17d eoc-meter: real IOReport energy on Apple Silicon (was a stub)
eoc-meter's macOS counter was an explicit stub that always errored, so
every reading on Apple Silicon degraded to JouleSource::Estimated (zero
real energy). Port the validated, no-sudo, no-external-binary IOReport
Energy-Model FFI reader (from jouleclaw-energy's apple_ioreport) as
MacosIoReportCounter and prefer it in detect() ahead of the powermetrics
stub, so eoc reports Measured energy on this platform.

Relaxed the crate-root #![forbid(unsafe_code)] to #![deny] with a scoped
#[allow(unsafe_code)] on the single audited FFI module — real hardware
reads are unreachable without the unsafe IOReport calls; everything else
stays unsafe-free.

Validated on Apple Silicon: ioreport_advances_after_cpu_burn passes (real
energy advances after a CPU burn); detect() returns the ioreport counter.
5 tests green, clippy clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-25 03:58:42 -04:00
..
src eoc-meter: real IOReport energy on Apple Silicon (was a stub) 2026-06-25 03:58:42 -04:00
Cargo.toml Parallel ingest: 9 issues' worth of work across openpay / smart-byte / eoc 2026-05-23 13:24:05 -04:00