Perlin worms with chunks

Hi there,

I’ve, as usual, stumbled into another problem for my game.
So let’s say we have made a perlin worm algorithm. This is what it would look like:

This is just a drawing of course. You would have to add code for splitting worms.
But in my game all of the blocks aren’t in just one global table. If it were it would be super easy to generate these worms. My game uses chunks so i can’t do that.

Here’s the problem:
If you were to generate these worms on a per-chunk basis, you would have worms cut off and not continue into other chunks.

The blue lines are the dividors between the chunks. As you can see all of the worms that go into other chunks get cut off there. Now people have already tackled this situation before but here’s the kicker:
It needs to be relatively performant. I can’t for example check every chunk and continue the worms coming from those chunks.

Ideally I would not have to use an outside script (one that for example manages all chunks) to generate the worms on the ““outside””. This would be hacky and would not work with my future planned terrain generation system. Chunk objects can’t influence eachother.

I appreciate any help!!