Repository navigation
fix(prediction): price a gone dispatch at the tariff's own maximum, never below the slot's rate - #5411
Merged
chalfontchubby merged 2 commits intoOct 7, 2026
Conversation
…ever below the slot's rate (#5392) In the PV10 worst case an Intelligent Octopus dispatch slot that may go away is priced at rate_max. rate_max includes any saving session or Axle reward, so in #5392 a +100p Axle event put every such minute at 132.25p - an event elsewhere in the day inflating a worst case it has nothing to do with. set_rate_thresholds() keeps the event-excluded import maximum from #5163 as rate_import_tariff_max, and Prediction uses it as its rate_max. A gone dispatch now pays the greater of that and the slot's own rate, so an event on the slot itself still counts and the worst case can never be cheaper than the nominal case. rate_scan() resets the tariff maximum to the raw one, so a rescan without fresh thresholds falls back to the old, higher price. A debug replay of a file without the field falls back to rate_max the same way. The same change is made in the C++ kernel, whose parity revision goes to 17; the checked-in kernel binaries are rebuilt by CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chalfontchubby
merged commit Oct 7, 2026
d4d2d06
into
fix/rate-threshold-saving-boost-5050-v2
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was written by Claude.
Stacked on #5163. It uses the tariff's own import maximum that #5163 works out, so the diff here is only the last commit.
Related to #5392.
Problem
In the PV10 worst case,
prediction.pyassumes an Intelligent Octopus dispatch slot more than 30 minutes ahead may go away, and prices it atrate_max.rate_maxincludes any saving session or Axle reward anywhere in the forecast, so an event elsewhere in the day inflates every dispatch slot's worst case. In #5392 a +100p Axle event priced each such minute at 132.25p.Fix
A gone dispatch now pays the greater of:
rate_import_tariff_max, kept byset_rate_thresholds());rate_scan()resets the tariff maximum to the raw one, so a rescan without fresh thresholds falls back to the old, higher price. A debug replay of a file without the field falls back torate_maxin the same way.The C++ kernel gets the same change and its parity revision goes to 17. CI rebuilds the checked-in binaries.
This doesn't settle #5392 by itself. That report's root cause is the fixed off-peak minutes being marked as dispatches that may vanish (#5396), which is being reworked separately. This PR only removes the event reward from the worst-case price.
Testing
test_dispatch_gone_priced_at_tariff_max: the tariff max with an event in the horizon, Prediction uses it, and a rescan resets it.test_pv10_dispatch_gone_never_cheaper_than_the_slot: with every slot at 200p and the tariff max at 25p, PV10 costs the same as nominal../run_all --quick,--test debug_casesand./run_pre_commitgreen.🤖 Generated with Claude Code