ci(standards-build): exercise the macOS energy backend, which nothing did #100

Merged
dcharlot merged 1 commit from ci/macos-energy-backend into main 2026-09-21 15:12:31 -04:00

View file

@ -197,3 +197,60 @@ jobs:
env:
RUSTFLAGS: ${{ matrix.rustflags }}
run: cargo run -q -p ${{ matrix.conformance }} --bin ${{ matrix.conformance }}
# ── The macOS energy backend is exercised NOWHERE otherwise ───────────────
#
# `jcp-energy`'s IOReport meter — the Apple Silicon rung of the energy
# ladder — is behind `#[cfg(target_os = "macos")]`, and `jcp-rs` is pinned to
# the linux runner above. A platform-gated test plus a single-platform runner
# assignment is zero coverage, and it is indistinguishable from passing: the
# code compiles out, the suite reports green, and nothing has been measured.
# Same family as a feature-gated test with no `--features`, with `target_os`
# as the gate.
#
# This is not hypothetical. On 2026-09-19 the counter read 0 µJ across a full
# run on the dev Mac — `IoReport::open()` succeeding while `read_uj()`
# returned nothing — and by 2026-09-21 it had healed with no code change in
# between. Both observations came from a human running the suite by hand;
# CI saw neither. A meter that silently reads zero and later recovers is
# exactly the failure a human spot-check is worst at catching.
#
# Deliberately narrow: `-p jcp-energy` only. `jcp-rs` stays on linux, so this
# ADDS the platform that was missing rather than trading one for the other,
# and it costs one small crate rather than a second full workspace run.
#
# Verified to catch the real symptom: forcing `read_uj()` to return `Some(0)`
# makes `cumulative_advances_after_cpu_burn` fail with
# `energy must advance: before=0 after=0` — byte-identical to what was
# observed on 2026-09-19.
macos-energy-backend:
name: macOS energy backend (jcp-energy)
runs-on: macos
steps:
- uses: actions/checkout@v4
- name: Install Rust (workspace pin)
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Cache cargo registry + target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
jcp/jcp-rs/target
key: standards-jcp-energy-macos-${{ hashFiles('jcp/jcp-rs/Cargo.lock', 'rust-toolchain.toml') }}
restore-keys: |
standards-jcp-energy-macos-
# `--lib` keeps this to the crate's own tests, which is where every
# `cfg(target_os = "macos")` block in this crate lives.
- name: Energy backend tests (the cfg(macos) blocks)
working-directory: jcp/jcp-rs
run: cargo test --lib -p jcp-energy