Hello,
After switching to the UE 5.5 we started to experience occasional cook soft locks: at some point of execution the cooker stop making any progress and just endlessly reports “Cooked packages Nc Packages Remain Nr Total Nt” where Nc, Nr and Nt never change.
We were able to fully investigate the issue and we have found that there is a bug in the logic related to the UAnimSequence::bUseRawDataOnly that causes these soft locks. Please find some details below. Also, see the provided repro project.
[Simplified] description of the issue:
1. If there are two animation sequences: VictimAnim and CulpritAnim, and
2. VictimAnim->RefPoseSeq (UAnimSequence::RefPoseSeq) points to the CulpritAnim, and
3. VictimAnim is loaded at the time T1 during the cooking, and
4. All async “compilation” tasks (FAnimationSequenceAsyncCacheTask; see the UAnimSequence::BeginCacheDerivedData(const ITargetPlatform* TargetPlatform)) are finished for the VictimAnim at the time T2 during the cooking, and
5. UAnimSequence::FlagDependentAnimationsAsRawDataOnly() is called for the CulpritAnim at the moment T3 during the cooking, and
6. T3 > T2, and VictimAnim is not yet saved and not yet scheduled for saving by the cook logic at the time T3, then
7. Cook will be soft locked at the attempt to save the VictimAnim later, because VictimAnim->IsCachedCookedPlatformDataLoaded() will never return true
The reason the VictimAnim->IsCachedCookedPlatformDataLoaded() will never return true after the moment T3 is the following:
1. At the moment T2 (see p.4 above) the VictimAnim will be switched to the following state:
VictimAnim->bUseRawDataOny == false && VictimAnim->DataKeyHash == VictimAnim->CreateDerivedDataKeyHash(<TargetPlatform>) && VictimAnim->CacheTasksByKeyHash.Contains(VictimAnim->CreateDerivedDataKeyHash(<TargetPlatform>)) == false && VictimAnim->CompressedData.IsValid(VictimAnim) == true
This is an expected normal state of the object and VictimAnim->IsCachedCookedPlatformDataLoaded() will return true when VictimAnim in this state.
2. But at the moment T3 (see p.5 above) the value of VictimAnim->bUseRawDataOnly will be changed to true, as a result of execution of UAnimSequence::FlagDependentAnimationsAsRawDataOnly() for the CulpritAnim. So the state of the VictimAnim will change to the following:
VictimAnim->bUseRawDataOny == true && <== JUST CHANGED VictimAnim->DataKeyHash == VictimAnim->CreateDerivedDataKeyHash(<TargetPlatform>) && VictimAnim->CacheTasksByKeyHash.Contains(VictimAnim->CreateDerivedDataKeyHash(<TargetPlatform>)) == false && VictimAnim->CompressedData.IsValid(VictimAnim) == true
This state of an animation sequence object can’t be properly handled by the IsCachedCookedPlatformDataLoaded() and IsCachedCookedPlatformDataLoaded() always return false for the object in this state (and this state is never changed as a result of IsCachedCookedPlatformDataLoaded() execution).
Please see the next post (post characters limit) …