perf(planning): retain the best valid plan more cheaply

Retaining a better valid plan reconciled its optimization provenance,
which evaluated every active objective once per credited placement with
that placement released. Only the credited objectives are compared, so
the released plan now evaluates just those and skips observing the
others. Retention also stops computing quality metrics that nothing
read. The retained plan and what Cancel returns are unchanged.

Part of #302.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nessarandClaude Opus 5.5 committed 2026-10-18 19:50:58 +02:00
1 parent 0b0bb8f9a8
commit 2fcba758c8
2 files changed
+48 -23

No files matched your search

+24
View File
@@ -35,3 +35,27 @@ the placements in the same order with the same yields.
| loaded year | 58.26 | 57.75 |
| two years | 2.27 | 1.82 |
| three years | 7.45 | 5.52 |
### Retain the best valid plan more cheaply
Retaining a better valid plan for cancellation reconciled its optimization
provenance. For every placement credited by an optimization rule, that
evaluated all active objectives with the placement released. Only the credited
objectives are compared, so the released plan now evaluates just those, and
the calendar observations of the other objectives are no longer computed.
Retention also no longer computes quality metrics that nothing read. An
instrumented three-year run spent 1.16 of its 1.22 retention seconds in that
reconciliation; afterwards retention took 0.26 seconds.
| Scenario | Before (s) | After (s) |
| --------------------------- | ---------: | --------: |
| representative year | 0.45 | 0.37 |
| typed obligations | 4.76 | 5.03 |
| chained earned entitlements | 0.02 | 0.02 |
| deliberate conflict | 0.01 | 0.01 |
| loaded year | 55.59 | 53.58 |
| two years | 1.68 | 1.22 |
| three years | 5.29 | 3.85 |
The typed-obligations difference is run-to-run noise; its retention cost was
22 milliseconds.