Two mutants of the previous commit survived: a correct result on the
predicted stage itself no longer reinforcing it, and MF reporting a fixed
confidence. Each now has a test.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The crate says a learned router "predicts the cheapest stage that is likely
to satisfy the query". Three of its four routers recommended the stage
likeliest to succeed: MF and both bandits took an argmax over success, and
the bandits ignored the joule cost `observe` passed them. Neural succeeds on
everything and costs the most, so they learned to send every query there.
The synthetic LinUCB test pinned exactly that as the goal.
- router: `expected_joules` prices a skip the way LearnedCascade dispatches
it (Kv or Graph falling through to Neural, Neural alone, Cache as the full
walk), and `cheapest_in_expectation` picks the least. A broken probability
prices a stage dearer, never cheaper. `observe` is the outcome of one
stage that ran, with that stage's own joules.
- MF picks by that rule over its per-stage chances and learned costs.
- LinUCB and Thompson learn each stage's cost and pick by the rule over
optimistic and sampled chances. Confidence is the mean belief, not the
bound or sample used to explore. Older saved states import with the
default costs.
- train_logreg labels each query with its cheapest successful stage; the
classifier's online update no longer reinforces a correct stage costlier
than the one it predicts.
- evaluate replays each recommendation over per-stage outcomes. It charged
every row's own cost whatever the router chose and priced the walk at 4x
that, so every router showed a lift of 3x its spend. A query it cannot
price is counted unscored, not charged zero, and joules_per_correct is
None when nothing was correct.
Co-Authored-By: Claude Opus 5.5 <[email protected]>