jcp-intercept: a reading meter meters a seam as one span, divided among its steps by CPU time #236

Merged
dcharlot merged 2 commits from feat/intercept-one-span-per-pass into main 2026-10-13 09:31:28 -04:00

2026-10-13

Transaction Science
jcp README: how an intercept step's joules are metered where the meter reads a counter
All checks were successful
energy meters on real hardware / RAPL and NVML on jetson-hub (pull_request) Successful in 42s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 54s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m22s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 4m30s
standards workspaces build + test / aac-rs (pull_request) Successful in 2m36s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 1m22s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 56s
standards workspaces build + test / map-rs (pull_request) Successful in 54s
standards workspaces build + test / mesh-rs (pull_request) Successful in 52s
standards workspaces build + test / openpay (pull_request) Successful in 3m6s
lockfiles / every Cargo.lock is current (pull_request) Successful in 31s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no comparison (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no company or product (pull_request) Successful in 3s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m9s
standards workspaces build + test / eoc-rs (pull_request) Successful in 2m7s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m40s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m10s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m10s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m17s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m14s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m23s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m46s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 02:43:59 -04:00
Transaction Science
jcp-intercept: a reading meter meters a seam as one span, divided among its steps by CPU time
Every interceptor step was metered as a span of its own. Where the meter
reads this process's energy count, each read first takes the reading
thread off its core (#229): tens of microseconds and its own wake-up. An
interceptor step is often a few microseconds, so a span of its own read
as mostly the meter, and a chain of k interceptors paid 2k reads per seam.

A meter that reads a counter now meters the whole seam pass as one span
(two reads per seam), and the steps are sealed after it closes, each with
its share of the reading by its own thread CPU time, which is exact and
read at no cost. The shares are integer micro-joules that sum to the
reading exactly (largest remainder); a share of a reading is ModelBased,
a pass of one step keeps the reading's own grade, and coverage is the
pass's. A meter that reads nothing (a model, a constant) still meters
each step on its own, so the receipts sealed with it are byte-identical.

jcp-energy exposes the thread CPU clock it already had
(`thread_cpu_time`). On the M3 Ultra, three steps burning 2, 4 and 8 ms
were sealed 10.8, 21.5 and 42.8 mJ, summing to the chain's figure and to
96-97% of an independent read around the pass, in 10 of 10 rounds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 02:41:41 -04:00