After the exact scoring work in #279 (PR #287), the loaded-year benchmark scenario still takes about 44 seconds in Node on the development laptop, against a target of under 10 seconds. Typed obligations (about 5.0 s) and three years (about 5.9 s) are over their 3-second target. The two-year, representative-year, chained and conflict scenarios meet it.
#279 allowed only exact optimizations, which leave planning outcomes unchanged. The remaining cost is spread over about 1.2 million candidate evaluations in the loaded year. Further exact work could save perhaps 8 to 10 seconds:
cheaper yields than the 1 ms timer between asynchronous slices (about 4.6 s);
validating optimization configurations once instead of on every evaluation (about 1 s);
copying less state when assigning dates.
That is still not enough to reach 10 seconds. The profile breakdown is in docs/benchmark/issue-279.md.
Decision needed
Whether to accept search changes, such as fewer candidates, early stopping or a different neighbourhood, that may change planning outcomes. Accepting them means deliberately rebuilding the frozen engine fixture (see docs/benchmark/README.md, "Frozen-engine differential check").
Whether ADR 0003's five-second target, and #279's 10-second loaded-year target, still hold under composable optimization rules.
Tighten the relative-gate multipliers in src/app/benchmark/leave-planner-benchmark.ts to the target (loaded year about 4x calibration).
Lower the hang guard, now 600 s in CI and 570 s in the test, to about three times the expected run on the slowest runner. srvhome is about 1.9x slower than nessar-desktop.
Confirm on at least two runners.
Part of #78
Follows #279 and #286
## Problem
After the exact scoring work in #279 (PR #287), the loaded-year benchmark scenario still takes about 44 seconds in Node on the development laptop, against a target of under 10 seconds. Typed obligations (about 5.0 s) and three years (about 5.9 s) are over their 3-second target. The two-year, representative-year, chained and conflict scenarios meet it.
#279 allowed only exact optimizations, which leave planning outcomes unchanged. The remaining cost is spread over about 1.2 million candidate evaluations in the loaded year. Further exact work could save perhaps 8 to 10 seconds:
- cheaper yields than the 1 ms timer between asynchronous slices (about 4.6 s);
- validating optimization configurations once instead of on every evaluation (about 1 s);
- copying less state when assigning dates.
That is still not enough to reach 10 seconds. The profile breakdown is in `docs/benchmark/issue-279.md`.
## Decision needed
- Whether to accept search changes, such as fewer candidates, early stopping or a different neighbourhood, that may change planning outcomes. Accepting them means deliberately rebuilding the frozen engine fixture (see `docs/benchmark/README.md`, "Frozen-engine differential check").
- Whether ADR 0003's five-second target, and #279's 10-second loaded-year target, still hold under composable optimization rules.
## Still pending from #286 once a target is met
- Tighten the relative-gate multipliers in `src/app/benchmark/leave-planner-benchmark.ts` to the target (loaded year about 4x calibration).
- Lower the hang guard, now 600 s in CI and 570 s in the test, to about three times the expected run on the slowest runner. srvhome is about 1.9x slower than nessar-desktop.
- Confirm on at least two runners.
Decision taken: option B, plus exact optimizations. The spec is #302.
Option B. Plan from the best-ranked obligation solution, without previews. Previews took 88% of the loaded year's candidate evaluations and 96% of typed obligations', and in both every preview reached the same objective values. Over the 5,000 frozen-check requests: 4,970 identical, 23 worse (14 only on tie-breaks), 1 better.
Exact steps first, gated by the current frozen engine: reuse the donor ranking across holiday weeks (prototyped, three years 7.5 → 5.4 s, identical on all 5,000 requests), cheaper incumbent retention, a yield without a timer, validating configurations once, and less copying per date.
Targets under the current Bun protocol: loaded year under 10 s, three years under 5 s, every other scenario under 3 s.
Rejected: parallel previews (E), tie-break polishing only in the final stage (C). Not needed: adding several days per loss-prevention iteration (D).
Process: the frozen engine is rebuilt in its own reviewed commit, and an ADR records the decision and revisits ADR 0003's five-second target.
Decision taken: option B, plus exact optimizations. The spec is #302.
- **Option B.** Plan from the best-ranked obligation solution, without previews. Previews took 88% of the loaded year's candidate evaluations and 96% of typed obligations', and in both every preview reached the same objective values. Over the 5,000 frozen-check requests: 4,970 identical, 23 worse (14 only on tie-breaks), 1 better.
- **Exact steps first,** gated by the current frozen engine: reuse the donor ranking across holiday weeks (prototyped, three years 7.5 → 5.4 s, identical on all 5,000 requests), cheaper incumbent retention, a yield without a timer, validating configurations once, and less copying per date.
- **Targets under the current Bun protocol:** loaded year under 10 s, three years under 5 s, every other scenario under 3 s.
- **Rejected:** parallel previews (E), tie-break polishing only in the final stage (C). Not needed: adding several days per loss-prevention iteration (D).
- **Process:** the frozen engine is rebuilt in its own reviewed commit, and an ADR records the decision and revisits ADR 0003's five-second target.
Decision: option B, recorded in docs/adr/0010-rank-obligation-solutions-before-preferences.md. Obligation solutions are ranked before preferences, the preference stages run once, and the frozen engine was rebuilt in its own commit.
Comparison record: in docs/benchmark/issue-302.md. Over the 5,000 frozen-check requests the result matches the figures in this ticket. A new 50-request loaded-year-sized sample found 4 plans worse on a real objective.
ADR 0003: its five-second target is revisited by ADR 0010. The targets are now 10 s for the loaded year, 5 s for multi-year horizons and 3 s otherwise.
Implemented by #302 (PR #303, merged as 7fc3457).
- **Decision:** option B, recorded in docs/adr/0010-rank-obligation-solutions-before-preferences.md. Obligation solutions are ranked before preferences, the preference stages run once, and the frozen engine was rebuilt in its own commit.
- **Comparison record:** in docs/benchmark/issue-302.md. Over the 5,000 frozen-check requests the result matches the figures in this ticket. A new 50-request loaded-year-sized sample found 4 plans worse on a real objective.
- **ADR 0003:** its five-second target is revisited by ADR 0010. The targets are now 10 s for the loaded year, 5 s for multi-year horizons and 3 s otherwise.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #78
Follows #279 and #286
Problem
After the exact scoring work in #279 (PR #287), the loaded-year benchmark scenario still takes about 44 seconds in Node on the development laptop, against a target of under 10 seconds. Typed obligations (about 5.0 s) and three years (about 5.9 s) are over their 3-second target. The two-year, representative-year, chained and conflict scenarios meet it.
#279 allowed only exact optimizations, which leave planning outcomes unchanged. The remaining cost is spread over about 1.2 million candidate evaluations in the loaded year. Further exact work could save perhaps 8 to 10 seconds:
That is still not enough to reach 10 seconds. The profile breakdown is in
docs/benchmark/issue-279.md.Decision needed
docs/benchmark/README.md, "Frozen-engine differential check").Still pending from #286 once a target is met
src/app/benchmark/leave-planner-benchmark.tsto the target (loaded year about 4x calibration).Decision taken: option B, plus exact optimizations. The spec is #302.
Implemented by #302 (PR #303, merged as
7fc3457).