jouledesk-github, Joule Code L3: meter a Mac with the SMC where IOReport is not live (stacked on #622) #624

Merged
dcharlot merged 1 commit from jouleclaw-energy/smc-consumers into main 2026-11-05 04:52:29 -05:00
Owner

Stacked on #622. It needs jouleclaw-energy's smc feature, so the base is jouleclaw-energy/smc-system. Retarget to main once #622 merges.

This turns on smc in the two consumers that bill work with the host meter. On macOS 27, IOReport's CPU rails are frozen for an unprivileged reader. In these two consumers, the SMC's whole-machine power integral (ModelBased, domain System) now replaces the load-average estimator in that case. A live IOReport counter still comes first.

Changes

  • jouledesk-github
    • detect_meter now picks the SMC. Replies say "modeled by apple-smc" and seal ModelBased.
    • Work shorter than the SMC's 2 s minimum window is posted as not metered, with the reason, as it already was for any meter.
    • The model-subprocess test's stand-in burned about one second, which is under that window. It now runs one second past the host meter's minimum window, at the loop's measured rate, so the test holds for every meter.
  • Joule Code L3 example
    • host_counter adds the SMC between IOReport and the estimator.
    • A reading taken after a window shorter than the counter's minimum is dropped (read_after), and the receipt falls back to the token estimate. The README describes the new order.
    • New tests: one covers the window rule; the host test burns past the counter's minimum and asserts the grade each meter gives.

Not changed, and why

  • Crates that never use the host fallback's figure: jouleclaw-loader-gguf, wai/tools/quantum-meter and wai/tools/ops-gpu-bench refuse it, and jouleclaw-runtime's example only prints it. In those crates the SMC would start a sampler that nothing reads.
  • mesh-meter: HwMeter doesn't check a counter's minimum window. Short served requests would carry ModelBased figures below the SMC's 2 s floor, so it needs a window rule first.

Verified

  • M3 Ultra Mac Studio (IOReport CPU rails frozen):
    • jouledesk-github seals work at ModelBased by apple-smc.
    • In the model-subprocess rounds, the model's own CPU read 20.95 J against its own 20.96 J count. Added to the SMC's figure, the total is posted as an estimate.
    • The L3 host test meters its burn at ModelBased.
  • Tests: pass on macOS (jouledesk-github, l3-jouleclaw) and on Linux (l3-jouleclaw, which takes the token estimate there).
  • Clippy: clean for jouledesk-github. l3-jouleclaw reports one manual_char_comparison in src/llama_backend.rs; this change doesn't touch that file and CI doesn't lint it.

🤖 Generated with Claude Code

**Stacked on #622.** It needs `jouleclaw-energy`'s `smc` feature, so the base is `jouleclaw-energy/smc-system`. Retarget to `main` once #622 merges. This turns on `smc` in the two consumers that bill work with the host meter. On macOS 27, IOReport's CPU rails are frozen for an unprivileged reader. In these two consumers, the SMC's whole-machine power integral (`ModelBased`, domain `System`) now replaces the load-average estimator in that case. A live IOReport counter still comes first. ## Changes - **jouledesk-github** - `detect_meter` now picks the SMC. Replies say "modeled by `apple-smc`" and seal `ModelBased`. - Work shorter than the SMC's 2 s minimum window is posted as not metered, with the reason, as it already was for any meter. - The model-subprocess test's stand-in burned about one second, which is under that window. It now runs one second past the host meter's minimum window, at the loop's measured rate, so the test holds for every meter. - **Joule Code L3 example** - `host_counter` adds the SMC between IOReport and the estimator. - A reading taken after a window shorter than the counter's minimum is dropped (`read_after`), and the receipt falls back to the token estimate. The README describes the new order. - New tests: one covers the window rule; the host test burns past the counter's minimum and asserts the grade each meter gives. ## Not changed, and why - **Crates that never use the host fallback's figure:** `jouleclaw-loader-gguf`, `wai/tools/quantum-meter` and `wai/tools/ops-gpu-bench` refuse it, and `jouleclaw-runtime`'s example only prints it. In those crates the SMC would start a sampler that nothing reads. - **`mesh-meter`:** `HwMeter` doesn't check a counter's minimum window. Short served requests would carry `ModelBased` figures below the SMC's 2 s floor, so it needs a window rule first. ## Verified - **M3 Ultra Mac Studio** (IOReport CPU rails frozen): - `jouledesk-github` seals work at `ModelBased` by `apple-smc`. - In the model-subprocess rounds, the model's own CPU read 20.95 J against its own 20.96 J count. Added to the SMC's figure, the total is posted as an estimate. - The L3 host test meters its burn at `ModelBased`. - **Tests:** pass on macOS (`jouledesk-github`, `l3-jouleclaw`) and on Linux (`l3-jouleclaw`, which takes the token estimate there). - **Clippy:** clean for `jouledesk-github`. `l3-jouleclaw` reports one `manual_char_comparison` in `src/llama_backend.rs`; this change doesn't touch that file and CI doesn't lint it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jouledesk-github, Joule Code L3: meter a Mac with the SMC's whole-machine power where IOReport is not live
All checks were successful
joule-code conformance gate / joule-moq-relay, its own energy on a counter (macos) (pull_request) Successful in 43s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 1m30s
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 12s
standards workspaces build + test / jouledesk-rs (jouledesk/jouledesk-rs, jouledesk-rs, macos) (pull_request) Successful in 1m46s
joule-code conformance gate / joule-moq-relay, every target (pull_request) Successful in 4m2s
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Successful in 2m55s
joule-code conformance gate / joule-moq-ingest, every target (pull_request) Successful in 6m0s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 5m36s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 10m55s
b9f0019ae1
Builds jouleclaw-energy with `smc` in the two consumers that bill work with the
host meter. On macOS 27, where IOReport's CPU rails are frozen for an
unprivileged reader, their host meter becomes the SMC's whole-machine power
integral (ModelBased, domain System) instead of the load-average estimator; a
live IOReport counter still comes first.

- jouledesk-github: `detect_meter` picks the SMC; replies say "modeled by
  `apple-smc`" and seal ModelBased. Work shorter than the SMC's 2 s minimum
  window is posted as not metered, with why, as it already was for any meter.
  The model-subprocess test calibrated its stand-in to about a second of CPU,
  under that window; it now runs a second past the host meter's minimum window
  at the loop's measured rate, so it holds for every meter.
- Joule Code L3 example: `host_counter` adds the SMC between IOReport and the
  estimator. A counter's reading after a window shorter than its minimum is no
  longer taken (`read_after`): the receipt falls back to the token estimate, as
  it does with no counter. The host test burns past the counter's minimum and
  asserts the grade each meter gives; a new test covers the window rule.

Not changed: crates that enable `ioreport` only for this process's own counters
and refuse the span meter's host fallback (jouleclaw-loader-gguf, wai
quantum-meter and ops-gpu-bench) or only print it (jouleclaw-runtime's example),
where the SMC would start a sampler nothing reads; mesh-meter, whose HwMeter
does not consult a counter's minimum window, so short served requests would
carry ModelBased figures below the SMC's 2 s floor.

On an M3 Ultra Mac Studio (IOReport CPU rails frozen): jouledesk-github seals
work at ModelBased by `apple-smc` and the model-subprocess rounds read the
model's own CPU (21 J against its own 21 J count) plus the SMC's figure, posted
as an estimate; the L3 host test meters its burn at ModelBased. Tests pass on
macOS (jouledesk-github, l3-jouleclaw) and Linux (l3-jouleclaw, token estimate);
clippy is clean for jouledesk-github. l3-jouleclaw's clippy reports one
manual_char_comparison in src/llama_backend.rs, which this change does not touch
and CI does not lint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dcharlot changed target branch from jouleclaw-energy/smc-system to main 2026-11-05 04:31:42 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!624
No description provided.