Add wasm-jit testing - #289
Merged
Merged
Conversation
wasm-jit generates neither a makefile nor an executable; the model is JIT-compiled inside the omc that translated it. Detect the target from the customCommands (so `--extraflags` selects it), skip the build step and simulate with `simulate(..., resimulateExecutable=...)` in that same session instead of running an executable that does not exist. Two things turned a failure into a hang rather than a reported error: - `writeResultAndExit` called the builtin `quit()` instead of `quit_omc()`, so `SystemExit` was raised before `os._exit()` and the interpreter then waited forever for a thread stuck in a ZMQ receive. - `sendExpressionTimeout` only joined that thread with a timeout, so an omc that died mid-command was not noticed until the full `ulimitOmc` had elapsed. It now polls the process and exits as soon as it dies. The C path checks that the executable exists before running it. The default 8 GB virtual memory limit is too small for wasm-jit: omc peaks at ~5.8 GB and the JIT then reserves 4 GB of address space for the wasm memory, so every simulation failed with `mmap failed to reserve 0x104000000 bytes`. Use 16 GB for that target. Also adds the experimental wasm-jit regression job to the Jenkinsfile. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The wasm-jit target JIT-compiles the model inside omc, and the test tool ran `translateModel` followed by `simulate(resimulateExecutable=)`. That path never calls `buildModel`, so `timeCompile` is not measured and the compile lands in the simulation time instead — reported as a build time of 0 and a correspondingly inflated `sim`. `--nobuildmodel` translates, builds and runs in a single `simulate()` call, which reports the phase times itself, and takes the build and simulation times from that record rather than the wall clock around the command. For VehicleInterfaces the same run splits as: | Flag | build | sim | |-------------------|---------|---------| | (none) | 0.00000 | 0.44668 | | `--nobuildmodel` | 0.21299 | 0.21309 | `--coldhot` simulates each model twice in the same omc. The second run reuses the module compiled for the first, so it is the hot number; both are printed but only the hot one is stored, since the database columns are enumerated in the insert. Both flags only apply to `simCodeTarget=wasm-jit`, and only set their config key when passed, so the confighash — and therefore the stored history — of a normal run is unchanged. `runRegressiontest` gains a `testFlags` argument, passed to `test.py` verbatim; the wasm-jit job uses it for `--nobuildmodel`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
No description provided.