Skip to content

Ablation power calibration (PR 0): can adhesion_v1 adjudicate anything? - #179

Merged
hyphaltip merged 3 commits into
mainfrom
ablation-power-calibration
Nov 28, 2026
Merged

hyphaltip merged 3 commits into
mainfrom
ablation-power-calibration

Conversation

@hyphaltip

Copy link
Copy Markdown
Member

Answers one question before any component is built or tested:

How large an improvement would a component have to make before adhesion_v1 could tell?

If that minimum detectable effect is large, the finding is that the benchmark is too small, and curation outranks harness work. Deciding that cheaply, before building the full harness, is the whole point. No real component is tested here — synthetic signals of known strength are run through the real decision rule and the rejection rate is measured.

Why PR 0 exists at all

An independent review implemented the original 2b harness design and measured it. Ten findings were blocking; four were re-verified independently before being accepted. Three changed this code:

Finding Measured Change
Pooling out-of-fold scores across folds is incoherent, not merely uncalibrated length-only AUC 0.912 in Saccharomycetes vs 0.327 in Eurotiomycetes — two folds learn "long ⇒ adhesin", the third the opposite; 47% of pooled pairs compare contradictory scores primary metric is within-fold stratified concordance
The specified baseline is beaten by one of its own inputs log length alone AP 0.690 vs 0.551 for the 21-feature model the bar is the best of a declared family, C tuned by inner cluster-grouped CV
ΔAP = 0 is the wrong null, and the error scales with feature count pure noise worth +0.007 at 1 dim, −0.025 at 20 dimensionality bias measured and reported; the null is a permutation of that component

Corrections to my own plan, both verified and pinned by tests

  • P2's justification was wrong. There are zero mixed-label clusters inside the scorable folds. The SC3/SC4 and Rep1/Hum3 showcase pairs sit entirely outside C1 and decide nothing. D-B is still right, but for the paralogue reason.
  • The D-A leakage table only reproduces with the training pool set to all 166 proteins (Pezizomycotina drops 5 vs 2). The plan never declared which pool it meant. Now an explicit --train-pool flag, recorded in every output, with both values pinned by a test.

Two bugs found while building it

  • The C-pinning bug. The bar was fitted with a tuned C while components ran at fixed C=1.0, so the difference measured the regularisation change, not the component — a pure-noise component appeared to cost 0.15 concordance. Caught because the smoke run's null delta was implausible. choose_bar now returns its per-fold C; two regression tests pin it. Null delta is now −0.003 at one dimension.
  • A ceiling effect in my own fixture — trivially separable classes made every delta exactly zero, so a real-signal test failed for a reason unrelated to the code.

The smoke run already reproduces finding 4: the dimensionality penalty runs −0.003 → −0.021 → −0.046 as a noise component goes 1 → 5 → 20 features.

Contents

analysis/ablation_power/: benchmark_data.py (load, verify SHA256SUMS, strict-cluster splits), model.py (the bar), stats.py (stratified concordance, paired cluster permutation test, BCa), simulate.py (three signal shapes, type-I, power curves), run_power.py (CLI), README.md (everything declared in advance).

63 tests in tests/ablation_power/, added to the no-torch CI job (which gains scikit-learn). Ruff 0.3.5 clean.

What has NOT been run

The real calibration — 200 replicates × 400 permutations across three signal shapes — is an HPCC run and has not been done. The numbers in this PR are from an 8-replicate smoke run and are not results.

Expectation worth stating in advance: based on the review's measurements I expect the realistic (clade-heterogeneous) and binary signals never to reach 80% power on the grid. If that holds, adhesion_v1 cannot adjudicate any plausible component and curation is the next thing worth compute.

🤖 Generated with Claude Code

hyphaltip and others added 3 commits November 27, 2026 18:44
Answers one question before any component is built: how large an improvement
would a component have to make before the frozen benchmark could tell? If the
answer is "larger than anything plausible", the finding is that the benchmark
is too small and curation outranks harness work.

No real component is tested here. Synthetic signals of known strength are run
through the real decision rule and the rejection rate is measured.

Shaped by an independent review that implemented the original 2b design and
measured it. Three of its findings changed this code:

  Pooling out-of-fold scores across folds is incoherent, not merely
  uncalibrated: length-only AUC is 0.912 in Saccharomycetes and 0.327 in
  Eurotiomycetes, so two folds learn "long => adhesin" and the third learns the
  opposite, and 47% of pooled pairs compare contradictory scores. The primary
  metric is now within-fold stratified concordance, which never compares across
  folds.

  The specified baseline was beaten by one of its own inputs: log length alone
  scores AP 0.690 against 0.551 for the 21-feature model. The bar is now the
  best of a declared family with C tuned by inner cluster-grouped CV.

  Delta = 0 is the wrong null and the error scales with feature count, so the
  dimensionality bias is measured and reported rather than assumed away.

Also corrects two errors in my own plan, both verified: there are ZERO
mixed-label clusters inside the scorable folds (so the showcase hydrophobin
pairs are outside C1 and decide nothing), and the D-A leakage table only
reproduces with the training pool set to all 166 proteins, which was never
declared. Both are now pinned by tests against the real benchmark.

One bug found in development and pinned by two regression tests: the bar and
the component model must be fitted at the SAME regularisation. Fitting the bar
with a tuned C while components ran at a fixed C=1.0 made a pure-noise
component appear to cost 0.15 concordance.

63 tests, added to the no-torch CI job (which gains scikit-learn).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…versions

The first HPCC run of both calibrations died on `import numpy` while reporting
exit code 0, because the ssh wrapper swallowed the failure.

Cause: `-I` implies `-s`, which drops user site-packages, and on the HPCC
numpy, scipy and scikit-learn live in ~/.local/lib/python3.12/site-packages.
The other -I scripts in this repo are stdlib-only, so this never came up.

My capability check was the real mistake: it ran `python3 -c "import numpy"`
without -I and reported success. Checking that imports work is not enough --
they have to be checked with the flag the run will actually use.

Since the result therefore depends on packages outside the repo and outside
the benchmark digest, baseline.json now records numpy, scipy and scikit-learn
versions beside the Python version.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The serial run took over 30 minutes for ONE training pool at 200 replicates on
a login node and was killed unfinished. Every (shape, effect, replicate) is
independent, so the simulation now runs as a flat task list over a process
pool, with --workers on the CLI and 16 cores in the job script.

Replicate count matters for the number this is meant to produce: a power
estimate near 0.8 from 200 draws has a standard error of about 2.8%, and the
minimum detectable effect inherits that noise. The sbatch defaults to 1000
replicates and 1000 permutations instead.

Parallelising forced a correctness fix. The serial version shared one random
generator across the replicates of a grid point, so a result depended on the
order they ran in. Each task now carries its own seed and builds its own
component from it, which makes a run reproducible whatever the worker count.
A test pins that serial and parallel give identical results.

The job script runs BOTH declared training pools, since which one to use was
an undeclared assumption in the original plan and it changes the leakage drop
counts. It refuses to run on a benchmark that fails its SHA256SUMS, on a dirty
or unpinned commit, or into an existing output directory, and it checks the
imports with the interpreter the run will use.

71 tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hyphaltip
hyphaltip merged commit 9796b83 into main Nov 28, 2026
3 of 4 checks passed
@hyphaltip
hyphaltip deleted the ablation-power-calibration branch November 28, 2026 15:41
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