Skip to content

Conversation

@IAlibay
Copy link
Member

@IAlibay IAlibay commented Jan 3, 2026

Blocked by #1773
Fixes #1722

TODO:

  • Add a test where we resume the unit with an existing partially complete set of files.

Checklist

  • All new code is appropriately documented (user-facing code must have complete docstrings).
  • Added a news entry, or the changes are not user-facing.
  • Ran pre-commit by making a comment with pre-commit.ci autofix before requesting review.

Manual Tests: these are slow so don't need to be run every commit, only before merging and when relevant changes are made (generally at reviewer-discretion).

Developers certificate of origin

@IAlibay IAlibay changed the title Add ressume support to HybridTop simulation unit [WIP] Add ressume support to HybridTop simulation unit Jan 3, 2026
@IAlibay
Copy link
Member Author

IAlibay commented Jan 3, 2026

pre-commit.ci autofix

@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.18%. Comparing base (548f060) to head (296da5d).

Files with missing lines Patch % Lines
openfe/protocols/openmm_rfe/hybridtop_units.py 90.90% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1774      +/-   ##
==========================================
- Coverage   95.54%   93.18%   -2.37%     
==========================================
  Files         197      197              
  Lines       17046    17060      +14     
==========================================
- Hits        16287    15897     -390     
- Misses        759     1163     +404     
Flag Coverage Δ
fast-tests 93.18% <92.30%> (?)
slow-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@IAlibay IAlibay changed the title [WIP] Add ressume support to HybridTop simulation unit [WIP] Add resume support to HybridTop simulation unit Jan 17, 2026
@IAlibay
Copy link
Member Author

IAlibay commented Jan 22, 2026

pre-commit.ci autofix

@IAlibay IAlibay changed the title [WIP] Add resume support to HybridTop simulation unit Add resume support to HybridTop simulation unit Jan 22, 2026
@IAlibay IAlibay marked this pull request as ready for review January 22, 2026 00:44
Comment on lines +1073 to +1075
or (system.getNumForces() != sampler_system.getNumForces())
or (system.getNumParticles() != sampler_system.getNumParticles())
or (system.getNumConstraints() != sampler_system.getNumConstraints())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this check but could we go even further and check more things, like comparing the seralised xmls of the systems that should compare every force and parameter in the system, assuming ordering is consistent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ordering is not consistent unfortunately - the thermodynamic state object adds/pops forces, which reorders things.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a particular edge case in mind here? I went for a lightweight check as purely as set of guardrails for our users - i.e. the likelihood of a clash like this is rather low.

trajectory = shared_path / output_settings.output_filename
checkpoint = shared_path / output_settings.checkpoint_storage_filename

if trajectory.is_file() and checkpoint.is_file():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check if there is anything in the files, what happens if they were made but are empty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's already handled by multisate reporter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To explain this a little bit more - in that case the reporter/sampler will fail saying it can't read the file.

One option would be to recover by turning off the restart and trying from scratch again in the unit, in practice the only way you could do that is by deleting files - which could be dangerous. Instead, given how rare this situation should be, the way I think it should recover is by executing a fresh version of the unit again, that will give you fresh new inputs that aren't likely corrupted without the problematic case of deleting files.

@github-actions
Copy link

🚨 API breaking changes detected! 🚨
View logs for this step

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.

Add resume suppport to HybridTopologyProtocol run unit

3 participants