Stop conflating EnergyQuanta and FunctionBudget#4930
Merged
Conversation
Contributor
cloutiertyler
left a comment
There was a problem hiding this comment.
Left some comments.
1 task
1114444 to
8a610dd
Compare
# Description of Changes Fixes a todo. # Expected complexity level and risk 1 # Testing - [x] Checked that conversion ratio is sane.
8a610dd to
1fa49c1
Compare
1c58250 to
5559e2c
Compare
5559e2c to
82f4595
Compare
Contributor
|
bfops
approved these changes
Jun 2, 2026
Collaborator
bfops
left a comment
There was a problem hiding this comment.
I defer my codeowner review to @joshua-spacetime who says this is good.
joshua-spacetime
approved these changes
Jun 2, 2026
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.
Description of Changes
A sort of followup to/unrevert of #4884, an alternative to #4927.
In #3832, we made FunctionBudget a different unit than EnergyQuanta, but there were still many places where we treated them the same and directly converted between them. I got confused by that in #4884, and now this PR properly separates them and corrects the v8 energy calculation.
Also, since we now benchmark the same module in rust and typescript in the form of the keynote benchmark, this patch adds a new assertion to that test that the fuel usage of both modules is within 2X of each other.
Expected complexity level and risk
3 - touches energy calculation without reverting the problematic #4884, but I'm confident it's correct this time.
Testing