open-standards/joule-code/examples/l3-jouleclaw/tests/fabric_grade_seeded.rs
Transaction Science b22d3cd496 jouleclaw-fabric: seed the CPU and AMX matmul figures Estimated, not Benchmarked
local/cpu-neon (130 mJ/GFLOP) and local/amx (7 mJ/GFLOP) were seeded
Benchmarked, though each is a recorded throughput priced at an ASSUMED
~5 W core draw: the energy was never read. l3-jouleclaw's
projection_grade rightly treats Benchmarked as a calibrated input, so
with JOULECLAW_FABRIC=1 and no calibration row this host recorded, a
projection priced from these seeds was sealed ModelBased: an
uncalibrated constant claiming a model's grade (JCP SPEC §5.1 rung 6).

The seeds are now Estimated, as the GPU seeds already were, so a seeded
projection is an Estimator figure and a host calibration row still
replaces the seed at the grade its writer declared. EnergyProvenance's
docs say an assumed power makes a figure Estimated.

New tests: jouleclaw-fabric every_seeded_figure_is_an_estimate, and
l3-jouleclaw tests/fabric_grade_seeded.rs (fabric on, no calibration
file: the cpu-neon entry is Estimated and the receipt Estimator). The
existing calibrated/estimated fabric-grade tests are unchanged and pass.
No vector carries a fabric seed's grade.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 10:11:54 -04:00

21 lines
1.1 KiB
Rust

//! The L3 stage grades a fabric-priced figure by its weakest input: with no
//! calibration row, the member that ran is priced by its seeded figure, an
//! assumed power over a throughput, which no host calibrated, so the receipt
//! says Estimator, never ModelBased.
//! Its own test process, because the fabric is discovered once per process.
mod common;
use joule_code_receipt::Provenance;
use jouleclaw_fabric::EnergyProvenance;
#[test]
fn a_call_priced_by_seeded_figures_is_an_estimate() {
let (energy, window) = common::resolve_seeded();
eprintln!("window: {window:?}\nenergy: {energy:?}");
let neon = window.iter().find(|e| e.member_id == "local/cpu-neon").expect("the m=1 matmul ran on cpu-neon");
assert_eq!(neon.projected_grade, Some(EnergyProvenance::Estimated), "a seeded figure is an estimate");
assert!(neon.projected_uj.is_some_and(|uj| uj > 0.0), "the seeded figure priced the matmul: {neon:?}");
assert_eq!((energy.provenance, energy.measured_uj), (Provenance::Estimator, None), "{energy:?}");
assert!(energy.check_provenance().is_ok());
}