[PCG] PCGWorldPartitionBuilder asserts on Invalid Original PCG Component

Hello,

We have recently seen scenarios where we are hitting an assert check(OriginalComponent) inside GenerateComponentFilter lambda in PCGWorldPartitionBuilder.cpp when Running per cell.

Here’s the callstack.

[2025.05.29-06.00.27:832][316]LogWindows: Error: === Critical error: ===

[2025.05.29-06.00.27:832][316]LogWindows: Error:

[2025.05.29-06.00.27:832][316]LogWindows: Error: Assertion failed: OriginalComponent [File:E:\dev\main\Engine\Plugins\PCG\Source\PCGEditor\Private\WorldPartitionBuilder\PCGWorldPartitionBuilder.cpp] [Line: 746]

[2025.05.29-06.00.27:833][316]LogWindows: Error:

[2025.05.29-06.00.27:833][316]LogWindows: Error:

[2025.05.29-06.00.27:833][316]LogWindows: Error:

[2025.05.29-06.00.27:833][316]LogWindows: Error: [Callstack] 0x00007ffce18098cd UnrealEditor-PCGEditor.dll!`UPCGWorldPartitionBuilder::RunPerCell’::`2’::<lambda_2>::operator()() [E:\dev\main\Engine\Plugins\PCG\Source\PCGEditor\Private\WorldPartitionBuilder\PCGWorldPartitionBuilder.cpp:746]

[2025.05.29-06.00.27:834][316]LogWindows: Error: [Callstack] 0x00007ffce180db13 UnrealEditor-PCGEditor.dll!FPCGWorldPartitionBuilder::CollectComponentsToGenerate() [E:\dev\main\Engine\Plugins\PCG\Source\PCGEditor\Private\WorldPartitionBuilder\PCGWorldPartitionBuilder.cpp:1648]

[2025.05.29-06.00.27:834][316]LogWindows: Error: [Callstack] 0x00007ffce182bdef UnrealEditor-PCGEditor.dll!UPCGWorldPartitionBuilder::RunPerCell() [E:\dev\main\Engine\Plugins\PCG\Source\PCGEditor\Private\WorldPartitionBuilder\PCGWorldPartitionBuilder.cpp:781]

[2025.05.29-06.00.27:835][316]LogWindows: Error: [Callstack] 0x00007ffce182bbc2 UnrealEditor-PCGEditor.dll!UPCGWorldPartitionBuilder::RunInternal() [E:\dev\main\Engine\Plugins\PCG\Source\PCGEditor\Private\WorldPartitionBuilder\PCGWorldPartitionBuilder.cpp:542]

[2025.05.29-06.00.27:836][316]LogWindows: Error: [Callstack] 0x00007ffd397f7b9c UnrealEditor-UnrealEd.dll!UWorldPartitionBuilder::RunInternal() [E:\dev\main\Engine\Source\Editor\UnrealEd\Private\WorldPartition\WorldPartitionBuilder.cpp:291]

[2025.05.29-06.00.27:836][316]LogWindows: Error: [Callstack] 0x00007ffd397f6ad4 UnrealEditor-UnrealEd.dll!UWorldPartitionBuilder::RunBuilder() [E:\dev\main\Engine\Source\Editor\UnrealEd\Private\WorldPartition\WorldPartitionBuilder.cpp:123]

Since we are frequently deleting the Source actors that have the Original PCG Components (which are partitioned, of course), we did expect a scenario where there will be dead references in PCG Partition Actors for LocalToOriginal and OriginalToLocal maps. But I expected that the call to APCGPartitionActor::CleanupDeadGraphInstances made from PCGWorldPartitionBuilder::UpdatePartitionedActors should suffice to clean up the maps.

Yet, something is leading to a mismatch between the way PCG Partition Actors are picked to be updated in UpdatePartitionedActors , and then how the PCG Components are picked for generation immediately.

My questions:

  1. Is there a known scenario where a dead Original Component reference is expected to remain in the PCG Partition Actor even after CleanupDeadGraphInstances is called?
  2. If no, where do we think the mismatch could be between…
    1. Picking up the Partition Actors to clean up and
    2. PCG Components to generate?

Note : We are Generating Iteratively so it’s happening inside RunPerCell where the builder is loading regions as it decides what to generate.

Without having a consistent repro for this, I am inclined towards fixing it the way shown in the screenshot, which doesn’t seem perfect but should handle it gracefully. Can I get an opinion on this?

Regards,

Vaishvik

Hi Vaishvik,

What do you mean by you are frequently deleting Source acotrs that have the Original PCG Components? Are you saying users do that while editing map?

Do you have Partitioned graphs inside Level Instances? it would be the only way for the CleanupDeadGraphInstancesInternal call inside FPCGWorldPartitionBuilder::UpdatePartitionedActors not being called.

I would try to understand why the prior call to CleanupDeadGraphInstancesInternal is not enough.

Cheers,

Patrick

Hi Patrick!

While the users can delete the original components, I was rather referring to another pipeline we use to scatter splines and volumes, and we attach PCG Components to these outputs. So the output actors of previous pipeline act as the inputs for PCG Pipeline. Due to the nature of actor management of this pipeline, I am assuming there would be plenty of dead links inside partition actors.

Interesting, I will look for LIs containing Partitioned Graphs, I will get back to you on this. If this is the case, is there a reason for not calling CleanupDeadGraphInstancesInternal? What would be a workaround, if there is?

Regards,

Vaishvik

Hey Vaishvik,

Level Instances containing Partitioned PCG Components aren’t properly supported yet so I would suggest not using this workflow if that is the case.

Internally we do use Level Instances but our approach is to generate “preview” data on the PCG Components located inside LIs and have parent Partitioned PCG Volume in the main map that gathers this preview data and outputs persistent data in the main map.

We do plan to add more support to Partitioned Level Instances at some point but even then with the builder those maps would still need to be generated on their own. The Builder currently will not generate data in multiple maps at the same time.

Cheers,

Patrick