dgb: pin V36 decayed-PPLNS weights with bit-exact KAT - #191
Merged
Conversation
Add DecayedPPLNSWeightsKAT to dgb_share_test, closing the gap left by the Phase B share-weight/PPLNS conformance audit: share_test.cpp guarded the sharechain-identity and consensus params but nothing pinned the decay constants or the weight recurrence in DensePPLNSWindow::compute_v36_weights(). The KAT pins DECAY_PRECISION=40 / LN2_MICRO=693147 / half_life=max(len/4,1), the full depth-0..7 decay table, the per-step decay factor, and the per-script address/donation/total weights for a hand-built window. Ground truth is re-derived independently with bigint integer math mirroring the exact fixed-point ops (iterative mul128_shift), so a drift in any constant or in the weight math fails loudly. Conforms to the V36 MASTER reference decayed-weight path, not the legacy flat-weight oracle. Appended to the existing dgb_share_test target (already in both build.yml --target allowlists), so no new CI registration is required.
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.
Closes the guard-test gap from the Phase B share-weight/PPLNS conformance audit.
What
Adds
DGB_share_test.DecayedPPLNSWeightsKATto the existingdgb_share_testtarget. share_test.cpp already locked sharechain-identity + consensus params (#131/#137/#141/#161) but nothing pinned the decay constants or the weight recurrence inDensePPLNSWindow::compute_v36_weights().What it pins
DECAY_PRECISION=40,LN2_MICRO=693147,half_life=max(chain_len/4,1)s_decay_perfactor + full depth-0..7s_decay_tableGround truth is re-derived independently with bigint integer math mirroring the exact fixed-point ops (iterative mul128_shift) — not the codes own output — so any drift in a constant or in the weight math fails loudly.
Conformance (3-bucket)
Decayed-PPLNS = bucket-2 v36-native shared structure, conformed to the V36 MASTER reference decayed-weight path (NOT the legacy flat-weight oracle, which is pre-v36 compat). DGB == ltc == merged-v36 ref — clean v37 migration.
Isolation / CI
Single-coin (src/impl/dgb/test only). Appended to the existing
dgb_share_testtarget which is already in BOTH build.yml --target allowlists, so no new CI registration (#143 trap avoided).Local: dgb_share_test 7/7 PASS, build EXIT=0.