Syside 1.0.2: exporting a view as textual notation, and viz view on a large project

Hello,

We build large SysML v2 models with Syside and use views as the artifacts we exchange and review. Two points came up.

1. Exporting a view as textual notation. As far as we can tell, the CLI renders diagrams through viz and tables through grid export, but does nothing with Views::asTextualNotation. We would like an export that evaluates a view’s exposes and filters and writes the selected elements as textual notation to a file.

Our use case is frozen evidence: when a view is reviewed and approved, we want to keep a readable text record of exactly what the reviewer saw, generated from the tagged commit. The ModelPrinter in the Python API prints models, but we would still have to compute each view’s selection ourselves. Is this on your roadmap, or is there a supported way to get a view’s evaluated selection and print it?

2. syside viz view does not finish on our project. On 1.0.2 with --allow-errors, on a project of about 240 SysML files plus libraries, requesting a single view by qualified name had not finished after 560 seconds. That view exposes one element. One of our library packages loaded on its own renders comparable views in 5 to 47 seconds, the slowest with a recursive expose and about 11,000 text elements.

We don’t know whether the cause is the project’s size, the errors it still contains (--allow-errors), or something in how our views are built. Could you tell us what to look at, or which diagnostics would help you? We can share timings. It matters to us because rendering is our way of checking what a view really selects.

Thank you,
Hugo

A follow-up with new timings on the second point, Syside 1.0.2, --allow-errors, same project (about 240 files plus libraries).

A single view requested by qualified name now finishes, in about 6 to 7 minutes (6:12 and 6:46 in two runs of different views). My earlier report of no result after 560 seconds came from a run a day or so ago. I can’t say what changed: this time I passed -r tree and --config, and the model has changed a little since.

Two observations that may help:

  • A run of 8 views by name finished in under 10 minutes, while other runs were going in parallel, so the time looks mostly fixed rather than per view.
  • With a single view requested, the log still warns about the render style of many other views in the project. That suggests all views are processed even when -n names one.

So my question is now about speed rather than a hang: is there a way to avoid that fixed cost when rendering a few named views? I can share timings for other flag combinations if useful.

Hi, Hugo,

You are correct that there is no CLI command for this. However, using the Python API, you can:

  1. find your Views that are asTextualNotation,
  2. get a list of exposed elements through syside.ViewUsage.exposed_elements,
  3. pass elements from that list through syside.vm.Compiler’s evaluate_filter() (filters live in syside.ViewUsage.view_conditions)
  4. pass the elements that go through the filters into syside.pprint() which would then create textual notation for those elements.

Please note that the textual notation will likely not be a valid SysMLv2 model, as such element textual notation snippets may contain references to other model elements that are not part of the snippet. For example, consider the following model:

package MyModel {
    part def Motor;

    part def Vehicle {
      part motor : Motor;
  }
}

If you were to syside.pprint() only the “Vehicle” element, the output will be:

part def Vehicle {
    part motor : Motor;
}

which will not be a legal model, since there is no definition Motor in the snippet and thus if you were to open it in Syside in isolation, you’d see an error on that part.

I will look into whether and when we could have such functionality available without needing to write your own Python scripts.

Hi Hugo,

Thanks for reporting.

  1. syside viz view does not finish on our project. On 1.0.2 with --allow-errors, on a project of about 240 SysML files plus libraries, requesting a single view by qualified name had not finished after 560 seconds. That view exposes one element. One of our library packages loaded on its own renders comparable views in 5 to 47 seconds, the slowest with a recursive expose and about 11,000 text elements.

I agree that currently it can be misleading and hard to tell whether renders are frozen, crashed, or progressing. We plan to add progress indicators to provide better feedback on the state.

A single view requested by qualified name now finishes, in about 6 to 7 minutes (6:12 and 6:46 in two runs of different views). My earlier report of no result after 560 seconds came from a run a day or so ago. I can’t say what changed: this time I passed -r tree and --config, and the model has changed a little since.

I am not sure if it’s applicable to your case, but we found an issue where model views with lots of filters caused a noticeable delay. A fix will be included in the upcoming v1.1.0 release.

Two observations that may help:

  • A run of 8 views by name finished in under 10 minutes, while other runs were going in parallel, so the time looks mostly fixed rather than per view.
  • With a single view requested, the log still warns about the render style of many other views in the project. That suggests all views are processed even when -n names one.

Each run pays a one-off cost for loading the model, regardless of how many views are rendered, plus a cost per rendered view. On a large project, the model loading can dominate.

The warnings check the view declarations across the whole model, so they show up regardless of what is being rendered.

So my question is now about speed rather than a hang: is there a way to avoid that fixed cost when rendering a few named views? I can share timings for other flag combinations if useful.

To avoid reloading the model repeatedly, you can request multiple views in a single run by repeating the -n parameter:

syside viz view <paths> -n viewA -n viewB -n viewC

Also, passing only the model files needed by the named views would shorten the load time.


More broadly, we are working on both model loading and rendering performance, including parallel view generation. This should help with the performance issues you are facing today.

Best,
Simas