meters: clippy-clean in every Linux configuration, and a CI gate for it #650
Loading…
Reference in a new issue
No description provided.
Delete branch "meters/clippy-clean"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
jouleclaw-energy(rapl)probe_packagesnow callsliveness::probedirectly (identical:probeisprobe_steppingwith a no-op), soprobeis no longer dead. The test-onlyprobe_packages_steppingis#[cfg(test)].jouleclaw-energy,jcp-energy,eoc-meterandsandbox-meterNVML hardware teststype_complexityerrors: the nvidia-smi triple is now atype SmiPoweralias in each oracle.jcp-energymuts off macOS (the vectors are filled only on macOS): split into a macOS body and an empty non-macOS body.has_backendis rewritten as the equivalentmatches!.rsplit(['/', ' ']). A constantassert!(!cfg!(..))(from #624) becomesif cfg!(..) { panic!(..) }. A per-itemallow(dead_code), with a reason, on a helper one test binary doesn't use, as its sibling already has.CI
standards-build.yml: ameter_lintmatrix key and a step, "clippy on the Linux meter code". It runs--all-targets --no-deps -D warningson each workspace's own runner, for:jcp-energy(default,nvml)eoc-meter(default,cuda)sandbox-meterjouleclaw-energy(default,rapl,nvml,rapl,nvml)joule-code-conformance.yml: the L3 example is now linted after its tests.Verified
jouleclaw-energy: 89 withrapl, 96 withrapl,nvmljcp-energy: 68, and 70 withnvmleoc-meterwithcuda: 77sandbox-meter: 166nvml_hardwaretests passstandards-touched.pyparses the new key, both workflows parse as YAML, andcheck-workflow-concurrency.shpasses.🤖 Generated with 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]>