ltc: port AutoRatchet tail-guard boundary KATs from dgb (fill LTC coverage gap) - #701
Merged
Merged
Conversation
…erage gap) Adds src/impl/ltc/test/auto_ratchet_tail_guard_test.cpp: 9 focused arithmetic boundary cases for the work-weighted 60% tail guard, ported from the dgb suite. LTC has no lifted SSOT header, so the KATs pin the LIVE inline exact-rational rule (auto_ratchet.hpp:171) non-circularly against hand-derived oracle values and an independent replica of the p2pool canonical floor rule (data.py:1399). FloorBoundary/ExactFloor/LargeWeights cases localise the one-quantum floor divergence and exercise the uint288 multiply/divide path against overflow. Joins the share_test executable.
Owner
Author
|
integrator review (verdict, not a gh-approve — single-account fleet blocks self-approve): scope = exactly src/impl/ltc/test/{CMakeLists.txt,auto_ratchet_tail_guard_test.cpp}, pure test-additive single-coin LTC, no source/shared-base touch. 9/9 ctest green, GPG good-sig, non-circular, no overlap with #676. LGTM — cleared for merge on green CI; merge held for operator tap. |
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.
Fills the LTC unit-coverage gap for the AutoRatchet work-weighted 60% tail guard.
LTC already carries the staged-migration integration sim (
auto_ratchet_sim_test.cpp) and the desired-version tally KATs (desired_version_tally_test.cpp), but not the focused arithmetic boundary cases the dgb tree has insrc/impl/dgb/test/auto_ratchet_tail_guard_test.cpp. This ports those 9 cases, LTC-adapted.What it pins
LTC has no lifted SSOT header — the tail guard is the inline expression in
AutoRatchet::get_share_version(auto_ratchet.hpp:171):i.e. the EXACT-RATIONAL test
target < total*60/100. The KATs pin that LIVE inline form non-circularly, against (a) hand-derived oracle values and (b) an independent local replica of the p2pool canonical FLOOR rule (data.py:1399):SWITCHED iff target >= floor(total*60/100).The cases (suite
LtcAutoRatchetTailGuard, 9 tests)ReduceSplitsAtTargetVersion,EmptyMapIsZeroZero— reduce mirrors the inline accumulation loop (auto_ratchet.hpp:164-169).SwitchedHonoursSixtyPercentFloor,AllOldNeverSwitches,ZeroTotalSwitches— the 60%-by-work gate and its degenerate windows.FloorBoundaryDivergesFromInlineByOneQuantum/ExactFloorAgreesWithInline/LargeWeightsAgreeWithInline— the point of the port: they localise the one-quantum floor divergence (LTC inline is one work-quantum STRICTER at a non-exact floor) and exercise the uint288 multiply/divide path against quantization / overflow bugs.Scope
Additive, FENCED, ltc-tree-local. Consensus path is NOT modified — pure arithmetic pin of the live inline rule. Joins the
share_testexecutable (already on the build.yml --target allowlist).Test
(Linux x86_64, network-free KATs;
ctest -R LtcAutoRatchetTailGuard.)