lingua-franca
lingua-franca copied to clipboard
After delays on pass through connections are rendered incorrectly
The following minimal program uses a connection to parr outputs from its contained reactor through:
target Cpp;
reactor Src {
output out: void
}
reactor Wrapper {
src = new Src()
output out: void
src.out -> out after 0
}
main reactor {
x = new Wrapper()
}
This program produces the following diagram:
Notice that the after delay is rendered in the wrong place outside the Wrapper reactor. This also happens if a delay is specified or if we use a physical connection.
@cmnrd This seems to be solved.
Are there any special settings to replicate the problem?
I just happened to run into this issue again using the nightly build of VS Code. Which version did you use?
The following program
target Python
reactor Foo {
input inp
output out
reaction(inp) -> out {==}
}
reactor Bar {
foo = new Foo()
input inp
output out
inp -> foo.inp after 1ms
foo.out -> out after 5ms
}
reactor Baz {
foo = new Bar()
input inp
output out
inp -> foo.inp after 1ms
foo.out -> out
}
produces this diagram
AFAIK, I don't have any special settings. I also played around with different settings, but nothing changed with respect to this issue.
The rendering of physical pass-through connections is also affected by this bug.
I keep stumbling across this issue. For me, it does not matter which synthesis and layout options I use. @soerendomroes, @a-sr do you have any idea what could be causing this? Is this likely to be an issue in the LF diagram synthesis, or is this rather a problem in the layout algorithm? If it is in the LF diagram synthesis, I am happy to try to investigate this myself, but I would need some pointers on where to start.
This is a problem in ELK https://github.com/eclipse/elk/issues/953
A workaround would be to disable the disconnected component compaction. I am however sure that this will produce other undesired layouts.
Thanks for the pointer! I noticed that this is part of the "Release 0.9.1" milestone in ELK. Is there an expected time horizon for this release and for fixing the issue?
There is no real horizon for this release, probably next year. But if you just need a picture for your thesis I can create that picture for you or at some point point you to a branch where this is fixed. You can also try to disable the compaction by setting org.eclipse.elk.layered.compaction.connectedComponents
to false or by setting org.eclipse.elk.separateConnectedComponents
to false and see if that helps.
Thanks for the offer, but I already used Inkscape to fix the diagrams for display in my thesis ;). I think this issue will come up more often when we promote the enclave feature, as wrapping a reactor and passing through connections with a delay or with physical connections is a common pattern.
Also thanks for the pointers to the concrete settings. I will try this once I finished my thesis (hopefully very soon). Perhaps it makes sense for us to expose this setting as part of the LF layout options in the IDE to give users access to the workaround.