Skip to content

replace vardiff hardcoded threshold ladder with parametric noise floor#2148

Open
gimballock wants to merge 1 commit into
stratum-mining:mainfrom
fossatmara:vardiff/parametric-thresholds
Open

replace vardiff hardcoded threshold ladder with parametric noise floor#2148
gimballock wants to merge 1 commit into
stratum-mining:mainfrom
fossatmara:vardiff/parametric-thresholds

Conversation

@gimballock
Copy link
Copy Markdown

Compute the should-update threshold live from delta_time and shares_per_minute as a 99% predictive Poisson bound on the share count, plus a 5pp safety margin. Replaces the hardcoded 100/60/50/45/30/15 rungs which were calibrated to a different statistical regime than the default share rate produces, so most rungs sat inside the Poisson noise band and fired on sampling noise rather than real hashrate changes.

Drops the unconditional >=100% rung specifically: at small delta_time (16-30s window) the noise band can span beyond +-100%, so this rung also fired on noise. The >1000% Phase 1 ramp clamp is unaffected and still handles miners starting far from truth.

Tests:

  • Replace the multi-step with_less_spm_than_expected check (calibrated to old rungs) with a single sustained-underperformance scenario.
  • Drop no_shares_less_than_30s_decrease — case is intentionally unreachable at typical share rates.
  • Bump simulation_duration in no_shares_30_to_60s_decrease (31 -> 55) and hashrate_clamps_to_minimum (16 -> 60) so they sit outside the new noise floor.
  • Add no_fire_within_noise and fires_outside_noise covering the core property of the change.

Compute the should-update threshold live from `delta_time` and
`shares_per_minute` as a 99% predictive Poisson bound on the share count,
plus a 5pp safety margin. Replaces the hardcoded 100/60/50/45/30/15 rungs
which were calibrated to a different statistical regime than the default
share rate produces, so most rungs sat *inside* the Poisson noise band
and fired on sampling noise rather than real hashrate changes.

Drops the unconditional >=100% rung specifically: at small `delta_time`
(16-30s window) the noise band can span beyond +-100%, so this rung also
fired on noise. The `>1000%` Phase 1 ramp clamp is unaffected and still
handles miners starting far from truth.

Tests:
- Replace the multi-step `with_less_spm_than_expected` check (calibrated
  to old rungs) with a single sustained-underperformance scenario.
- Drop `no_shares_less_than_30s_decrease` — case is intentionally
  unreachable at typical share rates.
- Bump `simulation_duration` in `no_shares_30_to_60s_decrease` (31 -> 55)
  and `hashrate_clamps_to_minimum` (16 -> 60) so they sit outside the new
  noise floor.
- Add `no_fire_within_noise` and `fires_outside_noise` covering the core
  property of the change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant