sbmlsim-core 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,7 +20,7 @@ npm install sbmlsim-core
20
20
  or import the modules from a CDN, which serves them with the headers every origin may read:
21
21
 
22
22
  ```js
23
- import { createPanelEndpoint } from "https://cdn.jsdelivr.net/npm/sbmlsim-core@0.10.0/panels.mjs";
23
+ import { createPanelEndpoint } from "https://cdn.jsdelivr.net/npm/sbmlsim-core@0.11.0/panels.mjs";
24
24
  ```
25
25
 
26
26
  A pool started from a module of another origin starts its workers through a module of the page's own origin, so the CDN works for the workers as well. The engine needs fixed-width SIMD of WebAssembly: Chrome 91, Firefox 89, Safari 16.4 or newer, Node 20 or newer.
@@ -86,7 +86,7 @@ pool.close();
86
86
  <!-- the IIFE build of sbmlsim-web, a release with registerEndpoint -->
87
87
  <script src="sbmlsim-web.iife.js"></script>
88
88
  <script type="module">
89
- import { createPanelEndpoint } from "https://cdn.jsdelivr.net/npm/sbmlsim-core@0.10.0/panels.mjs";
89
+ import { createPanelEndpoint } from "https://cdn.jsdelivr.net/npm/sbmlsim-core@0.11.0/panels.mjs";
90
90
 
91
91
  sbmlsimWeb.registerEndpoint(
92
92
  "local:glimepiride",
package/loader.mjs CHANGED
@@ -49,7 +49,7 @@ export const MAX_MEMORY_PAGES = 32768;
49
49
  export const ENGINE_SECTION = "sbmlsim.engine";
50
50
 
51
51
  /** The version of the output of `engine.wasm` this loader reads (`ENGINE_OUTPUT_FORMAT`). */
52
- export const ENGINE_OUTPUT_FORMAT = 1;
52
+ export const ENGINE_OUTPUT_FORMAT = 2;
53
53
 
54
54
  const WASI = "wasi_snapshot_preview1";
55
55
 
@@ -81,6 +81,11 @@ export const STATS_NAMES = [
81
81
  "integrations",
82
82
  "probe_rhs_evals",
83
83
  "steady_state_rhs_evals",
84
+ "linear_iterations",
85
+ "linear_convergence_failures",
86
+ "jacobian_vector_evals",
87
+ "preconditioner_evals",
88
+ "preconditioner_solves",
84
89
  ];
85
90
 
86
91
  const LITTLE_ENDIAN = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
@@ -380,6 +385,17 @@ export async function createRuntime({
380
385
  }
381
386
  if (!(modelWasm instanceof WebAssembly.Module)) validateModelBytes(modelWasm);
382
387
  const modelModule = await toModule(modelWasm, "model.wasm");
388
+ const history = WebAssembly.Module.customSections(modelModule, "sbmlsim.history");
389
+ const nDelays = desc.n_delays ?? 0;
390
+ if (history.length > 1 || (history.length === 0 && nDelays !== 0)) {
391
+ throw new Error("model.wasm history sites differ from its description");
392
+ }
393
+ if (history.length === 1) {
394
+ const info = new DataView(history[0]);
395
+ if (info.byteLength !== 8 || info.getUint32(0, true) !== 1 || info.getUint32(4, true) !== nDelays) {
396
+ throw new Error("model.wasm history metadata differs from its description");
397
+ }
398
+ }
383
399
  checkModel(modelModule, mathlibModule);
384
400
  const memory = new WebAssembly.Memory({ initial: minimum, maximum: maxMemoryPages });
385
401
  const wasi = wasiImports(engineModule, () => memory, out);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbmlsim-core",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Simulate SBML models compiled to WebAssembly in browsers and Node: the JavaScript host of sbmlsim-core with its engine (CVODE, KLU), a pool of workers and the panel endpoint of sbmlsim",
5
5
  "keywords": [
6
6
  "sbml",
package/panels.mjs CHANGED
@@ -58,7 +58,7 @@ import { EngineError } from "./loader.mjs";
58
58
  import { createPool, defaultWorkers } from "./pool.mjs";
59
59
 
60
60
  /** The version of sbmlsim-core (`js/package.json`), which the provenance of a run names. */
61
- export const CORE_VERSION = "0.10.0";
61
+ export const CORE_VERSION = "0.11.0";
62
62
 
63
63
  /** The engine a provenance names. */
64
64
  export const ENGINE = `sbmlsim-core ${CORE_VERSION}`;
Binary file
Binary file