# GeometryCache: data race between FGeometryCacheSceneProxy::CreateHitProxies and the render-thread FrameUpdate enqueued by the proxy constructor 

**URL:** <https://forums.unrealengine.com/t/geometrycache-data-race-between-fgeometrycachesceneproxy-createhitproxies-and-the-render-thread-frameupdate-enqueued-by-the-proxy-constructor/2854415>\
**Category:** Rendering\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [October 7, 2026, 12:52pm UTC](https://forums.unrealengine.com/t/geometrycache-data-race-between-fgeometrycachesceneproxy-createhitproxies-and-the-render-thread-frameupdate-enqueued-by-the-proxy-constructor/2854415 "2026-10-07T12:52:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 7, 2026, 12:52pm UTC](https://forums.unrealengine.com/t/geometrycache-data-race-between-fgeometrycachesceneproxy-createhitproxies-and-the-render-thread-frameupdate-enqueued-by-the-proxy-constructor/2854415/1 "2026-10-07T12:52:04Z")

</div>

Hello

We are experimenting intermittent ensures during PIE start / actor registration when a level contains a UGeometryCacheComponent:

ensureMsgf(CurrentNum == InitialNum, TEXT(“Array has changed during ranged-for iteration!”))

Callstack is on the game thread (or a parallel-game-thread registration task) inside

FGeometryCacheSceneProxy::CreateHitProxies, iterating Track-\>MeshData-\>BatchesInfo.

**Root cause**

1. FGeometryCacheSceneProxy::FGeometryCacheSceneProxy (GeometryCacheSceneProxy.cpp ~L162-180) decodes the

current frame into NewSection-\>MeshData on the creating thread, then immediately enqueues

ENQUEUE\_RENDER\_COMMAND(FGeometryCacheUpdateAnimation) { SceneProxy-\>FrameUpdate(RHICmdList); }.

2. After CreateSceneProxy() returns, FScene::BatchAddPrimitivesInternal constructs FPrimitiveSceneInfo,

which (GIsEditor) calls Proxy-\>CreateHitProxies (PrimitiveSceneInfo.cpp ~L240). That function

ranged-fors over Track-\>MeshData-\>BatchesInfo (GeometryCacheSceneProxy.cpp ~L354).

3. The render thread may already be executing the FrameUpdate from step 1. For a new track proxy

FrameIndex == NextFrameIndex == -1, so FrameUpdate takes the “seek” branch

(GeometryCacheSceneProxy.cpp ~L734-736):

if (TrackProxy-\>GetMeshData(FrameIndex, \*TrackProxy-\>MeshData))

which ends in FCodecV1Decoder::DecodeFrameData (CodecV1.cpp ~L1110):

Reader \<\< OutMeshData.BatchesInfo;

FGeometryCacheMeshBatchInfo has a custom operator\<\<, so TArray loading uses the per-item path:

A.Empty(SerializeNum) followed by AddDefaulted\_GetRef per element. Num transiently goes to 0 and

back up while the other thread is iterating the same array, and the ranged-for check fires.

The final count is usually identical, which is why it is intermittent.

**Suggested fix**

Do not hand the proxy to the render thread from the constructor. Move the two constructor enqueues

(FGeometryCacheUpdateAnimation / FrameUpdate and FGeometryCacheInitRayTracingGeometry) into an

override of FPrimitiveSceneProxy::CreateRenderThreadResources, which runs inside the scene’s

AddPrimitiveCommand, i.e. after the FPrimitiveSceneInfo and its hit proxies exist.

Thanks

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 7, 2026, 12:52pm UTC](https://forums.unrealengine.com/t/geometrycache-data-race-between-fgeometrycachesceneproxy-createhitproxies-and-the-render-thread-frameupdate-enqueued-by-the-proxy-constructor/2854415/2 "2026-10-07T12:52:07Z")

</div>

**Steps to Reproduce**  
Engine version: 5.6, 5.7 and 5.8

Platform: Win64, editor (PIE). Not reproducible in cooked builds because the reader is editor-only.

Use the geometry cache plugin in the editor and go to PIE

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Petrockets](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/petrockets/32/1142518_2.png) [@Petrockets](https://forums.unrealengine.com/u/Petrockets)\
**Post date:** [October 13, 2026, 11:07pm UTC](https://forums.unrealengine.com/t/geometrycache-data-race-between-fgeometrycachesceneproxy-createhitproxies-and-the-render-thread-frameupdate-enqueued-by-the-proxy-constructor/2854415/3 "2026-10-13T23:07:15Z")

</div>

Hi Sergi,

Thanks for reporting this issue, it does look like it still may occur in latest and I’m attempting to set up a repro scene to validate that or if some other code change in latest prevents it from happening.

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Petrockets](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/petrockets/32/1142518_2.png) [@Petrockets](https://forums.unrealengine.com/u/Petrockets)\
**Post date:** [October 13, 2026, 11:41pm UTC](https://forums.unrealengine.com/t/geometrycache-data-race-between-fgeometrycachesceneproxy-createhitproxies-and-the-render-thread-frameupdate-enqueued-by-the-proxy-constructor/2854415/4 "2026-10-13T23:41:07Z")

</div>

I went ahead and created a new issue which should be visible publicly soon here [https://issues.unrealengine.com/issue/UE\-402663](https://issues.unrealengine.com/issue/UE%5C-402663) for tracking. We’ll likely implement a similar fix to the one proposed.

[Attachment Removed]
