[PCG] PCG World Builder commandlet stalls on Pending Compilation of PCG HLSL Shader Nodes

Hello hello!

For a few of the PCG Graphs, we rely on HLSL nodes and they rely on ComputeFramework for compiling the shaders for it.

While upgrading to UE 5.6, we noticed that the PCG Builder Commandlet keeps spamming the following message and never finishes. (This was not happening with 5.5)

LogPCG: Verbose: Deferring until next frame as the kernel has pending shader compilations

After following through on this, it seems that the Custom_HLSL_PCGCustomHLSLKernel node created for a given HLSL node failed to load from a DDC, and hence it tried to recompile during generation.

[2025.07.23-01.59.32:303][ 8]LogComputeFramework: Loading shader for kernel <CustomPCGGraph>/Custom_HLSL_PCGCustomHLSLKernel from DDC failed. Shader needs recompile.

[2025.07.23-01.59.32:304][ 8]LogComputeFramework: Missing cached shader map for kernel <CustomPCGGraph>/Custom_HLSL_PCGCustomHLSLKernel, compiling.

While PCG Builder calls WaitForAllAsyncEditorProcesses before generating components, since the shader compilation started during the generation, it did not try to finish compilation for the shader compilation job as it would have within WaitForAllAsyncEditorProcesses.

I wanted your opinion on

  1. Whether there’s something we are missing to set in HLSL node for this
  2. A fix I just tried, which is to call FAssetCompilingManager::Get().FinishAllCompilation(); within WaitForComponentGeneration lambda before it does FakeEngineTick. This makes sure it does a blocking call for compiling all remaining compile jobs. Looking at FinishAllCompilation by multiple types of Compilation Managers, I wonder if this is something we should do before ticking while generating for PCG Components.

Regards,

Vaishvik

Steps to Reproduce

Hi Vaishvik, thanks for reaching out.

I’ll pass this along to our team members that would be best for this.

Cheers,

Julien

Hi Vaishvik, sorry for taking a bit of time, but some of our team members are out this week.

I’ve had a chat, and your approach/fix seems reasonable; we’ll fix it for the next release!

Thanks,

Julien

Hey Vaishvik,

Sorry for the delayed answer. I’ve managed to repro and the fix I have is a bit different and would like to validate with you if this fixes your issue.

Instead of adding the FAssetCompilingManager::Get().FinishAllCompilation() in the builder code.

We have 2 code paths that call UpdateResources on the compute graphs

one is in PCGComputeGraphElement.cpp and the other in PCGGraphCompilerGPU.cpp

The fix is to replace the UpdateResources paremeterless call with the following block of ifdef code:

// Fix for the PCGComputeGraphElement.cpp #if WITH_EDITOR Context->ComputeGraph->UpdateResources(/*bSync=*/IsRunningCommandlet()); #else Context->ComputeGraph->UpdateResources(/*bSync=*/false); #endif // WITH_EDITOR

// Fix for PCGGraphCompilerGPU.cpp #if WITH_EDITOR ComputeGraph->UpdateResources(/*bSync=*/IsRunningCommandlet()); #else ComputeGraph->UpdateResources(/*bSync=*/false); #endif // WITH_EDITOR

Let me know if those fixes work for you (don’t forget to remove your call in the builder first)

Cheers,

Patrick