Connect ENGINE_INFO to the engine registry, without moving it (item 5, final) - #165
Merged
Conversation
Item 5, last piece -- and a deliberate departure from what the design spec said to do. The spec proposed moving `ENGINE_INFO` into the registry entries as `info=`, collapsing the third parallel list into the other two. On reflection that is the wrong direction. `ENGINE_INFO` is presentation content -- descriptions, reference URLs, prose notes about which model suits which chemistry -- and `model_factory` is the engine layer. Pushing display strings down two layers to remove a duplication trades a checkable problem for a structural one, and `tests/test_layer_boundaries.py` exists to stop exactly that kind of drift downward. It would have passed the layer test, since the dependency direction is fine; it is the *content* that would be in the wrong place. What the move was for is the property, and the property does not require the move. The failure `ENGINE_INFO` allowed is silent in the worst direction: register an engine and forget the display entry, and it works perfectly while never appearing in `auto3d models list` or `models info`. A user cannot discover it and nothing says why. So the two lists stay where they belong and a test asserts they name the same set, in both directions -- an engine with no display metadata fails, and metadata for an engine that no longer exists fails too. Verified by mutation rather than by reading: registering `aimnet2-probe` without an entry, and adding a `GHOST` entry with no engine, each turn it red with the offending name. This closes item 5. Adding a model backend is one `register()` call plus its display entry, with a test that refuses to let you forget the second; adding an isomer backend is one `register()` call plus its construction branch. Suite: 1757 passed, 1 skipped, 70 deselected.
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.
Non-breaking, test-only. Suite: 1757 passed, 1 skipped, 70 deselected.
A deliberate departure from the design spec
The spec for the registry said to move
ENGINE_INFOinto the registry entriesas
info=, collapsing the third parallel list into the other two. Onreflection that is the wrong direction, and I did not do it.
ENGINE_INFOis presentation content — descriptions, reference URLs, prosenotes about which model suits which chemistry.
model_factoryis the enginelayer. Pushing display strings down two layers to remove a duplication trades a
checkable problem for a structural one.
Worth noting why the layer test wouldn't have caught it: the dependency
direction would have been fine, since the CLI reading from the engine layer
points downward. It is the content that would be in the wrong place, and no
mechanical check I have would say so.
The property, without the move
The failure
ENGINE_INFOallowed is silent in the worst direction: register anengine, forget the display entry, and it works perfectly while never appearing
in
auto3d models listormodels info. A user cannot discover it and nothingsays why.
That property doesn't require relocating anything. The two lists stay where they
belong and a test asserts they name the same set — in both directions, so an
engine with no metadata fails and metadata for a deleted engine fails.
Verified by mutation, not by reading: registering
aimnet2-probewithout anentry, and adding a
GHOSTentry with no engine, each turn it red naming theoffender.
Item 5 is closed
Adding a model backend is one
register()call plus its display entry, with atest that refuses to let you forget the second. Adding an isomer backend is one
register()call plus its construction branch — which stays explicit onpurpose, so an argument no engine reads can't survive unnoticed.
Entry-point discovery and a public
ModelAdapterremain out of scope, for thereasons in #162: Auto3D already accepts third-party models by path, and freezing
ModelAdapterwould blocknative_dtypefor D4.