Repository navigation
feat: switch emit to sparse format and make linear amortization annual - #31
Merged
Merged
Conversation
Have downstreams perform the discounting
danohu
reviewed
Nov 10, 2026
danohu
approved these changes
Nov 10, 2026
danohu
left a comment
Contributor
There was a problem hiding this comment.
Very cool!
One non-blocking comment. On the bit-identical check -- just confirming that this wouldn't have just been returning the stale cache data, since we didn't change the version/key. But that would show up soon anyway.
danohu
approved these changes
Nov 11, 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.
Background
This sets the stage for the assessment year to be parametrized. First, emit is refactored from a dense to a sparse representation of emissions over time (i.e., the undiscounted emission and its year are output and amortization is applied downstream. This changes results only within float epsilon. Second, the linear amortization weights vary annually instead of within each 5-year plateau. This changes results but was not directly measured.
Notes
emitand downstream caches technically should change, but since we are about to add assessment year we decided to keep them as-is and avoid two changesemitnow outputs 9 bands instead of 16. Runtime and data sizes don't reduce very much because the dense and sparse representations compress down the same 🤷Manual testing
HNDand showed that changes were within floating epsilon`tools.measure-drift` output