Skip to content

test: verify all algorithms match their authors' proposals (3-layer fidelity)#12

Open
blankjul wants to merge 2 commits into
mainfrom
test/algorithm-fidelity
Open

test: verify all algorithms match their authors' proposals (3-layer fidelity)#12
blankjul wants to merge 2 commits into
mainfrom
test/algorithm-fidelity

Conversation

@blankjul

@blankjul blankjul commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

How we now check every algorithm is implemented as the authors proposed — a layered validation strategy, since "beats a baseline" (test_performance.py) can't distinguish a faithful implementation from a lucky-but-wrong one.

Layer 1 — paper-defining-property tests (ground truth)

Each algorithm's defining computation is exposed as a small static seam (like the existing EHVI.expected_hvi/CSEA.label_good) and asserted directly:

Algorithm Defining-property test
MOEA/D-EGO LCB mu-kappa*sigma optimistic; decomposition picks the augmented-Tchebycheff minimizer per weight
TSEMO Thompson sample mu+sigma*z (unbiased); greedy selection hypervolume-monotone
K-RVEA convergence→most-uncertain; diversity→one-per-active-vector, topped up to a full batch
SAASBO ARD Kriging carrying the shrinkage theta_prior (the sparse-axis mechanism)
(Log)EI EI=analytic closed form; LogEI=log(EI) where finite, same argmax, stays finite under underflow

(EHVI, ParEGO, CSEA, TuRBO already had these.) Seams are behavior-preserving — reproducibility stays bit-identical, golden unchanged. Suite grew 8→20 tests.

Layer 2 — reference cross-check → delivered as ground truth instead

BoTorch was considered but rejected: EHVI is already checked against exact grid quadrature and LogEI against the exact analytic EI — stronger oracles than another implementation, and dependency-free (no torch in CI). TuRBO/SAASBO have no well-defined fixed-input comparison.

Layer 3 — convergence-sanity on each paper's problem (test_reproduction.py, slow)

Each algorithm runs over 3 seeds on its paper's problem class and must reach a sensible metric. Framed honestly as a ballpark check, not exact table reproduction (our versions are simplifications). Low-variance algorithms use the median; TuRBO-1 and the SAASBO scaffold are variance-prone (calibration showed TuRBO 4.5..19.9), so they use best-of-seeds. Bands ~2-3x calibration. 8 passed in ~3.5 min.

Every algorithm now has ground-truth + convergence coverage. pyclawd check green.

🤖 Generated with Claude Code

blankjul added 2 commits July 17, 2026 17:22
…)EI acquisition

Performance tests only show each algorithm beats a baseline; they cannot tell a
faithful implementation from a lucky-but-wrong one. Four of the new algorithms
had no fidelity check. Close the gap by exposing each one's paper-defining
computation as a small static seam (mirroring EHVI.expected_hvi / CSEA.label_good)
and asserting the defining property:

- MOEA/D-EGO: lcb() is the optimistic mu - kappa*sigma; select_by_decomposition()
  picks the augmented-Tchebycheff minimizer per weight (Zhang et al., 2010).
- TSEMO: thompson_sample() is mu + sigma*z (mean at zero variance, unbiased);
  greedy_hvi_select() is hypervolume-monotone (Bradford et al., 2018).
- K-RVEA: select_infills() takes the most-uncertain points in the convergence
  regime and one-per-active-vector (topped up to a full batch) in the diversity
  regime, switching on the active-set change (Chugh et al., 2018).
- SAASBO: the surrogate is an ARD Kriging carrying the shrinkage theta_prior
  (the sparse-axis mechanism; Eriksson & Jankowiak, 2021).
- (Log)EI: EI.calc is the analytic closed form; LogEI equals log(EI) where EI is
  finite, shares its argmax, and stays finite where EI underflows to 0 -- the
  acquisition ParEGO/TuRBO/SAASBO all optimize (Ament et al., 2023).

The seams are pure behavior-preserving extractions: all reproducibility tests
stay bit-identical, so the seed-1 golden scores are unchanged. Fidelity suite
grows from 8 to 20 tests; every new algorithm now has a defining-property check.
…se 3)

Add tests/test_reproduction.py (slow-marked): each new algorithm is run over
three seeds on the kind of problem its paper targets and asserted to reach a
sensible metric level. This is the coarsest fidelity tier -- deliberately a
ballpark check, not exact table reproduction, since pysamoo's versions are
simplifications (MAP SAASBO, Monte-Carlo EHVI, small budgets). It catches a
regression that leaves an algorithm running but no longer optimizing, which a
single-seed beats-a-baseline test can miss.

Robust statistic per algorithm, chosen from calibration:
- the six low-variance algorithms are checked on the median over the seeds;
- TuRBO-1 and the SAASBO scaffold are variance-prone across seeds (calibration
  showed TuRBO spanning 4.5..19.9 on Ackley), so they are checked on the best
  of the seeds -- asserting every seed converges would test noise, not
  correctness.

Bands are ~2-3x the worst calibration value, robust to platform jitter but
failing hard if convergence breaks. Validated: 8 passed in ~3.5 min.
@blankjul blankjul changed the title test: paper-faithful fidelity tests for all new algorithms test: verify all algorithms match their authors' proposals (3-layer fidelity) Jul 18, 2026
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