open-standards/eoc/eoc-rs/crates
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 0f6a9a3bb3 eoc-meter: the process counter reads its own count only once the reading thread has left its core
The kernel adds a thread's CPU energy to its process's count
(proc_pid_rusage ri_energy_nj) only when the thread leaves a core, and a
process's read of its own count does not take the reading thread off its
core. MacosProcessEnergyCounter read the count as it stood, so a span
bracketed by two reads held up to a scheduling quantum of what the
thread spent before the span and lacked the span's own tail, and every
consumer here tags a positive delta of the counter Measured.

Measured on an M3 Ultra (macOS 27.0.1, load average about 14) against
the tests' own reader, which sleeps before each read until the process's
context-switch count rose; three runs of 40 spans of each kind:
- 1 ms of the reading thread's CPU between two reads: 39, 40 and 40
  spans read nothing or under two thirds of the work;
- a 2 ms sleep between two reads, straight after 8 ms of CPU: 40, 40 and
  37 spans read the burn before them, about 41 mJ for a sleep.

read_microjoules now sleeps (50 us, then 200 us, 1 ms, 5 ms) until the
reading thread's own energy count (proc_pidinfo PROC_PIDTHREADCOUNTS,
read only in the one layout known: 88 bytes, two performance levels
here) rose across a sleep, and only then reads the process. A read whose
thread was not seen to leave is an error, not a short count: eoc-cascade,
eoc-agent and eoc-local all take a failed read as no span and keep their
estimate. process_energy_status is Unavailable, with no probe run, where
the thread's count does not read, and the liveness probe still samples
with no sleep. The rule and the layout decoding are pure and compiled on
every platform.

With it, on that host, quiet and under 40 busy loops (110 runs): every
1 ms span read 79% or more of the tests' window around it (98% when
quiet) and no sleep read more than 3% of the window that held the burn.
A read costs 83 us at the median on the quiet host and 226 us under the
busy loops, against under 1 us; detect_in_process's docs say so, and
that a batch of short operations is bracketed by one span, not one each.

tests/process_energy_short_span.rs is the test that fails without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 20:50:53 -04:00
..
eoc eoc: the in-process burn test's backend is built only on macOS, where its one test runs 2026-09-30 22:41:13 -04:00
eoc-agent eoc-agent: a local model's measured step is a measured span 2026-10-01 01:27:42 -04:00
eoc-cache eoc-cascade: a cache hit claims no measurement, and a total is measured only if every microjoule was read 2026-09-30 20:17:08 -04:00
eoc-carbon eoc-carbon: an account and an SCI score are measured only where every part was, and a run with no correct answer has no score 2026-09-30 21:07:25 -04:00
eoc-cascade eoc-cascade: a cache hit claims no measurement, and a total is measured only if every microjoule was read 2026-09-30 20:17:08 -04:00
eoc-core eoc-meter: the GPU counter is never the cascade's counter, and one past its board is Implausible 2026-10-01 10:18:29 -04:00
eoc-distributed ingest wave A4: 3 crates · smart-byte-atproto + op-openbanking + eoc-distributed 2026-05-24 12:22:09 -04:00
eoc-embeddings Repo-wide toolchain refresh + jouleclaw policy/sandbox updates 2026-06-07 17:04:45 -04:00
eoc-eval eoc-carbon: an SCI score is only as measured as the joules it was computed from 2026-09-30 20:17:24 -04:00
eoc-graph Parallel ingest: 9 issues' worth of work across openpay / smart-byte / eoc 2026-05-23 13:24:05 -04:00
eoc-kv Parallel ingest: 9 issues' worth of work across openpay / smart-byte / eoc 2026-05-23 13:24:05 -04:00
eoc-local eoc: the CLI's cascade is metered by this process's own counter, because all of its stages run in-process 2026-09-30 22:39:01 -04:00
eoc-memory ingest wave F: 3 crates · op-crypto-extra + smart-byte-acdc + eoc-memory 2026-05-24 17:28:24 -04:00
eoc-meter eoc-meter: the process counter reads its own count only once the reading thread has left its core 2026-10-12 20:50:53 -04:00
eoc-multimodal Repo-wide toolchain refresh + jouleclaw policy/sandbox updates 2026-06-07 17:04:45 -04:00
eoc-neural Parallel ingest: 9 issues' worth of work across openpay / smart-byte / eoc 2026-05-23 13:24:05 -04:00
eoc-observability ingest wave C: 3 crates · op-statements + smart-byte-activitypub + eoc-observability 2026-05-24 13:51:09 -04:00
eoc-quantize ingest wave D: 3 crates · op-fraud-graph + smart-byte-ilp + eoc-quantize 2026-05-24 16:10:10 -04:00
eoc-rag ingest wave A3: 3 crates · op-ewallets-asia + smart-byte-zk + eoc-rag 2026-05-24 12:08:49 -04:00
eoc-rerank Repo-wide toolchain refresh + jouleclaw policy/sandbox updates 2026-06-07 17:04:45 -04:00
eoc-route-learned eoc-route-learned: unbreak the build — rand_distr 0.4 pulled rand 0.8 2026-07-20 12:46:50 -04:00
eoc-safety ingest wave E: 3 crates · op-bin + smart-byte-tendermint + eoc-safety 2026-05-24 16:52:07 -04:00
eoc-spec-decode Repo-wide toolchain refresh + jouleclaw policy/sandbox updates 2026-06-07 17:04:45 -04:00
eoc-streaming eoc-streaming: a stream nothing metered has no energy figure, never 0 µJ 2026-09-30 20:17:36 -04:00
eoc-tools eoc: pin rand off 0.10.2, which does not compile 2026-08-27 13:32:56 -04:00
eoc-vendor-api Repo-wide toolchain refresh + jouleclaw policy/sandbox updates 2026-06-07 17:04:45 -04:00
eoc-wasm Parallel ingest: 9 issues' worth of work across openpay / smart-byte / eoc 2026-05-23 13:24:05 -04:00