Skip to content

Trust the embedded-dispersion modules the CPCM artifact needs - #115

Merged
isayev merged 2 commits into
mainfrom
fix/allowlist-dispersion-modules
Aug 7, 2026
Merged

Trust the embedded-dispersion modules the CPCM artifact needs#115
isayev merged 2 commits into
mainfrom
fix/allowlist-dispersion-modules

Conversation

@isayev

@isayev isayev commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Problem

The artifact trust boundary shipped with a default allowlist missing two first-party classes:

  • aimnet.modules.D3TS
  • aimnet.modules.lr.DispParam

Both are nn.Module subclasses defined in aimnet/modules/lr.py. The shipped CPCM(water) solvation artifact references both, so it stopped loading:

ValueError: Invalid v2 artifact field 'model_yaml':
Untrusted import path for 'class': 'aimnet.modules.lr.DispParam'

Why it was not caught sooner

Nothing loads the solvation model until it is actually needed, so this does not surface at import or at startup. It surfaced as a multi-hour production run aborting partway, with every GPU worker raising on that model after having already completed all of its gas-phase work.

Both classes, not just the one in the message

The two entries were enumerated from the artifact's own model_yaml, not from the exception text. Fixing only DispParam — the class the error names — leaves D3TS to fail on the very next load.

Verification

With this change the CPCM model loads and computes: a water optimization under optimize_and_thermo converges to a finite energy on an L40S. Without it, the same call fails at load.

New tests assert membership in the allowlist and that each entry resolves to a real nn.Module, since an entry that does not resolve would trade a load failure for an import error.

Full suite: 160 passed.

isayev added 2 commits August 6, 2026 19:00
The artifact trust boundary shipped with a default allowlist missing two
first-party classes: aimnet.modules.D3TS and aimnet.modules.lr.DispParam,
both nn.Module subclasses defined in aimnet/modules/lr.py. The shipped
CPCM(water) solvation artifact references both, so it stopped loading with

    ValueError: Invalid v2 artifact field 'model_yaml':
    Untrusted import path for 'class': 'aimnet.modules.lr.DispParam'

Nothing loads the solvation model until it is actually needed, so downstream
this did not surface as a startup error. It surfaced as a multi-hour
production run aborting partway with every GPU worker raising on that model,
having already completed all of its gas-phase work.

Both classes are enumerated from the artifact's own model_yaml rather than
from the error message: fixing only DispParam, the class the exception names,
leaves D3TS to fail on the next load.

Tests assert membership and that each entry resolves to a real nn.Module --
an allowlist entry that does not resolve would trade a load failure for an
import error.
test_allowed_model_import_paths_are_shared_and_immutable asserts the EXACT
contents of ALLOWED_MODEL_IMPORT_PATHS, so adding the two embedded-dispersion
entries broke it. Update the pin.

The pre-existing state of this file is itself the argument for the change:
_FROZEN_CLASS_PATHS already listed aimnet.modules.D3TS, under a comment saying
those are paths released checkpoints reference. So the serialization ABI knew
D3TS was load-bearing while the runtime trust allowlist did not, and that
inconsistency is exactly what stopped the shipped CPCM(water) artifact
loading.

aimnet.modules.lr.DispParam joins _FROZEN_CLASS_PATHS for the same reason
D3TS is already there: a released artifact references it, so it is ABI, and
test_frozen_class_path_resolves now covers it.
@isayev
isayev merged commit f37026a into main Aug 7, 2026
20 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.

1 participant