Commit Graph
3 Commits
Author SHA1 Message Date
Alby96andClaude Opus 5.5 9e98c70727 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>
2026-12-04 14:27:19 +01:00
Alby96andClaude Opus 5.5 9ae1e955a4 Keep the laboratory going and resumed units consistent when judging tournaments
An error while judging a tournament (a plan that no longer reads, the database out
of reach) could stop the whole laboratory queue or leave the tournament unjudged
until a restart. The judge now reads inside its failure handling, so an unreadable
plan fails the tournament with an Italian reason; every call of the judge is
guarded; and a finished contender trial that comes back to the queue brings its
tournament to the judge.

Resumed trials and judges reused finished units without checking they were
computed on the same inputs, so a restart after new bars or an image update mixed
runs of two data sets or two engines. Every unit now records its fingerprint (the
data, the engine version, the build) and only units on the same inputs are reused;
the runs on the final tract are checked on the build and, when the tract is read,
on its data.

The judge also checks that each contender trial is the one the tournament plan
wrote: plan hash, grid, data source, capital, slippage and reference share.

The settings hint now says the workers are calculations of one trial; trials still
run one at a time.

refs #122, refs #123

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 14:20:43 +01:00
Alby96andClaude Opus 5.5 8aafa5ad32 Plan, run and judge a tournament of contenders in the laboratory
ci / test (postgres) (push) Successful in 7m47s
ci / test (sqlite) (push) Successful in 6m27s
ci / image (push) Successful in 1m57s
A tournament judges many contenders together so that a rule cannot win by
chance alone. Its plan (contenders with rules version and grid, data, costs,
thresholds with the control share, the finalists rule, control repetitions
and seed, combinations, stress windows, variants counted before) is written
with the trials of its contenders in one transaction, before any result, and
keeps its fingerprint like a trial plan. The contender trials read only the
search window; when the last one finishes the tournament goes to its judge.

The judge picks at most eight finalists, one per group and market, by
walk-forward Sharpe, and writes them as the final tract is opened: the
opening is a compare-and-set, so a resumed judge gets back the same
finalists. Each finalist then runs the control against chance on surrogate
series and its chosen variant on the final tract at plain and doubled costs;
these are units in tournament_units, so a judge stopped halfway redoes only
what it had not finished and reads the final tract only for finalists. The
report counts every variant in a common N (field, combinations of the
finalists, the register at the opening, prior protocols), deflates each
finalist against the field variance, computes the common PBO, the effective
number of bets and a block-bootstrap Sharpe interval, and a finalist passes
only if every check passes. Unit outcomes are dropped when it ends.

The trial engine gains LongOnly and Surrogate with default members, so other
engines keep compiling; the daily engine centres its control. Tests cover the
plan written first and never changed, the final tract read once, a resumed
judge, the finalists rule, and a built field where only the two contenders
with an edge pass with 200 repetitions.

refs #123, refs #125

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 13:48:00 +01:00