small_molecule_binding: fix guided-RFD3 crashes, deadlock, and stuck seeds - #63
Open
drawadiagram wants to merge 1 commit into
Open
small_molecule_binding: fix guided-RFD3 crashes, deadlock, and stuck seeds#63drawadiagram wants to merge 1 commit into
drawadiagram wants to merge 1 commit into
Conversation
…seeds The guided (partial-diffusion) RFD3 path added in the preceding commit crashed every pipeline on first use. Job 21916521 lost all 4 pipelines to the same ComponentValidationError roughly 3h in. This is the fix series. Ligand atom-name mapping. Boltz-2 assigns its own atom names to the ligand when co-folding, unrelated to the canonical names in the Rosetta .params file. select_exposed/select_buried are copied verbatim from the base RFD3 spec and are keyed by those canonical names, so they never resolved against a Boltz-derived PDB and RFD3 rejected every guided run. _infer_ligand_atom_mapping() now establishes the correspondence by element + heavy-atom-connectivity graph isomorphism (RDKit DetermineConnectivity, since Boltz emits no CONECT records), breaking ties by Kabsch RMSD against the reference structure's real coordinates. Local symmetry -- a sulfonate's three interchangeable oxygens -- can yield several valid isomorphisms, so the best-vs-next-best RMSD gap is logged; a near-tie means the tie-break was not decisive and the mapping deserves review. Every helper fails closed, returning None/False so the caller falls back to unguided diffusion instead of emitting a spec RFD3 will reject. partial.length. RFD3's DesignInputSpecification validator rejects 'length' outright when partial.input/partial_t are set, since length is inferred from the input structure in that mode. The base spec's length is only valid for from-scratch diffusion, so it is now dropped when building a guided spec. Guided-backbone QC deadlock. Only a successful fold ever cleared rfd3_input_pdb, so a guided backbone that kept failing backbone QC looped on the same seed forever. After 3 consecutive guided failures the pipeline now abandons guided mode and regenerates unguided. Stuck guided seed. rfd3_input_pdb is now cleared on every escalation to STEP_RFD3, not just backbone-QC failures. Previously the sequence- similarity gate and packmin could escalate while leaving the seed pinned, so RFD3 regenerated near-duplicate doomed backbones: job 21945304 shows 17 consecutive p2 generations producing byte-identical guided_scaffold.pdb output from one stuck seed. Also adds an mpnn_ensemble_size knob, fixes per-pipeline input_dir, pins rdkit==2024.9.6 in delta_env_setup.sh, and adds validate_run.py check 8 (check_guided_ligand_atom_names) plus the standalone scripts/check_ligand_atom_mapping.py. Two corrections to that new tooling, beyond the original change: the crash artifacts check_ligand_atom_mapping.py reads live under logs/, which is gitignored, so they are absent on a fresh checkout. The script reported PASS when every check had skipped -- green-lighting a clean checkout -- and now reports INCONCLUSIVE (exit 2) instead. CLAUDE.md's claim that the fixtures are "already in the repo" is corrected to say where they actually come from. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lo8DwSbyvdWZRkkkka6gA2
Closed
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.
Splits the guided-RFD3 fix series out of #59. Fourth of four, and the smallest.
Based on #62 — review only the commit on this branch. GitHub retargets this to
mainonce #62 merges.The guided (partial-diffusion) RFD3 path added in #62 crashed every pipeline on first use. Job
21916521lost all 4 pipelines to the sameComponentValidationErrorabout 3h in. This is the fix series.Root cause: ligand atom names
Boltz-2 assigns its own atom names to the ligand when co-folding, unrelated to the canonical names in the Rosetta
.paramsfile.select_exposed/select_buriedare copied verbatim from the base RFD3 spec and keyed by those canonical names, so they never resolved against a Boltz-derived PDB and RFD3 rejected every guided run._infer_ligand_atom_mapping()now establishes the correspondence by element + heavy-atom-connectivity graph isomorphism (RDKitDetermineConnectivity, since Boltz emits no CONECT records), breaking ties by Kabsch RMSD against the reference structure's real coordinates. Local symmetry — a sulfonate's three interchangeable oxygens — can yield several valid isomorphisms, so the best-vs-next-best RMSD gap is logged: a near-tie means the tie-break wasn't decisive and the mapping deserves a look. Every helper fails closed, returningNone/Falseso the caller falls back to unguided diffusion rather than emitting a spec RFD3 will reject.Three more failure modes
partial.lengthis dropped whenpartial.input/partial_tare set. RFD3'sDesignInputSpecificationvalidator rejectslengthoutright in partial-diffusion mode, where length is inferred from the input structure.rfd3_input_pdb, so a guided backbone that kept failing backbone QC looped on the same seed forever. After 3 consecutive guided failures the pipeline now abandons guided mode and regenerates unguided.rfd3_input_pdbis now cleared on every escalation toSTEP_RFD3, not just backbone-QC failures. The sequence-similarity gate and packmin could previously escalate while leaving the seed pinned, so RFD3 regenerated near-duplicate doomed backbones — job21945304shows 17 consecutive p2 generations producing byte-identicalguided_scaffold.pdboutput from one stuck seed.Also adds an
mpnn_ensemble_sizeknob, fixes per-pipelineinput_dir, pinsrdkit==2024.9.6, and addsvalidate_run.pycheck 8 (check_guided_ligand_atom_names).scripts/check_ligand_atom_mapping.pyreads crash artifacts underlogs/, which is gitignored — so they aren't committed and are absent on any fresh checkout. As originally written the script printedRESULT: PASSand exited 0 when both of its checks had skipped, i.e. it green-lit precisely the case it couldn't test. It now reportsINCONCLUSIVEand exits 2 unless given real fixtures via--base-path <completed run's output tree>.CLAUDE.md's claim that the fixtures are "already in the repo" is corrected to say where they actually come from.So: this tool is not a merge gate as it stands. The real regression check is
validate_run.py's check 8 against a completed run.Scope note
validation-plan-postfix-atomname.mdfrom #59 is not carried over — it's a post-run checklist for whoever runs the next HPC job rather than repo documentation, and its one durable part (the new-ligand onboarding check) was already inCLAUDE.md.Replaces part of #59.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lo8DwSbyvdWZRkkkka6gA2