open-standards/eoc/eoc-rs/crates/eoc-route-learned/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 05ec7a0aa7 eoc-route-learned: recommend the stage cheapest in expectation, not the likeliest
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]>
2026-10-22 07:16:10 -04:00
..
learned_cascade.rs Ingest batch 2: 9 new crates across openpay / smart-byte / eoc 2026-05-23 18:12:24 -04:00
linucb_bandit.rs eoc-route-learned: recommend the stage cheapest in expectation, not the likeliest 2026-10-22 07:16:10 -04:00
logreg_synthetic.rs Ingest batch 2: 9 new crates across openpay / smart-byte / eoc 2026-05-23 18:12:24 -04:00
mf_synthetic.rs eoc-route-learned: recommend the stage cheapest in expectation, not the likeliest 2026-10-22 07:16:10 -04:00
state_roundtrip.rs eoc-route-learned: recommend the stage cheapest in expectation, not the likeliest 2026-10-22 07:16:10 -04:00
threshold_policy.rs Ingest batch 2: 9 new crates across openpay / smart-byte / eoc 2026-05-23 18:12:24 -04:00