Refuse a judge whose search data changed, and close Phase 13
ci / test (postgres) (push) Failing after 10m23s
ci / test (sqlite) (push) Successful in 7m44s
ci / image (push) Skipped
ci / test (postgres) (pull_request) Successful in 10m3s
ci / test (sqlite) (pull_request) Successful in 7m35s
ci / image (pull_request) Successful in 2m31s

The control compares the replicas with the Sharpe ratio stored by the
contender's own trial. If the search data changed between that trial and
the judge, the replicas would run on new data against a result from the
old, so the tournament now fails with the reason. A test changes one bar
after the trial and fails without the guard.

ADR 0029 records the choices of the phase: the trial judge split into
resumable units on a pool of low-priority workers, the common count of
trials and the field statistics, the control against chance on surrogate
prices, the immutable tournament plan with a final tract read once, and
the seven checks a finalist must pass. ROADMAP and STATE are updated.

refs #122, refs #123, refs #124, refs #125, refs #126

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-04 14:27:19 +01:00
1 parent 9ae1e955a4
commit 9e98c70727
5 files changed
+157 -15

No files matched your search

+28
View File
@@ -540,6 +540,34 @@ public sealed class TournamentTests
}
}
/// <summary>
/// The control compares the replicas with the Sharpe ratio of the contender's own trial: when its search data change
/// between that trial and the judge, the tournament fails instead of mixing the two.
/// </summary>
[TestMethod]
[TestCategory(Category.Integration)]
public async Task SearchDataThatChangedAfterTheTrialFailTheTournament()
{
var clock = new ManualClock(Now);
await using var test = await DatabaseTests.MigratedAsync().ConfigureAwait(false);
var field = Small();
using var lab = Lab(test, clock, field);
var tournament = await lab.PlanTournamentAsync(SmallRequest(("a", "g1", "m1", ["EAA-EUR"], OneGrid), ("b", "g2", "m1", ["NAA-EUR"], OneGrid)), _none)
.ConfigureAwait(false);
var trials = await lab.Trials.OfTournamentAsync(tournament.Id, _none).ConfigureAwait(false);
await lab.ProcessAsync(trials[0].Id, _none).ConfigureAwait(false);
// One bar of the search tract of «a» is corrected after its trial.
var bars = Synthetic.Bars(Synthetic.MeanRevertingReturns(1099, 11, halfLife: 2, volatility: 0.02), 11).ToList();
bars[500] = bars[500] with { Close = bars[500].Close * 1.01, High = Math.Max(bars[500].High, bars[500].Close * 1.01) };
field.Add("EAA-EUR", bars);
await lab.ProcessAsync(trials[1].Id, _none).ConfigureAwait(false);
var (status, error) = await StateAsync(test, tournament.Id).ConfigureAwait(false);
Assert.AreEqual(TournamentStatuses.Failed, status);
Assert.AreEqual("I dati di ricerca di «a» sono cambiati dopo la sua prova: il campionato non si giudica.", error);
}
[TestMethod]
[TestCategory(Category.Unit)]
public void TheFinalistsAreTheBestOfEachGroupAndMarketAndAtMostEight()