Mesh Partition: editor deadlocks when many preview sections build at once (worker tasks block on GameThread tasks)

Summary

Loading a large Mesh Partition region (about 87 preview sections) freezes the editor permanently. Worker tasks in FStaticMeshTransformer::Execute block on a GameThreadNormalPri task (FinalizeStaticMeshesTask.Wait()) while the game thread spins in Mass FChangeListener::WaitForChange without running game-thread tasks. The worker pool fills up and the render thread waits forever in FlushPendingDeleteRHIResources_NonRealtime. A second blocking GetResult() in ProcessModifiers_TextureChannels freezes it the same way. I have a small patch that fixes both. Other transformers contain the same pattern, which I did not test.

What Type of Bug are you experiencing?

World Creation Tools

Steps to Reproduce

UE 5.8.3 source build, MeshPartition plugin, a project with a Mesh Partition using the MPD_Default data asset (RVT transformer included on Preivew / High End).
Open asmall level, then open a large level with about 87 preview sections.
Wait. The editor stops responding and never recovers. I created the the terrain with a heightmap click save and unload then try to load a big region.

Expected Result

The region loads. Memory-bound slowness is acceptable, but the editor recovers.

Observed Result

Observed Result
The editor freezes permanently, and I can reproduce it every time on the unpatched code. The render thread waits in FlushPendingDeleteRHIResources_NonRealtime (SubmitCompletionEventWait) and never returns. The GPU is idle.

All 85 to 88 command-list dispatch events are complete. Only the tail of DispatchPipe is incomplete.
In the debugger, 28 worker threads are parked in FStaticMeshTransformer::Execute → FTaskHandle::Wait.
The root of the task chain is a ready, unstarted GameThreadNormalPri task with no prerequisites.
The game thread is in UMassEntityEditorSubsystem::Tick → FProcessingQueue::Run → WaitForChange. That the pool starvation keeps the Mass workers from running is my inference from the stacks and source, not something I saw.

Affects Versions

5.8

Platform(s)

Windows

Additional Notes

This is the proposed fix which claude gave me. I did apply i successfully but this doesn’t fix the memory pressure, probably have to dig deeper.
Proposed fix

Claude summary:

The deadlock comes from worker tasks that block while waiting for tasks that only the game thread can run. I replaced those blocking waits with nested tasks, so the parent task completes only after the game-thread step finishes, and the worker is released in the meantime. The change is about 20 added lines in three files of the MeshPartitionEditor module:

FStaticMeshTransformer::Execute: UE::Tasks::AddNested(FinalizeStaticMeshesTask) replaces FinalizeStaticMeshesTask.Wait(). The task handles are now captured by value, because Execute returns before the nested tasks run.
UMeshPartitionEditorComponent::LaunchTransformers: Transformer_Task calls Execute on the transformer stored in the context, not on a lambda-captured copy, so the nested tasks can’t outlive it.
ProcessModifiers_TextureChannels: a nested follow-up task stores the result of RenderSectionChannels once it has finished, instead of the worker calling GetResult() and blocking on a game-thread render task.

Additional MeshPartition preview-stall evidence, including collision finalisation — UE 5.8.3

I have additional historical observations that overlap the channel/static wait sites discussed in this thread, plus a collision-finalisation observation. I have not established that our complete wait cycle is identical to the original reporter’s. Their Mass stack and reproduction are not my captured evidence.

Environment and symptom

UE 5.8.3, CL58210709, Windows, graphical Editor, custom World Partition/MeshPartition project. The map-loading operation returned, but the editor remained unusable during subsequent preview processing.

Staged observations

Historical stage Retained observation
Original code at the investigated wait sites; earlier cleanup guard already present 44 channel-result waiters in the captured snapshot, after earlier finite merge/weld work had drained; no weld frames in that snapshot.
Channel scheduling change, static wait code still original 44 static-transformer Execute waits; no channel-result frames.
Channel + static scheduling changes, collision wait code still original Two captures of the same process, 264.04 seconds apart, each showed 44 collision-finalisation waits, with no channel/static/weld frames.
Same collision-stage process, separate activity interval Over 453.786 seconds, 9.5625 CPU seconds and zero recorded read/write-byte growth. This is low-progress sampling, not proof every thread was idle.
Cumulative channel + static + collision changes Initial finite remaining weld work, followed by zero enumerated wait counts and normal process exit in the retained report.

The reviewed baseline and collision-stage hosts used Normal priority and affinity covering 24 logical processors, without job affinity/priority/CPU-rate caps. Standby workers were present. The count of waiting workers alone is not evidence that all scheduling capacity was exhausted.

Wait sites and source interpretation

Matching private symbols identify the MeshPartitionEditor channel-result, static-transformer and collision-transformer wait sites. The original Engine component schedules transformer Execute calls on workers; channel production and the relevant finalisers require named GameThread work.

That supports a task-completion/liveness concern, but Wait() and GetResult() are supported operations and are not automatically defects. No project caller directly invoking these Execute methods on an invalid thread was identified.

Our captures also showed main/render-thread waits, but the exact queued task/event identities needed to reconstruct a closed dependency cycle were not captured. Many other-module frames had only export-plus-offset resolution and are not presented as exact private-function diagnoses.

Important limits

These are historical custom-project comparisons, not a wholly pristine engine reproduction. Changes were cumulative and included lifetime handling; the baseline already had an unrelated cleanup guard. Later warm-cache usability observations also included a separate cache-key change, so those timings cannot isolate one scheduling change.

The project’s opening timing, workload and configuration may contribute to triggering the issue. A minimal native-only reproduction has not been validated locally. The existing thread’s heightmap/default-definition steps are the other reporter’s recipe, not a test I have performed.

The historical changes are described to explain the comparison, not to recommend maintaining a custom engine or to supply a patch.

Request

Could Epic investigate the worker-to-GameThread completion relationships in the channel path and collision finalisation as well as the static transformer, and clarify the intended completion/lifetime contract? Please also advise whether the existing report covers these additional observations or whether a separate collision issue is preferred.

Attachments: Dropbox and Dropbox . These are small derived selections from retained historical records, not complete dumps or a reproduction project.