SOUL problem with end point array

I have code a SOUL processor called “junction” which, in general, has N input/output pairs representing ports. I set up my ports as end point arrays: input stream float inPort[numPorts]; output stream float outPorts[numPorts]; For some connections, I get the following error message:

Compiler Error: : - Command failed: soul generate --wasm --output=temp/0c0e583d32c2ef1c4915c1002d52d5e7-54ed4bcf-2348-4d74-a629-7267aa793963/out.wasm temp/0c0e583d32c2ef1c4915c1002d52d5e7-54ed4bcf-2348-4d74-a629-7267aa793963/foo.soulpatch Building: /usr/src/app/temp/0c0e583d32c2ef1c4915c1002d52d5e7-54ed4bcf-2348-4d74-a629-7267aa793963/foo.soulpatch error: Internal compiler error: ““source->getType().isIdentical (targetType)” failed at getSumOfOutputNodeInputs:955” Failed to generate wasm

If I replace some, but not necessarily all, of my junctions with fixed-size versions (e.g., junction3() instead of junction(3)), the problem goes away. I checked to make sure all of my streams are declared the same way and triple-checked the connections.

I can provide more code if that will help, but I wanted to keep my first query brief.

By a process of elimination, this seems to be the offending code:

junction_0.outPort[0],
junction_4.outPort[2] -> audioOut;

All three end points are declared output stream float

As noted before, if I replace junction_0 and junction_4 with another version that is fixed at 4 ports and does not use end point arrays, it works. Also, there is no problem with junctions that do not connect with audioOut.

Note also that the offending code is part of a graph and audioOut is an end point of the graph.

It’s really hard to know how to tackle a report like that without being able to see what you’re actually doing… can you create a code snippet on soul.dev that goes wrong and post the link for us to try?

Agreed, a sample would be handy. I can guess the sort of area to investigate (and i’m not totally surprised there are edge cases there) but an example would be perfect. The simpler the better!

Thanks. I will endeavor to reduce the code to a small example that illustrates what works and what doesn’t. Stay tuned!

I put together a reduced version that yields the same error message. I’m not sure how to post the code, but you might find it at https://soul.dev/lab/?id=acb8e8ea488207214383218ef1237186.

That’s perfect - thanks, we can easily debug it from that!