Skip to content

fix + tests: AF3 fold without ranked samples; cover the scenarios the suites missed - #663

Merged
DimaMolod merged 3 commits into
mainfrom
test/coverage-since-2.10
Oct 14, 2026
Merged

DimaMolod merged 3 commits into
mainfrom
test/coverage-since-2.10

Conversation

@DimaMolod

Copy link
Copy Markdown
Collaborator

Stacked on #662. I measured coverage of everything changed since 2.10.0 and added a test for each uncovered case a run can actually reach. That surfaced one bug, fixed here.

The bug

write_fold_outputs warned and returned when ranking_scores.csv had no rows, and postprocess went on to mark the fold complete. A later --allow_resume run then skipped a fold that had no model. It now raises: the job is reported failed, the fold record stays incomplete, and a resumed run predicts the fold again. Its test fails on the old code (DID NOT RAISE).

The tests

  • AF3 outputs:
    • a seed is still written when its ModelCIF metadata cannot be added;
    • metadata records are kept once (homodimers, copied sidecars);
    • an unreadable sidecar is only a warning.
  • AF3 runner:
    • seeds are handed over one by one as they are predicted, which seed-level resume relies on;
    • missing weights stop the fold before anything is written;
    • a kernel record that is not a JSON object is replaced;
    • the model config sets only the fields its AF3 release has.
  • AF3 inputs:
    • a JSON input read from its .json.xz copy, as the published database ships them, and a missing one;
    • RNA and DNA JSON chains sliced to regions;
    • regions outside a chain, or on a ligand, rejected;
    • RNA, DNA and ligand chains renamed on a chain-ID clash;
    • an unreadable metadata sidecar leaves the description alone;
    • duplicate-residue normalisation skipped when the sequence doesn't match;
    • template sequences shorter than the query;
    • job names of fold inputs and of nothing.
  • AF3 debug:
    • no translation summary without a translation;
    • only rows with a species are paired;
    • the final MSA is skipped without alignments and never fails the prediction.
  • Storage:
    • no best sample without a readable ranking;
    • a slim pass on a missing or already-slimmed directory.
  • AF2: a JSON file truncated by an older version is ignored on resume.

Coverage of the code changed since 2.10.0

Measured as branch coverage over the unit and integration suites in both release images, combined: 93% → 96.4% of 1,268 changed statements. What's left:

  • the model forward pass in ModelRunner, which only the GPU suites run, and all of them passed this cycle;
  • defensive except fallbacks and unreachable type guards.

AlphaLink is omitted by .coveragerc (torch). Its change in #661 was signature-only, and test_inference_flags covers it.

Verification

  • Unit + integration, both release images: no new failures. AF2 image: 970 passed, 26 skipped (946 before). AF3 image: 1041 passed, 15 skipped (1017 before). The same pre-existing environmental failures as on main.

🤖 Generated with Claude Code

DimaMolod and others added 2 commits October 14, 2026 07:55
…complete

write_fold_outputs warned and returned when ranking_scores.csv had no rows, and
postprocess went on to mark the fold complete, so --allow_resume then skipped a
fold that had no model. It now raises: the job is reported failed, the fold
record stays incomplete, and a resumed run predicts the fold again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From a coverage run of the code changed since 2.10.0, a test for each uncovered
case that a run can actually reach:

- AF3 outputs: a seed is still written when its ModelCIF metadata cannot be
  added; metadata records are kept once (homodimers, copied sidecars) and an
  unreadable sidecar is only a warning.
- AF3 runner: seeds are handed over one by one as predicted (what seed-level
  resume relies on); missing weights stop the fold before anything is written;
  a kernel record that is not a JSON object is replaced; the model config sets
  only the fields its AF3 release has.
- AF3 inputs: a JSON input read from its .json.xz copy, and a missing one;
  RNA and DNA JSON chains sliced to regions; regions outside a chain or on a
  ligand rejected; RNA, DNA and ligand chains renamed on an ID clash; an
  unreadable metadata sidecar leaves the description alone; duplicate-residue
  normalisation skipped when the sequence does not match; template sequences
  shorter than the query; job names of fold inputs and of nothing.
- AF3 debug: no translation summary without a translation; only rows with a
  species pair; the final MSA is skipped without alignments and never fails
  the prediction.
- Storage: no best sample without a readable ranking; a slim pass on a
  missing or already slimmed directory.
- AF2: a JSON file truncated by an older version is ignored on resume.

Changed-line coverage across both images goes from 93% to 96.4%; what is left
is the model forward pass (run by the GPU suites) and defensive fallbacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@DimaMolod
DimaMolod changed the base branch from refactor/af3-output-helpers to main October 14, 2026 08:00
@DimaMolod
DimaMolod merged commit c9b0d2a into main Oct 14, 2026
6 checks passed
@DimaMolod
DimaMolod deleted the test/coverage-since-2.10 branch October 14, 2026 08:00
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