meters: clippy-clean in every Linux configuration, and a CI gate for it #650

Merged
dcharlot merged 6 commits from meters/clippy-clean into main 2026-11-06 02:39:54 -05:00
Owner

The meter crates carried clippy errors in their Linux configurations. No CI job linted those configurations, so the errors went unseen and kept tripping this week's meter work. This PR fixes them without changing behaviour, and adds a gate so they can't come back.

Fixes

Crate Fix
jouleclaw-energy (rapl) probe_packages now calls liveness::probe directly (identical: probe is probe_stepping with a no-op), so probe is no longer dead. The test-only probe_packages_stepping is #[cfg(test)].
jouleclaw-energy, jcp-energy, eoc-meter and sandbox-meter NVML hardware tests type_complexity errors: the nvidia-smi triple is now a type SmiPower alias in each oracle.
jcp-energy Two unused muts off macOS (the vectors are filled only on macOS): split into a macOS body and an empty non-macOS body. has_backend is rewritten as the equivalent matches!.
Joule Code L3 example rsplit(['/', ' ']). A constant assert!(!cfg!(..)) (from #624) becomes if cfg!(..) { panic!(..) }. A per-item allow(dead_code), with a reason, on a helper one test binary doesn't use, as its sibling already has.

CI

  • standards-build.yml: a meter_lint matrix key and a step, "clippy on the Linux meter code". It runs --all-targets --no-deps -D warnings on each workspace's own runner, for:
    • jcp-energy (default, nvml)
    • eoc-meter (default, cuda)
    • sandbox-meter
    • jouleclaw-energy (default, rapl, nvml, rapl,nvml)
  • joule-code-conformance.yml: the L3 example is now linted after its tests.

Verified

  • Linux: before this change, these configurations had 1–6 errors each. All are clean now.
  • Linux tests:
    • jouleclaw-energy: 89 with rapl, 96 with rapl,nvml
    • jcp-energy: 68, and 70 with nvml
    • eoc-meter with cuda: 77
    • sandbox-meter: 166
    • L3 example: 16
    • nvml_hardware tests pass
  • macOS: every macOS clippy line in CI for these crates is clean, and the macOS tests pass.
  • Workflow checks: standards-touched.py parses the new key, both workflows parse as YAML, and check-workflow-concurrency.sh passes.

🤖 Generated with Claude Code

The meter crates carried clippy errors in their Linux configurations. No CI job linted those configurations, so the errors went unseen and kept tripping this week's meter work. This PR fixes them without changing behaviour, and adds a gate so they can't come back. ## Fixes | Crate | Fix | |---|---| | `jouleclaw-energy` (`rapl`) | `probe_packages` now calls `liveness::probe` directly (identical: `probe` is `probe_stepping` with a no-op), so `probe` is no longer dead. The test-only `probe_packages_stepping` is `#[cfg(test)]`. | | `jouleclaw-energy`, `jcp-energy`, `eoc-meter` and `sandbox-meter` NVML hardware tests | `type_complexity` errors: the nvidia-smi triple is now a `type SmiPower` alias in each oracle. | | `jcp-energy` | Two unused `mut`s off macOS (the vectors are filled only on macOS): split into a macOS body and an empty non-macOS body. `has_backend` is rewritten as the equivalent `matches!`. | | Joule Code L3 example | `rsplit(['/', ' '])`. A constant `assert!(!cfg!(..))` (from #624) becomes `if cfg!(..) { panic!(..) }`. A per-item `allow(dead_code)`, with a reason, on a helper one test binary doesn't use, as its sibling already has. | ## CI - **`standards-build.yml`:** a `meter_lint` matrix key and a step, "clippy on the Linux meter code". It runs `--all-targets --no-deps -D warnings` on each workspace's own runner, for: - `jcp-energy` (default, `nvml`) - `eoc-meter` (default, `cuda`) - `sandbox-meter` - `jouleclaw-energy` (default, `rapl`, `nvml`, `rapl,nvml`) - **`joule-code-conformance.yml`:** the L3 example is now linted after its tests. ## Verified - **Linux:** before this change, these configurations had 1–6 errors each. All are clean now. - **Linux tests:** - `jouleclaw-energy`: 89 with `rapl`, 96 with `rapl,nvml` - `jcp-energy`: 68, and 70 with `nvml` - `eoc-meter` with `cuda`: 77 - `sandbox-meter`: 166 - L3 example: 16 - `nvml_hardware` tests pass - **macOS:** every macOS clippy line in CI for these crates is clean, and the macOS tests pass. - **Workflow checks:** `standards-touched.py` parses the new key, both workflows parse as YAML, and `check-workflow-concurrency.sh` passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- `--features rapl` alone: `liveness::probe` was never used. The RAPL probe
  reached the same code through `probe_packages_stepping(packages, || {})`,
  though rapl.rs documents its probe as `crate::liveness::probe`.
  `probe_packages` now calls `crate::liveness::probe` directly, which is the
  same call (probe = probe_stepping with a no-op step), and
  `probe_packages_stepping`, which only tests use, is `#[cfg(test)]`.
- `--features nvml`: tests/nvml_hardware.rs spelled an `nvidia-smi` power
  triple out three times (type_complexity). It is now the oracle's
  `SmiPower` alias.

Clippy -D warnings is clean on Linux (default, rapl, nvml, rapl+nvml) and
macOS (default, ioreport, smc, ioreport+smc, rapl). Tests pass: Linux rapl
(89) and rapl+nvml (96), macOS rapl lib (95).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `FabricMeter::readable` and `FabricMeter::measure` built their vector
  `mut` on every platform and pushed to it only on macOS, so Linux reported
  two unused `mut`s. Each now has a macOS body that builds and returns the
  vector, and a body for everywhere else that returns it empty. The behaviour
  is the same on both.
- `FabricSource::has_backend`: with `nvml` on, its match folded to a
  `matches!` (match_like_matches_macro). It is written as one, with the nvml
  arm still gated on the feature.
- tests/nvml_hardware.rs: the `nvidia-smi` power triple is the oracle's
  `SmiPower` alias (type_complexity under `--features nvml`).

Clippy -D warnings is clean on Linux (default, nvml) and in the macOS lint
step (jcp-energy, jcp-gateway). Tests pass: Linux default (68) and nvml (70),
macOS lib (128).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/nvml_hardware.rs spelled `(Option<f64>, Option<f64>, Option<f64>)`
out three times, which clippy flags as type_complexity under `--features
cuda`. It is now the oracle's `SmiPower` alias. Clippy -D warnings is clean on
Linux (default, cuda) and in the macOS lint step; Linux tests with cuda pass
(77).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/nvml_hardware.rs spelled `(Option<f64>, Option<f64>, Option<f64>)`
out three times, which clippy flags as type_complexity on Linux. It is now
the oracle's `SmiPower` alias. Clippy -D warnings is clean on Linux and in the
macOS lint step (sandbox-meter, sandbox-proof); Linux tests pass (166).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- src/llama_backend.rs: `rsplit(|c: char| c == '/' || c == ' ')` is now
  `rsplit(['/', ' '])` (manual_char_comparison); it splits the same way.
- src/bin/run.rs: the host test's catch-all arm asserted
  `!cfg!(macOS on aarch64)`, a constant assertion (assertions_on_constants).
  It is now an `if cfg!(...)` that panics with the same message.
- tests/common/mod.rs: each test binary compiles the shared module on its own,
  and the seeded test calls no `resolve_priced_at`. It gets the per-item
  `#[allow(dead_code)]` its sibling `resolve_seeded` already has, with the
  reason. `#[expect]` cannot work here: it would be unfulfilled in the
  binaries that do call it.

`cargo clippy --all-targets --no-deps -- -D warnings` is clean on Linux and
macOS, and the tests pass (16). The path dependencies' own rustc warnings
(jouleclaw-backend-apple, jouleclaw-topology, jouleclaw-backend-reference on
Linux) are not this crate's and are not denied by `--no-deps`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ci: lint the meter crates' Linux configurations, and the L3 example
All checks were successful
standards workspaces build + test / arl-rs (arl/arl-rs, arl-rs, linux) (pull_request) Successful in 39s
standards workspaces build + test / sense-rs (sense/sense-rs, sense-rs, linux) (pull_request) Successful in 26s
standards workspaces build + test / proof-rs (proof/conformance/v1/joulespec.toml, proof-conformance, proof/proof-rs, proof-rs, linux, true) (pull_request) Successful in 1m19s
standards workspaces build + test / joulehook-rs (joulehook/joulehook-rs, joulehook-rs, linux) (pull_request) Successful in 1m41s
standards workspaces build + test / jcp-rs (jcp-conformance, jcp/jcp-rs, -p jcp-energy --features nvml, jcp-energy jcp-energy:nvml, jcp-rs, linux) (pull_request) Successful in 1m53s
standards workspaces build + test / joulespec-rs (true, joulespec/joulespec-rs, true, joulespec-rs, linux) (pull_request) Successful in 1m27s
standards workspaces build + test / sandbox-rs (sandbox-conformance, sandbox/sandbox-rs, -p sandbox-tee --features amd-kds,intel-pcs, sandbox-meter, sandbox-rs, linux) (pull_request) Successful in 2m8s
standards workspaces build + test / eoc-rs (eoc/eoc-rs, -p eoc-meter --features cuda, eoc-meter eoc-meter:cuda, eoc-rs, linux) (pull_request) Successful in 2m46s
standards workspaces build + test / smart-byte-rs (smart-byte/smart-byte-rs, smart-byte-rs, linux) (pull_request) Successful in 3m8s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m30s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness (pull_request) Successful in 3m43s
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Successful in 21m17s
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Successful in 24m53s
energy meters on real hardware / sink decode table · per-task energy and the GPU rail on macOS (pull_request) Successful in 2m45s
joule-code conformance gate / joule-moq-relay, its own energy on a counter (macos) (pull_request) Successful in 1m19s
standards workspaces build + test / joulespec-proofs (joulespec/joulespec-rs, joulespec-proofs, true, macos) (pull_request) Successful in 1m5s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 2m35s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 4m12s
standards workspaces build + test / jouledesk-rs (jouledesk/jouledesk-rs, jouledesk-rs, macos) (pull_request) Successful in 6m32s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 12m30s
joule-code conformance gate / joule-moq-relay, every target (pull_request) Successful in 2m54s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 2m9s
joule-code conformance gate / joule-moq-ingest, every target (pull_request) Successful in 5m11s
standards workspaces build + test / jouleclaw-rs (-nodebug, jouleclaw/jouleclaw-rs, -p jouleclaw-energy --features rapl,nvml, jouleclaw-energy jouleclaw-energy:rapl jouleclaw-energy:nvml jouleclaw-energy:rapl,nvml, jouleclaw-rs, linux-arm64, -C target-feature=+fp16) (pull_request) Successful in 3m22s
standards workspaces build + test / joulecontract-rs (joulecontract/joulecontract-rs, joulecontract-rs, linux-arm64, true) (pull_request) Successful in 53s
standards workspaces build + test / aac-rs (aac-conformance, aac/aac-rs, aac-rs, linux-arm64) (pull_request) Successful in 3m5s
standards workspaces build + test / map-rs (map-conformance, map/map-rs, map-rs, linux-arm64) (pull_request) Successful in 57s
standards workspaces build + test / mesh-rs (mesh/mesh-rs, -p mesh-engine-gguf -p mesh-openai --features mesh-engine-gguf/gguf,mesh-openai/server, mesh-rs, linux-arm64) (pull_request) Successful in 54s
standards workspaces build + test / openpay (openpay, openpay, linux-arm64) (pull_request) Successful in 3m50s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 14m48s
48412b8df4
The macOS lint step lints jcp-energy, eoc-meter, sandbox-meter and
jouleclaw-energy only as macOS builds them. The matrix's clippy gate is opt-in
per workspace, and none of these workspaces has it. So their Linux code (RAPL
through powercap and the MSRs, NVML, CUDA) was linted by no job.
jouleclaw-energy's `rapl` build carried a dead function, and four crates' NVML
hardware tests a clippy error, for as long as they existed.

- standards-build.yml: a matrix key `meter_lint` lists configurations
  (`package` or `package:features`), and a step "clippy on the Linux meter
  code" lints each one with `--all-targets --no-deps -D warnings` on the
  workspace's own runner, beside the feature-gated energy tests. The entries:
  - jcp-rs: jcp-energy, jcp-energy:nvml
  - eoc-rs: eoc-meter, eoc-meter:cuda
  - sandbox-rs: sandbox-meter
  - jouleclaw-rs: jouleclaw-energy, and with rapl, nvml and rapl,nvml
  scripts/standards-touched.py reads the new key like the others.
- joule-code-conformance.yml: "L3 JouleClaw binding example lints clean"
  (`--no-deps`), after its tests.

The step's loop was run verbatim on Linux x86_64 for each entry: all clean.
Both workflows parse, and the workflow-concurrency check passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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!650
No description provided.