Iris: unresolved-reference hot/cold cache never transitions on ARM64 (CurrTimeMS overflows uint32)

In FReplicationReader::ResolveAndDispatchUnresolvedReferences, the following timer code is called

const uint32 CurrTimeMS = static_cast<uint32>(FPlatformTime::Seconds() * 1000.0f);

On Apple (and Windows), FPlatformTime::Seconds has a hardcoded offset value of 16777216 (in UE 5.7.3) and a dedicated function GetSecondsTimeOffset() for this offset (in UE 5.8).

So Seconds() * 1000 is at least 1.68×10¹⁰ and that’s always larger than UINT32_MAX

, and the conversion is undefined behavior.While x64 wraps, on ARM64 the conversion saturates, so CurrTimeMS is always 0xFFFFFFFF

We caught this due to entries never transition from the HotUnresolvedHandleCache to ColdUnresolvedHandleCache

Here was the fix:

// const uint32 CurrTimeMS = static_cast<uint32>(FPlatformTime::Seconds() * 1000.0f);

const uint32 CurrTimeMS = static_cast<uint32>(static_cast<uint64>(FPlatformTime::Seconds() * 1000.0));

Steps to Reproduce
Profile a game on iOS with unresolved references, as a result of CurrTimeMS - *LifetimeMS is always 0:

  • Handles never move from HotUnresolvedHandleCache to ColdUnresolvedHandleCache.
  • Every unresolved handle is re-resolved on every call.
  • net.Iris.HotResolvingLifetimeMS and net.Iris.ColdResolvingRetryTimeMS have no effect.

Hi,

Thank you for the report! I was able to confirm the issue in my own test project and have opened a new issue for this, UE-405915. It should be visible in the public tracker in a day or so.

I’ve also confirmed your proposed fix resolves the problem and made a note of this on the internal tracker for the issue.

Thanks,

Alex