feat(explain): decompose the Fargate residual into a Charges dimension - #49
Merged
Merged
Conversation
charges is an ordinary member of Terms whose Of children are charge-volume, charge-kind-mix, charge-class-mix, charge-rate and charge-unattributed. Residual is still computed last as the remainder, so sum(Terms)+Residual == Delta is untouched and check, Verify, Citations, Sum and Prose cover the new dimension with no new code — an invariant enforced in two places is enforced in neither. Attribution.check asserts charges.Micro == ChargeDeltaMicro, the exact int64 difference of the two supplied dimensions. Without it sum(Of) == parent is vacuous and charge-unattributed absorbs whatever the parent claims. FuzzChargeInvariants (6.0M execs clean) additionally pins that the chain's remainder never exceeds what 2 microUSD/h quantization can explain. Charges stated at one window edge only are not attributed at all: reading the silent edge as zero would report a cluster's whole Fargate bill as appearing from nothing. TestResidualStillGrowsWhenChargesCannotExplainIt pins the complementary direction, and TestChargesShrinkTheResidualTheyUsedToBe asserts the microUSD leaving the residual equals the charges term with no node term moving to make room. Charge.Evidence is exported so a CostBasis still round-trips through JSON; enforcement lives in NewCharge and at the input boundary, where an uncitable charge fails the whole answer rather than being dropped. Co-authored-by: kording <74226694+kording@users.noreply.github.com>
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.
charges is an ordinary member of Terms whose Of children are charge-volume,
charge-kind-mix, charge-class-mix, charge-rate and charge-unattributed. Residual
is still computed last as the remainder, so sum(Terms)+Residual == Delta is
untouched and check, Verify, Citations, Sum and Prose cover the new dimension
with no new code — an invariant enforced in two places is enforced in neither.
Attribution.check asserts charges.Micro == ChargeDeltaMicro, the exact int64
difference of the two supplied dimensions. Without it sum(Of) == parent is
vacuous and charge-unattributed absorbs whatever the parent claims.
FuzzChargeInvariants (6.0M execs clean) additionally pins that the chain's
remainder never exceeds what 2 microUSD/h quantization can explain.
Charges stated at one window edge only are not attributed at all: reading the
silent edge as zero would report a cluster's whole Fargate bill as appearing
from nothing. TestResidualStillGrowsWhenChargesCannotExplainIt pins the
complementary direction, and TestChargesShrinkTheResidualTheyUsedToBe asserts
the microUSD leaving the residual equals the charges term with no node term
moving to make room.
Charge.Evidence is exported so a CostBasis still round-trips through JSON;
enforcement lives in NewCharge and at the input boundary, where an uncitable
charge fails the whole answer rather than being dropped.