Skip to content

feat(native): vcml_regenerate_math, VCell's forced upgrade per application (0.0.25) - #32

Merged
jcschaff merged 4 commits into
mainfrom
feat/regenerate-math
Nov 6, 2026
Merged

jcschaff merged 4 commits into
mainfrom
feat/regenerate-math

Conversation

@jcschaff

@jcschaff jcschaff commented Nov 6, 2026

Copy link
Copy Markdown
Member

What

A new entry point, vcmlRegenerateMath, exposed in Python as vcml_regenerate_math(vcml_content, vcml_file_path). It returns (success, message, MathRegeneration | None).

  • Forced upgrade. It runs VCell's SimulationContext.updateAll(true) on each application. For an old non-spatial application with no absolute structure size, the StructureSizeSolver solves the sizes from its surface-to-volume ratios and volume fractions and writes them into the structure mappings. The model's first structure is anchored at 1, and the sizes stay symbolic over the ratios.
  • Per application. Each application is regenerated on its own. MathRegeneration lists the applications regenerated and, for each failure, the reason. A failed application keeps its stored math.
  • vcml_to_vcml is unchanged. It runs BioModel.updateAll(false). That generates the same math, but it leaves a ratio-only application's mappings unsized, and one failing application aborts the whole document.

Why

vcell-core's math oracle compares its own ODE generation against VCell's math. The math a corpus document stores is the math it was last saved with, often from an old generator and sometimes stale. This lets the oracle compare against what current VCell generates instead.

Tests

  • Java. test_vcml_regenerate_math_solves_relative_sizes uses a pre-5.3 public biomodel, 2264899, with ratios only. ER is anchored at 1, cyto solves to 4 and ERMem to 1. The test also pins that the unforced path generates the same math but leaves the mappings unsized.
  • Python. test_vcml_regenerate_math checks the same fixture through the native library. It is skipped when the library predates the symbol.
  • Recorder. MainRecorder exercises the new path, so native-image records its configuration.

Local results: make check passes, pytest 27 passed with 4 skipped for the missing ODE solver package, and mvn -o test passes all 43 tests on the rebuilt macOS native library.

🤖 Generated with Claude Code

jcschaff and others added 4 commits November 6, 2026 06:43
…ation

vcml_to_vcml runs BioModel.updateAll(false): it regenerates every
application's math, but leaves an old ratio-only application's structure
mappings without sizes, and one failing application aborts the document.
vcml_regenerate_math runs SimulationContext.updateAll(true) on each
application on its own: the StructureSizeSolver writes the solved sizes
into the mappings, and the result (MathRegeneration) lists the
applications regenerated and the reason each failed one failed. Its use:
comparing another math generator against the math current VCell
generates rather than the math a document was last saved with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cause

Regenerating the corpus with vcml_regenerate_math found 129 rule-based
applications failing in the native library with "Supplier failed" that
the JVM regenerates: network generation compares species graphs with
JGraphT, which constructs SpeciesGraphIsomorphismInspector$BNGEdge
reflectively, and the recorder's models never reach that path. The
constructor is registered in a checked-in reachability file
(src/main/native-image/bionetgen), and a corpus model that needs it is a
Python regression fixture. A failed application's reason now carries its
root cause's type and message, and the stack trace is logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
virtualcell/vcell#2205 repairs duplicate membrane voltage names at load,
so vcml_regenerate_math now regenerates the 136 public corpus documents
(556 applications) current VCell used to refuse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jcschaff
jcschaff merged commit 788b2cc into main Nov 6, 2026
5 checks passed
@jcschaff
jcschaff deleted the feat/regenerate-math branch November 6, 2026 16:28
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