Skip to content

Simulate one wasm artifact three ways - #332

Merged
sjoelund merged 1 commit into
masterfrom
feature/wasm-jit-artifact-runners
Aug 25, 2026
Merged

Simulate one wasm artifact three ways#332
sjoelund merged 1 commit into
masterfrom
feature/wasm-jit-artifact-runners

Conversation

@sjoelund

Copy link
Copy Markdown
Member

--wasmjitrunner=sim,me,cs exports every model once as a wasm artifact and simulates that one artifact each of those ways, so a model is translated and compiled once however many runs it gets:

runner branch what runs
sim <branch> the simulation runtime inside the artifact
./test.py --branch=master-wasm-jit --wasmjitrunner=sim,me,cs \
          --extraflags='--simCodeTarget=wasm-jit' configs/...json
./report.py --branches="master-wasm-jit master-wasm-jit-me master-wasm-jit-cs"

It reuses the fan-out --fmisimulator already had -- one build, a result branch per runner, the build phase shared and the simulation and verification per runner -- so runnerNames in test.py and runners in testmodel.py stand for whichever of the two a job asked for. The two are mutually exclusive.

The runners live in configs/wasm-jit-runners.json, so adding a fourth is an entry there: simflags is what is appended to the model's simulation flags and branchSuffix overrides the -<name> it adds to the branch.

The build is buildModelFMU(..., fmuType="me_cs", version="3.0", platforms={"wasm"}) with --fmuDirectory=true, which writes the model kernel unzipped; omc links it against an adapter it compiled once into its cache, so nothing is packed, extracted or loaded per run. Each run reports what that cost in its .sim.

Jenkins

The wasm_jit job runs the three-way target: --nobuildmodel becomes --wasmjitrunner=sim,me,cs, and GITBRANCHES_WASM_JIT names the three branches it fills, so all-reports.py and all-plots.py cover them without further change. overview-wasm-jit.html was wasm-jit against master and is now the three faces against it, which is where they are worth comparing: they share an export, so only the simulation and the verification tell them apart.

Needs an omc with the wasm artifact support (OpenModelica feature/wasm-jit-artifact).

Assisted-by: Claude Opus 5 (1M context)

`--wasmjitrunner=sim,me,cs` exports every model once as a wasm artifact
and simulates that one artifact each of those ways, so a model is
translated and compiled once however many runs it gets:

| runner | branch | what runs |
| --- | --- | --- |
| `sim` | `<branch>` | the simulation runtime inside the artifact |
| `me` | `<branch>-me` | FMI 3.0 Model Exchange, omc integrating |
| `cs` | `<branch>-cs` | FMI 3.0 Co-Simulation, the artifact integrating |

```bash
./test.py --branch=master-wasm-jit --wasmjitrunner=sim,me,cs \
          --extraflags='--simCodeTarget=wasm-jit' configs/...json
./report.py --branches="master-wasm-jit master-wasm-jit-me master-wasm-jit-cs"
```

It reuses the fan-out `--fmisimulator` already had -- one build, a result
branch per runner, the build phase shared and the simulation and
verification per runner -- so `runnerNames` in test.py and `runners` in
testmodel.py stand for whichever of the two a job asked for. The two are
mutually exclusive.

The runners live in `configs/wasm-jit-runners.json`, so adding a fourth
is an entry there: `simflags` is what is appended to the model's
simulation flags and `branchSuffix` overrides the `-<name>` it adds to
the branch.

The build is `buildModelFMU(..., fmuType="me_cs", version="3.0",
platforms={"wasm"})` with `--fmuDirectory=true`, which writes the model
kernel unzipped; omc links it against an adapter it compiled once into
its cache, so nothing is packed, extracted or loaded per run. Each run
reports what that cost in its `.sim`.

## Jenkins

The `wasm_jit` job runs the three-way target: `--nobuildmodel` becomes
`--wasmjitrunner=sim,me,cs`, and `GITBRANCHES_WASM_JIT` names the three
branches it fills, so `all-reports.py` and `all-plots.py` cover them
without further change. `overview-wasm-jit.html` was `wasm-jit` against
master and is now the three faces against it, which is where they are
worth comparing: they share an export, so only the simulation and the
verification tell them apart.

Needs an omc with the wasm artifact support (OpenModelica
feature/wasm-jit-artifact).

Assisted-by: Claude Opus 5 (1M context)
@sjoelund
sjoelund enabled auto-merge (squash) August 25, 2026 18:16
@sjoelund
sjoelund merged commit acaa3da into master Aug 25, 2026
7 checks passed
@sjoelund
sjoelund deleted the feature/wasm-jit-artifact-runners branch August 25, 2026 18:31
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