You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent use of mapped SMILES breaks internal consistency assumptions #206
This error crops up from deep in Parsl compute graphs, working on a slimmer reproduction:
1792498085.267638 2026-10-20 07:08:05 MainProcess-95220 HTEX-Result-Queue-Thread-13754871808 parsl.dataflow.dflow:390 handle_exec_update ERROR: Task 41 failed after 0 retry attempts
Traceback (most recent call last):
File "/Users/mattthompson/software/tyff/.pixi/envs/dev/lib/python3.12/site-packages/parsl/dataflow/dflow.py", line 348, in handle_exec_update
res = self._unwrap_remote_exception_wrapper(future)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mattthompson/software/tyff/.pixi/envs/dev/lib/python3.12/site-packages/parsl/dataflow/dflow.py", line 578, in _unwrap_remote_exception_wrapper
result.reraise()
File "/Users/mattthompson/software/tyff/.pixi/envs/dev/lib/python3.12/site-packages/parsl/app/errors.py", line 114, in reraise
raise v
File "/Users/mattthompson/software/tyff/.pixi/envs/dev/lib/python3.12/site-packages/parsl/app/errors.py", line 138, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^
File "/Users/mattthompson/software/tyff/tyff/compute/apps.py", line 95, in create_jacobian
return _get_ensemble_average_and_jacobian(
^^^^^^^^^^^^^^^^^
File "/Users/mattthompson/software/tyff/tyff/compute/_jacobian.py", line 130, in _get_ensemble_average_and_jacobian
worker_force_field = _gather_from_reference(local_force_field, reference_worker_force_field)
^^^^^^^^^^^^^^^^^
File "/Users/mattthompson/software/tyff/tyff/compute/_jacobian.py", line 28, in _gather_from_reference
idx = torch.tensor([ref_idx[key] for key in potential.parameter_keys]) # KeyError: unseen parameter
^^^^^^^^^^^^^^^^^
KeyError: PotentialKey associated with handler 'NAGLChargesHandler' with id '[H:11][c:5]1[c:4]([c:3]([c:2]([c:1]([c:6]1[H:12])[H:7])[H:8])[H:9])[H:10]', mult 0
It's possible that it stems from different mapped SMILES being generated by a given molecule (#191)
This doesn't trigger when calling _gather_from_reference on identical force fields
I'm able to pinpoint it to chemically equivalent SMILES being written slightly differently at some point, but the provenance of how these two strings got onto my local files is lost to the sands of time. I don't think I can easily pin it to OEChem vs. RDKit differences:
Okay so it's probably not OECHem vs. RDKit differences or Isomeric vs. non-isomeric SMILES (via the toolkit), but I do notice that the map_smiles function in this project produces a different string:
This difference is relevant because openff.interchange.models.PotentialKey has its .id attribute set (as a simple Python string) by a separate Molecule.to_smiles call. That should all be self-consistent, but we cannot assume that the result of tyff.utils.molecule.map_smiles (or other to_smiles calls1) will produce identical strings:
It'll take me a second to find where this mismatch happens, but I think it's likely to be somewhere inside of tyff
Footnotes
Molecule.from_mapped_smiles(...).to_smiles(mapped=True) returning something different than the input took me by surprise before thinking about it - I'm pretty sure that strings being character-for-character equivalent through the toolkit isn't a reasonable expectation ↩
changed the title [-]`gather_from_reference` chokes with `NAGLChargesHandler`[/-][+]Inconsistent use of mapped SMILES breaks internal consistency assumptions[/+]on Oct 20, 2026
Activity
mattwthompson commentedon Oct 20, 2026
This doesn't trigger when calling
_gather_from_referenceon identical force fieldsI'm able to pinpoint it to chemically equivalent SMILES being written slightly differently at some point, but the provenance of how these two strings got onto my local files is lost to the sands of time. I don't think I can easily pin it to OEChem vs. RDKit differences:
mattwthompson commentedon Oct 20, 2026
Okay so it's probably not OECHem vs. RDKit differences or Isomeric vs. non-isomeric SMILES (via the toolkit), but I do notice that the
map_smilesfunction in this project produces a different string:This difference is relevant because
openff.interchange.models.PotentialKeyhas its.idattribute set (as a simple Python string) by a separateMolecule.to_smilescall. That should all be self-consistent, but we cannot assume that the result oftyff.utils.molecule.map_smiles(or otherto_smilescalls1) will produce identical strings:It'll take me a second to find where this mismatch happens, but I think it's likely to be somewhere inside of
tyffFootnotes
Molecule.from_mapped_smiles(...).to_smiles(mapped=True)returning something different than the input took me by surprise before thinking about it - I'm pretty sure that strings being character-for-character equivalent through the toolkit isn't a reasonable expectation ↩[-]`gather_from_reference` chokes with `NAGLChargesHandler`[/-][+]Inconsistent use of mapped SMILES breaks internal consistency assumptions[/+]mattwthompson commentedon Oct 20, 2026
I fixed this somewhere in #190