Skip to content

Wattch Core

A protocol-first Rust measurement spine that separates privileged energy acquisition from unprivileged CLI, Python and VS Code workflows while preserving replayable raw evidence.

Role
Chakib designed and implemented the daemon/client boundary, typed protocol and validation model, Linux RAPL and synthetic acquisition paths, replayable CLI artifacts, the pywattch client and the Energy Tests developer workflow.
Current status
The public foundation supports Linux RAPL and synthetic acquisition, a strict local protocol, deterministic test scenarios, CLI capture/inspect/validate workflows, replayable traces, a pywattch Python API and VS Code Energy Tests. It does not claim per-process energy allocation or absolute meter accuracy.
01

Context and problem

Hardware energy counters can require elevated access, while developers, tests and benchmark tools need a safe workflow that preserves source meaning and does not turn noisy machine-level evidence into false process-level precision.

02

Ownership and contribution

Chakib designed and implemented the daemon/client boundary, typed protocol and validation model, Linux RAPL and synthetic acquisition paths, replayable CLI artifacts, the pywattch client and the Energy Tests developer workflow.

Responsibilities

  • Implemented the Rust domain, protocol, daemon, powerd, deterministic test daemon and CLI crates.
  • Defined typed source descriptors, evidence classes, sequence invariants and versioned local frames.
  • Built replayable capture/inspect/validate artifacts and a pyJoules-compatible Python client.
  • Added Energy Tests discovery and a VS Code results surface with per-domain joule and budget columns.
  • Documented privilege, socket permissions, counter semantics, failure behavior and explicit non-goals.
03

Architecture and data flow

A privileged wattch-powerd daemon reads Linux RAPL counters or a synthetic source and serves strict, versioned frames over a local Unix socket. Unprivileged CLI and Python clients capture source descriptors and raw sample batches into immutable run artifacts; inspection, tests and later interpretation stay outside the acquisition path.

  1. Linux RAPL powercap or synthetic source
  2. wattch-powerd acquisition daemon
  3. Versioned local Unix-socket protocol
  4. CLI / pywattch / Energy Tests
  5. Manifest + descriptors + raw trace
  6. Offline inspect and validation
04

Engineering decisions

Separate privileged acquisition from unprivileged clients.

RAPL access can require elevation; the Unix socket becomes a narrow, auditable boundary.Alternative not selected: Letting every Python or CLI process read protected counters directly.

Keep the daemon deliberately interpretation-free.

Raw descriptors and samples remain replayable while aggregation, comparison and claims evolve offline.Alternative not selected: Embedding baselines, joules-per-token, scoring or optimization advice in the acquisition path.

05

Reliability, security and evaluation

  • Descriptor and sample invariants reject unknown sources, invalid units and non-monotonic sequences.
  • The deterministic daemon and checked-in scenarios validate the same protocol path without presenting synthetic values as hardware measurements.
  • CI runs Rust formatting, Clippy with warnings denied, workspace tests, Python-client tests and extension tests.
06

Outcome and status

The public foundation supports Linux RAPL and synthetic acquisition, a strict local protocol, deterministic test scenarios, CLI capture/inspect/validate workflows, replayable traces, a pywattch Python API and VS Code Energy Tests. It does not claim per-process energy allocation or absolute meter accuracy.

Technology groups

Systems

Rust, Linux, RAPL, Unix sockets

Clients

CLI, Python, pyJoules API, VS Code

Evidence

Typed descriptors, Deterministic daemon, Replayable traces

07

Proof and source material

Wattch Core Energy Tests result surface showing three deterministic demo tests with time, energy domains and budget columns
The shipped Energy Tests surface rendered from an actual deterministic demo run; synthetic values verify the workflow, not physical hardware.