Skip to content

Fix AF2 depth scans, feature outputs, CPU imports and contact parsing; disable unsupported UniFold - #643

Merged
DimaMolod merged 4 commits into
mainfrom
claude/bold-wozniak-oi0x17
Oct 1, 2026
Merged

DimaMolod merged 4 commits into
mainfrom
claude/bold-wozniak-oi0x17

Conversation

@DimaMolod

@DimaMolod DimaMolod commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix advertised AlphaFold 2 options and analysis helpers, and make the release's supported backend boundary explicit.

  • Give each distinct AF2 MSA scan depth its own configuration and RunModel; load parameters once per model and retain runner reuse for fixed-depth/default predictions.
  • Save the built multimer's features after creating its actual output directory, including --use_ap_style directories.
  • Join chopped template sequence fragments across all requested regions.
  • Select the actual top-ranked distogram pickle, fix directory/verbose handling, and include every complete distance bin below the requested cutoff. Regression fixtures now match AF2's 64 logits and 63 boundaries.
  • Allow CLI help and validation without a GPU while retaining JAX-before-TensorFlow/OpenMM initialization.
  • Declare Python >=3.10, matching the language features used by the package.
  • Disable legacy UniFold selectors for this release with an actionable error before input processing. The packaged unifold namespace belongs to the AlphaLink2 fork and is not a validated native UniFold runtime. Backend discovery and documentation list AF2, AF3, and AlphaLink; AlphaLink requires its own weights.
  • Install the supported CPU JAX runtime in smoke and coverage CI, so fresh-interpreter compatibility tests exercise real imports.
  • Restore AF3 backend test stubs and temporary JAX attributes at fixture teardown, preventing order-dependent failures in real ModelCIF tests. A subprocess regression fixes the reproducing order and forces serial execution.
  • Preserve canonical pytest node IDs. The previous docstring rewrite removed parameter identities, causing xdist --dist loadfile to silently omit cases. A subprocess regression now checks that an intentionally failing second parameter fails serial and parallel execution.

Validation

  • Serial unit + integration suite: 749 passed, 12 skipped (optional ihm, Torch, and compiled AF3 unavailable in that environment).
  • Parallel unit + integration suite (-n 4 --dist loadfile): 749 passed, 12 skipped; exactly the same 761 test identities, including skips, as the serial run.
  • New cutoff/pytest regression tests demonstrated the original failures before the fixes and pass afterward.
  • Fresh MMseqs A3M and compressed feature generation for the issue-588 dimer completed.
  • Compiled AF3 compatibility checks: 59 passed, including the vanilla AF3 JSON round trip and real ModelCIF conversion.
  • Real CLI rejection of both legacy UniFold selectors before reading nonexistent inputs (single, resident-batch, and wrapper entrypoints).
  • AF2 GPU scan completed at depths 16 and 508. Depth-508 ipTM 0.7582, saved multimer features verified, top-ranked pickle selection verified, and 47 interface contacts extracted at 8 Å.
  • AF3 GPU dimer inference completed with ipTM 0.7100. Species-pairing and paired/unpaired MSA integrity assertions passed.
  • GitHub Python 3.10/3.11 smoke tests and coverage on commit 2128f446.
  • Both container builds passed on the updated head. Full successful CI run.

UniFold restoration is outside this release: it requires a compatible runtime and validation with native UniFold weights.

Final coverage: 82.5%. Additional AF3 fixture-isolation suite: 43 passed.

…, GPU-less import

- AlphaFold 2 setup registered one RunModel under every MSA depth while
  rewriting its single config in place, so --msa_depth_scan predicted N times
  at the last depth, differing only by seed. Each distinct depth now gets its
  own config and runner; parameters are still loaded once per model name.
- --save_features_for_multimeric_object read feature_dict off the
  MultimericObject class (AttributeError on every run) and ran before the fold
  directory existed. It now pickles the built object's features into the
  fold's own directory once that exists.
- The UniFold backend required output_dir and multimeric_object in setup() and
  took one object in an instance-method predict(), so no adapter could call
  it. It now follows the backend contract; --unifold_model_name is defined by
  run_structure_prediction, forwarded by run_multimer_jobs, validated for the
  unifold backend, and kept for multimers instead of being replaced by the
  AlphaFold 2 "multimer" preset.
- The import-time jax.local_devices(backend='gpu') probe raised on any machine
  without a GPU, so --help and head-node flag validation failed. It is now a
  tolerant helper (alphapulldown.prediction.jax_devices) that still runs
  before the backends import TensorFlow and OpenMM.
- ChoppedObject kept only the first region's template_sequence fragment when
  concatenating regions; fragments are now joined per template, so the
  sequence matches the chopped chain length.
- distogram_parser.get_contacts referenced an undefined `datadir` and re-read
  whichever pickle the scan visited last rather than the top-ranked one.
- requires-python is 3.10: the package uses slots dataclasses and
  zip(strict=True), and CI runs 3.10 and 3.11.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mkya8Y3utHEPbVPc2RbJu3
@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.

Reject legacy UniFold selectors before input processing because the bundled
AlphaLink fork lacks a compatible native UniFold inference API and network.
Keep legacy flags/imports parseable for an actionable error and document the
release limitation without advertising unsupported model configurations.

Preserve pytest parameter IDs: the previous docstring rewrite made xdist
loadfile silently omit cases. A subprocess regression now verifies that a
failing second parameter fails both serial and parallel execution.

Include every complete AF2 distogram bin at or below the distance cutoff,
with regressions matching the real 64-bin/63-edge output representation.

Validation: 748 passed, 12 skipped in both serial and xdist CPU suites;
identical 760 executed test identities including skips. Fresh MMseqs features
generated; AF2 depth-scan and AF3 species-pairing GPU checks submitted separately.
@DimaMolod DimaMolod changed the title Fix AF2 MSA-depth runners, saved multimer features, UniFold contract, GPU-less import, chopped template sequences, distogram parser Fix AF2 depth scans, feature outputs, CPU imports and contact parsing; disable unsupported UniFold Oct 1, 2026
Canonical pytest IDs exposed two previously omitted import-order cases. Their subprocesses intentionally bypass pytest stubs and need the real AF2 JAX tree API. Install the supported CPU JAX version in smoke and coverage jobs without enabling CUDA dependencies.
Coverage exposed an order-dependent fake mmCIF parser leaking from the backend fixture into real ModelCIF checks. Scope module and JAX attribute replacements to the fixture, including setup failures. Add a serial subprocess regression for the reproducing module order. The original probe failed; the corrected probe and all 43 related tests pass.
@DimaMolod
DimaMolod merged commit 582c1ef into main Oct 1, 2026
6 checks passed
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.

2 participants