Some checks failed
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Has been cancelled
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Has been cancelled
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Has been cancelled
standards workspaces build + test / jouleclaw-rs (pull_request) Has been cancelled
standards workspaces build + test / aac-rs (pull_request) Has been cancelled
standards workspaces build + test / arl-rs (pull_request) Has been cancelled
standards workspaces build + test / eoc-rs (pull_request) Has been cancelled
standards workspaces build + test / jcp-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-code-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-ui-rs (pull_request) Has been cancelled
standards workspaces build + test / joulecontract-rs (pull_request) Has been cancelled
standards workspaces build + test / jouledesk-rs (pull_request) Has been cancelled
standards workspaces build + test / joulehook-rs (pull_request) Has been cancelled
standards workspaces build + test / map-rs (pull_request) Has been cancelled
standards workspaces build + test / mesh-rs (pull_request) Has been cancelled
standards workspaces build + test / openpay (pull_request) Has been cancelled
standards workspaces build + test / proof-rs (pull_request) Has been cancelled
standards workspaces build + test / sandbox-rs (pull_request) Has been cancelled
standards workspaces build + test / sense-rs (pull_request) Has been cancelled
standards workspaces build + test / smart-byte-rs (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backend (jcp-energy) (pull_request) Has been cancelled
The L3 stage tagged every per-call figure a backend reported as ModelBased, on the premise that it was "priced by THIS machine's IOReport calibration". It is priced by whatever matmul figure each fabric member loaded: a calibration row at the grade its writer declared, or a seeded figure, and the seeded GPU figures are `Estimated` (a coarse model). A projection priced from an estimate was sealed as a calibrated per-operation model. Joule-code SPEC §6 keeps those apart: ModelBased is "computed from a calibrated per-operation model", Estimator "a coarse constant estimator". The fix needs each input's grade, which the ledger did not carry. - jouleclaw-loader-gguf: `LedgerEntry` gains `projected_grade`, the `EnergyProvenance` of the cost row that priced `projected_uj`, taken from the same row, so the two are present or absent together. Additive; nothing else constructs the struct. - l3-jouleclaw: `projection_grade(window)` grades a projection by its weakest input. ModelBased only when every member that ran was priced by a `Measured` or `Benchmarked` figure; Estimator when any was priced by an `Estimated` figure, when any ran unpriced (its work is missing from the sum), or when the window is empty (a figure no priced input accounts for). A projection is never a reading, so it is never HwShunt. The stage now opens the attribution window around the call itself (reset before, snapshot after), so a figure is graded by this call's inputs and not by entries an earlier call left behind. Tests. The grading table covers Measured, Benchmarked, both, Estimated alone and beside each calibrated grade, an unpriced member, and no input. In the stage, a backend that runs a real matmul through the dispatcher with the fabric off, and one that runs nothing, both report 0.25 J and get Estimator (main: ModelBased). Two integration tests, each its own process, switch the fabric on with `JOULECLAW_FABRIC=1` and point `JOULECLAW_FABRIC_CALIBRATION` at a file they write, pricing `local/cpu-neon`'s matmul at 2.5e8 µJ/GFLOP: declared `Measured`, the window carries `Measured` and the receipt says ModelBased, 1024 µJ; declared `Estimated`, the window carries `Estimated` and the receipt says Estimator, 1024 µJ. The machine's own ~/.jouleclaw/fabric-calibration.json is neither read nor written by these tests. Ran: `cargo test` in l3-jouleclaw (the model-backed tests stay #[ignore], no model was loaded), `cargo test -p jouleclaw-loader-gguf --features fabric-meter --lib` (304 passed), loader-gguf examples checked; clippy reports nothing new. Not done: a projection under 1 µJ still truncates to a 0 µJ receipt figure, as before; real hybrid-model calls are far above that. Co-Authored-By: Claude Opus 5.5 <[email protected]>
29 lines
1.7 KiB
TOML
29 lines
1.7 KiB
TOML
# Standalone example (own workspace) — does NOT join joule-code-rs's workspace, so
|
|
# the standard's lib stays free of a JouleClaw dependency. This is a *consumer
|
|
# binding*: how to wire JouleClaw's L3 (Model) tier into the Joule Code cascade.
|
|
[workspace]
|
|
|
|
[package]
|
|
name = "l3-jouleclaw-binding"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
rust-version = "1.97"
|
|
license = "Apache-2.0"
|
|
description = "Example binding: JouleClaw's L3 model tier (jouleclaw-llm LlmBackend) as a Joule Code cascade FnStage. Verified model-free via EchoBackend; a real backend (vLLM, or jouleclaw-runtime GGUF) drops into the same slot."
|
|
publish = false
|
|
|
|
[dependencies]
|
|
joule-code-schema = { path = "../../joule-code-rs/crates/joule-code-schema" }
|
|
joule-code-cargo = { path = "../../joule-code-rs/crates/joule-code-cargo" }
|
|
joule-code-receipt = { path = "../../joule-code-rs/crates/joule-code-receipt" }
|
|
joule-code-cascade = { path = "../../joule-code-rs/crates/joule-code-cascade" }
|
|
jouleclaw-llm = { path = "../../../jouleclaw/jouleclaw-rs/crates/jouleclaw-llm" }
|
|
jouleclaw-energy = { path = "../../../jouleclaw/jouleclaw-rs/crates/jouleclaw-energy", features = ["ioreport"] }
|
|
# JouleClaw's own from-scratch GGUF tensor runtime (no llama.cpp, no FFI) —
|
|
# the in-process L3 backend.
|
|
jouleclaw-runtime = { path = "../../../jouleclaw/jouleclaw-rs/crates/jouleclaw-runtime" }
|
|
jouleclaw-loader-gguf = { path = "../../../jouleclaw/jouleclaw-rs/crates/jouleclaw-loader-gguf", features = ["rayon", "fabric"] }
|
|
# The grades (`Measured` / `Benchmarked` / `Estimated`) the fabric ledger prices
|
|
# a call from, which the L3 stage grades the call's projected energy by.
|
|
jouleclaw-fabric = { path = "../../../jouleclaw/jouleclaw-rs/crates/jouleclaw-fabric" }
|
|
serde_json = "1"
|