Skip to content

Donation planner weekly debt property rejects floating-point roundoff #3786

Closed

Description

@pithead-developer

What's the problem

The weekly donation-planner property rejects floating-point roundoff and fails required dashboard CI. At percent=0.28, xvb_ms=0, sequential debt accrual returns 2.0372681319713593e-10 ms while the independently calculated target remainder is 2.3283064365386963e-10 ms. Their difference exceeds the assertion's default absolute tolerance of 1e-12 ms.

What it impacts

The required Dashboard image (Docker test stage) check is red for PR #3720 / issue #3399. The failure is at dashboard/tests/service/donation/test_planner_properties.py:58; the planner, simulator and donation tests are unchanged from that PR's base. A runtime donation defect is not established by this rounding discrepancy.

How I found it

Failed job 124290709446 at a706cb6dd743a7b0f5881afefe54cf27aa4ec845 reports 1 failed, 3633 passed, 10 skipped. Hypothesis supplies the deterministic input above. planner.py:46 accrues credit each cycle; project_slice_model.py:21 carries it across 1008 cycles; the property computes the target with a different floating-point evaluation order.

The following command exits 1 at the same assertion without Docker or a random search:

uv run --locked --project dashboard --extra test python - <<'PYTHON'
import runpy
suite = runpy.run_path('dashboard/tests/service/donation/test_planner_properties.py')
suite['test_weekly_share_with_room_stays_within_one_slice'].hypothesis.inner_test(percent=0.28, xvb_ms=0)
PYTHON

The planner originated in merged PR #3732 / closed issue #3696. Open-issue searches for the test name, planner debt, donation and floating-point failures found no existing owner for this defect.

How important is it

Required-check blocker: valid changes inheriting the planner cannot merge when this generated input is exercised. There is no evidence here of lost funds or materially incorrect donation time.

Acceptance criteria

  • Retain the exact percent=0.28, xvb_ms=0, 1008-cycle case as a deterministic regression.
  • Make the weekly debt comparison account for bounded floating-point accumulation while still rejecting meaningful debt/accounting errors; preserve the cycle, slice, remainder and debt-cap assertions.
  • The focused donation test modules and required Dashboard image Docker test stage pass on the fixing head, with the reproducing case RED before and GREEN after the fix.

Possible solutions

Use a numerically justified comparison for the independently calculated debt, with a regression that also detects an actual accounting mismatch. If numeric representation changes instead, preserve the planner's documented units and invariants. Keep this separate from #3399's manual-QA oracle.

Activity

  1. pithead-developer commented on Oct 30, 2026

    @pithead-developer
    ContributorAuthor

    Additional current-head evidence from PR #3512: Dashboard image job 124297738578, commit f9905ce06da9c329c0fc7cb9015076056a554eb8, fails the same weekly debt assertion at test_planner_properties.py:58 with percent=1.3, xvb_ms=0: accumulated debt 9.167706593871117e-10 versus target remainder 0.0, default absolute tolerance 1e-12. The planner, simulator and donation tests are unchanged from this PR's base. No rerun or tolerance change was used; #3786 remains the canonical owner.

  2. pithead-developer commented on Oct 30, 2026

    @pithead-developer
    ContributorAuthor

    Additional exact-property failure from #3474 / draft PR #3536 at b7b978e80b828ac2a59b120dfef7ce49171bb287: Dashboard image Docker test stage fails test_weekly_share_with_room_stays_within_one_slice at line 58. The generated case is percent=1.3, xvb_ms=0; the assertion reports 9.167706593871117e-10 == 0.0 ± 1.0e-12. This PR has no dashboard source or test changes. Reuse #3786 for this required-check prerequisite; no retry, tolerance change or donation fix was folded into #3474.

  3. pithead-developer commented on Oct 30, 2026

    @pithead-developer
    ContributorAuthor

    The same weekly donation property also fails required Dashboard image job 124299597867 in run 41124558298 for PR #2728 at 9ccf2d1. The raw job reports test_weekly_share_with_room_stays_within_one_slice as its only failure, with 3633 passed and 10 skipped. The candidate changes only the OS teardown harness/tests/docs.

  4. pithead-developer commented on Oct 30, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #3795. PR #3789 is blocked on #3795: the required tooling check fails because an unchanged restore-unit-capture fixture lacks a helper. The donation fix is complete, all 47 focused tests pass, the verifier is clean, and the Dashboard Docker stage passed. The #3795 worker must land its fix before this branch incorporates it and obtains new-head CI and review; the PR blocker comment and evidence are updated.

    The runner resumes this issue when that one closes.

  5. added
    blocked
    on Oct 30, 2026
  6. pithead-developer commented on Oct 30, 2026

    @pithead-developer
    ContributorAuthor

    Matching recurrence on #2522 / PR #3738 at 6e173815b3a87d6c8f7030e0c4c44d051753596f: Dashboard image job 124345122677 fails only test_weekly_share_with_room_stays_within_one_slice at dashboard/tests/service/donation/test_planner_properties.py:58. Its Docker test stage reports 1 failed, 3690 passed, 10 skipped, with 97.38% total coverage.

    The input is 0.28 percent and zero XvB milliseconds over 1008 cycles. The assertion compares accumulated debt 2.0372681319713593e-10 ms with target remainder 2.3283064365386963e-10 ms using the default absolute tolerance of 1e-12 ms. Invoking the property's hypothesis.inner_test(percent=0.28, xvb_ms=0) directly under uv run --locked --extra test python - from dashboard/ reproduces the same line-58 assertion, exit 1, without Docker or a random search.

    git diff --exit-code origin/develop-v2.1.0...HEAD -- dashboard/mining_dashboard/service/donation/planner.py dashboard/mining_dashboard/sim/project_slice_model.py dashboard/tests/service/donation/test_planner_properties.py exits 0. The failing test imports the planner and simulator, independently of host-resource collection, payloads and storage. No runtime donation defect is established by this rounding difference. Reuse this issue and its existing PR #3789; no retry, tolerance change or donation fix is folded into #2522.

  7. removed
    blocked
    on Oct 31, 2026
  8. pithead-developer commented on Oct 31, 2026

    @pithead-developer
    ContributorAuthor

    Matching occurrence on Earnings PR #3784 at 8debeaef2d4bebeff4a5ef963f89bed7bf59abea: Dashboard image job 124381575655 fails only test_weekly_share_with_room_stays_within_one_slice at dashboard/tests/service/donation/test_planner_properties.py:58. The Docker test stage reports 1 failed, 3633 passed, 10 skipped; coverage reaches 97.33% and is not the failure.

    This generated input uses 7.0 percent and zero XvB milliseconds over 1008 cycles. The debt assertion compares 7.334165275096893e-09 ms with 0.0 ± 1.0e-12 ms. This is another input for the same weekly debt roundoff assertion, not a separate defect. gh api --allow-escape-sequences repos/p2pool-starter-stack/pithead/actions/jobs/124381575655/logs exited 0 and supplied the retained raw evidence.

    git diff --exit-code origin/develop-v2.1.0...HEAD -- dashboard/mining_dashboard/service/donation/planner.py dashboard/mining_dashboard/sim/project_slice_model.py dashboard/tests/service/donation/test_planner_properties.py exits 0. The Earnings diff changes none of the planner, simulator or property. Reusing #3786 and its open fix PR #3789; no retry, tolerance change or duplicate fix is included in Earnings.

  9. pithead-developer commented on Oct 31, 2026

    @pithead-developer
    ContributorAuthor

    Matching recurrence on issue #2546 / PR #3785 at 4a9cb1d4e76fa2b660d649f2cbcd8bd0d876cb0f: Dashboard image job 124382113015 fails only dashboard/tests/service/donation/test_planner_properties.py:58: 1 failed, 3644 passed, 10 skipped. Coverage reaches 97.38% and is not the failure.

    The generated input is 7.0 percent and zero XvB milliseconds over 1008 cycles. Accumulated debt 7.334165275096893e-09 ms is compared with 0.0 ± 1e-12 ms. Invoking the property's hypothesis.inner_test(percent=7.0, xvb_ms=0) under uv run --locked --project dashboard --extra test python - deterministically reproduces exit 1 at line 58 without Docker or a random search. The planner, simulator and property are unchanged from the base (git diff --exit-code on those three files exits 0).

    Reusing #3786 and fix PR #3789. The separate frontend lint finding in #3785 is fixed and pushed at a6896822cd9a9558f6873679c0bceb7894d85a38; no donation retry, tolerance adjustment or duplicate implementation is included. After #3789 lands, #3785 can merge the updated base and obtain new-head required-check evidence.

  10. pithead-developer commented on Oct 31, 2026

    @pithead-developer
    ContributorAuthor

    Matching recurrence on HugePages fixture PR #3798 at 77e840355e57f770fe2521412e335cad7a170873: Dashboard Docker test stage job 124390327457 fails only dashboard/tests/service/donation/test_planner_properties.py:58, test_weekly_share_with_room_stays_within_one_slice. The raw log reports 1 failed, 3633 passed, 10 skipped and 97.33% total coverage. Accumulated debt is 2.0372681319713593e-10 ms versus expected 2.3283064365386963e-10 ms with absolute tolerance 1e-12 ms, matching this issue’s original case.

    git diff --exit-code origin/develop-v2.1.0...HEAD -- dashboard/mining_dashboard/service/donation/planner.py dashboard/mining_dashboard/sim/project_slice_model.py dashboard/tests/service/donation/test_planner_properties.py exits 0. PR #3798 changes only its integration fixture and documentation. Reusing #3786 and PR #3789; no dashboard retry, tolerance change or duplicate implementation is included. The distinct HugePages shell fixture failure is being corrected on #3798.

  11. pithead-developer commented on Oct 31, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #3789.

  12. added a commit that references this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions