Skip to content

chore(optimizer): bundle Energyplan 0.5.0 - #1512

Merged
frahlg merged 1 commit into
masterfrom
chore/energyplan-0.5.0
Oct 4, 2026
Merged

frahlg merged 1 commit into
masterfrom
chore/energyplan-0.5.0

Conversation

@frahlg

@frahlg frahlg commented Oct 3, 2026

Copy link
Copy Markdown
Member

Problem and result

FTW ships Energyplan 0.4.10. On a Raspberry Pi 4, plans with a car get Core's 0.5 s budget, which is about 30 ms of time on a fast laptop: the planner returned its first plan before any search. Stored diagnostics from the home box (1 054 replans, 26 Sep to 3 Oct, each checked against a proven HiGHS optimum) showed plans with the car 2.5% above the best plan at 0.5 s, 5.5% on long horizons, and 45 to 50% above it when the car could not charge at all.

Energyplan 0.5.0 (private source, srcfl/energyplan #47–#61):

  • On short budgets, time the solver's LP phases cannot use goes to improving the first plan, and goal stages prove their level at the physical ceiling instead of searching for it.
  • A car that cannot charge is planned with the exact battery method; a need of 1 Wh or less counts as met, so the charger no longer restarts for a fraction of a watt-hour.
  • The planner keeps a valid plan when its solver fails, reports gap_satisfied when it meets Core's mip_rel_gap, fixes the sign of the running hour's elapsed import in demand charges, and closes two ways it could report an unproven optimum.

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

Evidence

  • On the box's 116 real 0.5 s requests with the car, replayed on a laptop at Pi-like budgets, the summed gap to the proven optimum fell from 70 490 to 40 851 öre at 35 ms and from 11 330 to 4 343 öre at 62.5 ms (planner PR Add EV Charger settings tab #57).
  • On 19 real requests where the car could not charge, the gap fell from 26 164 öre to 0 (Docs: document energy.today in api.md #51).
  • A pre-release build of this change ran on the home box from 18:43 on 3 Oct. Its first plan with the car plugged in matched the proven optimum (5 724.96 öre) within 0.5 s; 0.4.10 at the same effective budget gave 6 446.2 öre.
  • These are measurements on one home and synthetic Core-shaped requests, not a promise of savings for every site.

Verification

  • make native-solver-test and make verify pass on this commit, including Core's real validator against the bundled worker.
  • The bundle is built from private commit 4ad5804 with full Energyplan local CI (22/22 checks).
  • Not yet run: a week of beta on real sites.

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/bundle.
  • 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

Energyplan 0.5.0 gives short-budget fleet requests' unusable LP time to
the seed's local moves and proves goal levels at the physical ceiling,
plans cars that cannot charge with the exact battery DP, counts a need of
1 Wh or less as met, keeps a valid plan through solver panics and
repricing, reports gap_satisfied on gap stops, fixes the running demand
hour's elapsed import and closes two false-optimal paths. Protocol v1 is
unchanged. The bundle is built from private commit 4ad5804.

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 3, 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-03T18:00:30.244657Z 003c324 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 e64d587 into master Oct 4, 2026
15 checks passed
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