jouleclaw-routing: ROUTING_JOULES is an Estimator-class floor, and says so #390
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/routing-joules-is-an-estimator"
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?
RoutingPlan::router_joulesis "counted against the query budget" — it is a debit — and it is a baref64carrying no provenance, so a figure a router measured and a hard-coded constant are indistinguishable in the type.ROUTING_JOULES = 8e-9was documented as "the (negligible) joule cost … client CPU only and … dwarfed by every execution tier it orders". That is an assumption nothing enforces, and it fails two concrete ways. Because the figure is a debit, both fail in the directionjouleclaw/SPEC.md§1.3 calls unsafe — under-charging a ceiling admits further work on the strength of the shortfall:LearnedRouter'sroutetokenizes the query and scans its episode memory for neighbours — work proportional to the number of episodes — and charges the flat constant. Nothing bounds that memory, so the gap grows silently with it. This is an actual path in the crate, not a hypothetical.The constant and the field now state that: an
Estimator-class declared floor, with a router whose cost scales with its own state, or that runs a model, required to report what it actually spent.What this does not do, and why
It does not make the charge scale. That needs a calibrated per-episode cost, and inventing a coefficient is exactly what this family forbids —
jouleclaw/SPEC.mdalready says a constant nobody calibrated there isEstimator, however it is multiplied. Multiplying this constant by the episode count would assert that one episode costs what a whole plan costs, which nothing measured.So the enforceable follow-up is named rather than implied: give
RoutingPlana provenance field, so a measured figure and this floor stop being the same type. That is an API change with consumers, not a doc fix.Verification
cargo check --workspace --all-targets --locked(jouleclaw-rs,RUSTFLAGS=-C target-feature=+fp16) — 0 errorscargo test --workspace --locked— 486 test binaries green, 0 failurescargo doc --no-deps -p jouleclaw-routing— 0 warningsI also caught one of my own intra-doc links before it shipped:
routeis a trait method, so[LearnedRouter::route]does not resolve on the type. Given that two of my recent PRs were about broken doc links, shipping one here would have been poor form.Not touched
jouleclaw-cascadecarries 2 pre-existing doc warnings (jouleclaw_calibration::CalibratedGate,top), and these two crates have 10 pre-existing clippy findings — all in files this change does not touch (active.rs,body.rs,coord_router_impl.rs,cost.rs,tier.rs). Neither crate is in CI's clippy list, so that is unlinted code I can only half-see from one host. Reported rather than rewritten, on the same reasoning as #353 and #385.🤖 Generated with Claude Code