//! The L3 stage grades a fabric-priced figure by its weakest input: with the //! member that ran priced by an `Estimated` figure, the receipt says Estimator. //! 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_an_estimated_figure_is_an_estimate() { let (energy, window) = common::resolve_priced_at("estimated", Some(EnergyProvenance::Estimated)); 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), "the ledger carries the row's grade"); assert!(energy.estimated_uj > 0, "the projection is reported: {energy:?}"); assert_eq!((energy.provenance, energy.measured_uj), (Provenance::Estimator, None), "{energy:?}"); assert!(energy.check_provenance().is_ok()); }