Skip to content

chore(optimizer): bundle Energyplan 0.5.1 - #1535

Merged
frahlg merged 1 commit into
masterfrom
62-bundle-energyplan-0.5.1
Oct 8, 2026
Merged

frahlg merged 1 commit into
masterfrom
62-bundle-energyplan-0.5.1

Conversation

@frahlg

@frahlg frahlg commented Oct 7, 2026

Copy link
Copy Markdown
Member

Problem and result

FTW ships Energyplan 0.5.0. On the home box, plans with the car could cost up to about 10 kr more than the best plan within Core's 1.5 s car budget on a Raspberry Pi 4. The cause sat in the planner: once it had met the car's charging goals, a round-off in the goal search made it drop the step that plans the battery around that charging, so the plan kept a battery schedule chosen without regard to cost. A second check threw such plans away for a pricing difference that does not change the plan.

Energyplan 0.5.1 (private source, srcfl/energyplan #63–#72):

  • After its goal stages, the planner plans the battery around the car's charging again.
  • A car that needs less than two minimum charging runs gets one run at the cheapest time. A need of at most half a run (about 155 Wh at 4.14 kW) counts as met, matching Core's departure-miss rule from docs: let gap_satisfied cover the fleet search too #1532/fix(planner): count a departure miss only above half a minimum run #1533.
  • Fixes from Codex's review of 0.5.0: no search bound on a plan the search did not produce, time left for the fallback when the idle-car method stops, cost polish of the car schedule when no joint search follows, complete trace summaries, and EV powers within 1e-5 W of a step sent as that step.

Protocol v1, signs and Core validation are unchanged. Core still validates every plan.

Evidence

Measured on a laptop on 228 recorded battery + car requests from the home box (26 Sep to 3 Oct), each against a reference optimum. On fleet requests the Pi 4 is 17–20 times slower than the laptop, so Core's 1.5 s is about 85 ms there.

  • With a fixed search size (4 nodes, so load does not matter): summed gap fell from 112,441 to 21,634 öre; 51 plans cheaper, none dearer, no worse goals.
  • At 85 ms: summed gap fell from 148,837 to about 65,000–79,000 öre (runs vary with load).
  • The request behind the 10 kr plans (a 253 Wh need due in two hours): 0.5.0 returned a plan costing 924 öre at 85 ms; 0.5.1 returns the optimum, −116.89 öre, at every budget tried.
  • These are measurements on one home's requests, not a promise of savings for every site. Long horizons at the 0.5 s budget still leave a gap; that work is tracked privately.

Verification

  • make native-solver-test and make verify pass on this commit.
  • The bundle is built from private commit 36bd719. Its tree is identical to 1c69e29, which passed full Energyplan local CI (22/22).
  • Not yet run: beta on real sites. Merge to master only; do not cut a beta before stable v0.140.1, since a higher beta tag would block that release.

Checklist

  • The change follows VISION.md and one selected scope.
  • I checked overlapping PRs and coordinated shared files/contracts. No open PR touches optimizer/native or the two Energyplan tests.
  • Relevant checks cover the changed behaviour and failure paths.
  • A human reviewed changed UI in a browser, or no UI changed. No UI changed.
  • A Changeset is included (patch), or the change is exempt.
  • Every commit has a DCO sign-off.

🤖 Generated with Claude Code

Bundle the worker built from srcfl/energyplan 36bd719 (0.5.1) for
linux-arm64, linux-amd64 and darwin-arm64. Licenses, notices and
forecast schemas are unchanged. Protocol v1 is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T17:27:36.804107Z e11925e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit 5226090 into master Oct 8, 2026
15 checks passed
@frahlg
frahlg deleted the 62-bundle-energyplan-0.5.1 branch October 8, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant