feat(analysis): verify SPEC R8 (sep-CMA-ES > SFT > RS > REINFORCE) offline#382
Merged
James-CUDA merged 1 commit intoJul 22, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #381
What
docs/SPEC.md§1.3 lists R8 — "sep-CMA-ES > SFT > RS > REINFORCE on all 4 tasks" (Table 4) as a replication invariant, but nothing verified it (R5/R7/R11/R12 have offline checks; R8 had none). The SPEC itself flags R8 as "a hypothesis to test, not a given" — the block-ε-separability that justifies sep-CMA-ES was measured on the paper's 7-agent representation, not our 3-model pool. R8 is the justification for a derivative-free ES outer loop at all: if RS or REINFORCE matched sep-CMA-ES, the evolutionary search wouldn't be earning its keep.This adds
src/trinity/analysis/optimizer_ranking.py(+ tests) — an offline check that reads per-task{optimizer: final_fitness}and reports whether the observed best→worst order matches the expected chain, which adjacent pairs invert it, and whether R8 holds on every scored task.API (mirrors the R7
turns_monotonicity/ R11coordinator_vs_llmmodules)canonical_optimizer(name)→ canonicalsep_cmaes/sft/rs/reinforce(case/separator-insensitive;Sep-CMA-ES,random search,policy_gradient, …), elseNoneanalyze_task({optimizer: fitness})→OptimizerRanking(observed order, expected order among present,inversions,holds)analyze_tasks({task: {...}})→ per-task rows +r8_holds(True iff ≥1 scored task and every scored task holds — "on all 4 tasks"),violationsrender(...)→ compact markdown reportStrict ordering (a tie is not a pass), tolerant to a subset of optimizers (chain checked among those present, in expected order), and to non-numeric/unknown entries (dropped, never crash).
Verification
Pure numpy/stdlib — no torch, no network, no GPU. 14 offline tests;
ruff+mypyclean onsrc/.