"""The multiple-testing bar must RISE with the trial count: the same returns clear DSR at N=1 but not at a
large N (False Strategy Theorem). This locks the immune system the continuous factory depends on."""
from __future__ import annotations

import numpy as np

from fxhnt.domain.gauntlet.core import deflated_sharpe


def test_dsr_drops_as_trials_grow() -> None:
    rng = np.random.default_rng(0)
    r = rng.normal(0.0008, 0.01, 1000)            # a modest positive stream
    sr_var = 0.25                                  # variance of trial Sharpes across the search
    dsr_n1 = deflated_sharpe(r, 1, sr_var)
    dsr_n500 = deflated_sharpe(r, 500, sr_var)
    assert dsr_n500 < dsr_n1                        # more trials -> higher bar -> lower DSR
