Skip to content

Derive scientific model version from plant#3

Merged
dfalster merged 2 commits into
mainfrom
feature/scientific-model-version
Jul 10, 2026
Merged

Derive scientific model version from plant#3
dfalster merged 2 commits into
mainfrom
feature/scientific-model-version

Conversation

@dfalster

@dfalster dfalster commented Jul 9, 2026

Copy link
Copy Markdown
Member

Resolves #4

Context

logpile content-addresses simulations by the SHA-256 fingerprint of their resolved inputs, and model_id ("FF16@v1") is one of those inputs. Until now the @vN scientific version was hand-typed on the logpile side, and the plant package version was recorded only as inert build_hash metadata that never triggered a rerun — so a behavioural plant change silently produced stale cache hits (the known gotcha in AGENTS.md).

Depends on traitecoevo/plant#560, which adds plant::model_version() / plant::model_id().

What this changes

  • resolve_request() now re-derives the model's scientific version from plant::model_version() rather than trusting the request's @vN. The authoritative version flows into the fingerprint, so:
    • a plant scientific-version bump changes the fingerprint → reruns happen;
    • a software-only plant release leaves it untouched → cached results are reused.
  • parse_model_id() now accepts a bare model name ("FF16"), a full id ("FF16@v1"), or a compound version ("TF24f@v2.1", since TF24f is a fast approximation of TF24). The version is handled as a string.
  • A mismatch guard: a pinned version that disagrees with the installed plant is a hard error, not a silent stale hit.
  • Bare and matching-pinned ids resolve identically, so existing archives stay valid (FF16 and FF16@v1 produce the same fingerprint).
  • AGENTS.md gotcha updated to reflect the new behaviour.

Verification

  • Full suite: 225 pass, 0 fail (1 pre-existing deferred-driver skip), with plant #560 installed.
  • Confirmed: bare/pinned/default all resolve to FF16@v1; bare and pinned fingerprints identical; FF16@v99 errors; bumping the resolved version changes the fingerprint.

🤖 Generated with Claude Code

resolve_request() now re-derives the model_id's scientific version from
plant::model_version() instead of trusting the hand-typed "@vn". The scientific
version flows into the request fingerprint, so a plant scientific-version bump
changes the fingerprint and forces reruns, while a software-only plant release
leaves it untouched and cached results are reused.

Callers may pass a bare model name ("FF16") or a full id ("FF16@v1");
parse_model_id() accepts both. A pinned version that disagrees with the
installed plant is a hard error rather than a silent stale cache hit. Bare and
matching-pinned ids resolve identically, so existing archives stay valid.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
parse_model_id() now returns the version as a string and accepts compound,
dot-separated versions (e.g. "TF24f@v2.1"), since TF24f is a fast approximation
of TF24 and plant reports its version as "<TF24 version>.<revision>". The
mismatch guard in resolve_request() compares version strings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dfalster
dfalster merged commit cf8c6ff into main Jul 10, 2026
@dfalster
dfalster deleted the feature/scientific-model-version branch July 10, 2026 00:56
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.

Invalidate cache on scientific model changes, not software releases

1 participant