Allow ENABLE_GC_OBJECT_CHECKS to be overriden outside of GarbageCollection.h
#rb none
#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 20085499 via CL 20086136 via CL 20086228 via CL 20086317
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
[CL 20108298 by robert millar in ue5-main branch]
* Added new ELifetimeCondition COND_NetGroup, that is only supported on replicated subobjects.
* Any subobject using COND_NetGroup must be part of a netcondition group via the NetConditionGroupManager world subsystem for it to get replicated.
* PlayerControllers can be members of a group via IncludeInNetConditionGroup
* When a netgroup subobject replicates to a connection we will only replicate it if the playercontroller of the connection is a member of atleast one group of that subobject.
* NetGroupOwner and NetGroupReplay are special groups that automatically replicate to the owner's connection or the replay net driver.
* This feature is only available to Actors or Actorcomponents with bReplicateUsingRegisteredSubObjectList = true
#jira UE-132891
#rb Ryan.Gerleve, Mattias.Hornlund, John.Barrett
#ROBOMERGE-AUTHOR: louisphilippe.seguin
#ROBOMERGE-SOURCE: CL 20076279 via CL 20076546 via CL 20076844
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
[CL 20106219 by louisphilippe seguin in ue5-main branch]
#rb trivial
#rnx
#preflight 627145185e6ce673f443b981
- This can be used to load a trailer from a package file that is not stored in a mount point (and so would fail if FPackagePath is used)
[CL 20026913 by paul chipchase in ue5-main branch]
- FBlueprintContextTracker::GetScriptStack is deprecated
- FBlueprintContextTracker::GetCurrentScriptStack() now returns a TArrayView so that the view of the stack remains const
- FBlueprintContextTracker::GetCurrentScriptStackWritable() added for uses that explicitly need writable access to the stack
- FBlueprintCoreDelegates::ThrowScriptException now needs a non-const FFrame to be able to set the abort flag
#rb matt.breindel julien.marchand phil.pizlo phillip.kavan
#preflight 626c710d2c01a675267ebcab
#ROBOMERGE-AUTHOR: michael.nicolella
#ROBOMERGE-SOURCE: CL 19992064 via CL 19992251 via CL 19992502 via CL 19992685
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
[CL 19995787 by michael nicolella in ue5-main branch]
#rb Phillip.Kavan
Add missing generate public hash entries to ArchiveStackTrace
#fyi Francis.Hurteau
#preflight 626c692cb046e6ecc338080e
#lockdown JeanFrancois.Dube
[CL 19988606 by Marc Audy in ue5-main branch]
- Expose Platform User IDs and Input Device IDs to blueprints and other UPROPERTY uses allowing users to call functions from blueprints.
- Add events on the game instance that you can hook onto in blueprints
- Add accessors to the PC
#jira UE-147801
#rb marc.audy
#preflight 626ac71cb17dd9121b42650c
[CL 19965758 by ben hoffman in ue5-main branch]
#rb PJ.Kack
#rnx
#preflight 626a7ef2485a2fed3a2e04d7
- Note that these problems were not causing crashes, but they did cause errors to be logged about invalid formats and request the packages to be re-saved.
- Most of the problem comes from the code paths being too complicated, hopefully now things are locked down we should be able to start pruning this soon and make it easier to maintain in the future.
### Problem
- The problem comes from certain package setups that allow for the existence of duplicate payload entries where one entry is local or referenced and another version is virtualized. If a trailer is created from this data then the virtualized entry will be discarded (as the look up table is a map) and we revert to using the non virtualized payload instead. Ideally we'd want to discard the local/referenced payloads in favour of the virtualized one to save space.
-- By itself this bug would waste disk space but not cause other problems, however we were also writing out the virtualized flag so that when the bulkdata is next loaded it has the virtualized flag but then checks with the trailer and is told that it is not virtualized which triggers some asserts I added to find badly formed data.
- How the package gets duplicate entries like this is somewhat complicated involing duplicating objects from other (already virtualized) packages during load, then saving them (found in packages with Niagra assets at least)
### Fix
- When creating a trailer from a trailer build, we first find any local and/or referenced entries and check if there are duplicate entries in the virtualized payload entries. If so we remove the local/referenced version in favor of using the virtualized version.
-- Ideally we'd do this during the serialization of exports as it might let us skip the loading of some payloads for save entirely, however we don't know all the entries until after export serialization is completed so this is the only point we can search for duplicates safely.
- Added a way to get the full name of the owning asset, including package name + asset, when asking the user to re-save. This makes debugging the problems easier.
- Add a new check when loading to find payloads saved with the virtualization flag and to a trailer. If we do find one we warn the user that they should re-save the package and remove the flag so that no further problems occur.
- Demoted the old check for bad formats to a warning as we don't need to fail builds because of it.
-- Additionally we now only give the warning if we detect that we are loading from a package, as being virtualized and not in a package trailer would be valid when loading from other sources.
- Added comments to consider removing both checks asking the user to re-save the package after 5.2, as in theory we should only ever see these problems internally at Epic as it is unlikely that externals will have enabled the system.
- When saving a virtualized payload to the trailer, make sure to remove the virtualized flag, that should be picked up on load by polling the trailer for the payload status and should not be baked into the export data.
-- Hypothetically this will allow for us to re-hydrate the package without re-saving it through manipulating the trailer.
[CL 19963043 by paul chipchase in ue5-main branch]
Remove bValid from FMetaData and FData return structs; it is redundant with the RawHash/Buffer data already present in those structs.
#preflight 62680b42430b9997ebe0a46d
#rb Devin.Doucette
#rnx
[CL 19923039 by Matt Peters in ue5-main branch]
Stored per object, and can be set from any game code, not just PreReplication
#rb ryan.gerleve, peter.engstrom
#ROBOMERGE-AUTHOR: brian.bekich
#ROBOMERGE-SOURCE: CL 19909058 via CL 19911194 via CL 19911458
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
[CL 19913111 by brian bekich in ue5-main branch]
It is possible to toggle to the previous/legacy behavior with gc.GCLockBehavior=1.
Legacy behavior:
A giant FGCCSyncObject lock for the complete duration of CollectGarbageInternal.
A giant FUObjectHashTables lock for most of CollectGarbageInternal except the execution of the GetPreGarbageCollectDelegate and GetPostGarbageCollect callbacks.
Giant FGCCSyncObject and FUObjectHashTables locks for IncrementalPurgeGarbage (inluding both UnhashUnreachableObjects and IncrementalDestroyGarbage).
Unchanged behavior:
The GIsGarbageCollecting contract is fuzzy and the behavior is not changed at this point to reduce risk.
GIsGarbageCollecting is set during CollectGarbageInternal.
GIsGarbageCollecting is also set during the IncrementalDestroyGarbage phase of IncrementalPurgeGarbage, but not during UnhashUnreachableObjects. Why???
Many use cases seems to be as simple as to avoid the StaticFindObject asserts, but there are definitely use cases that are harder to reason about like UObject::GetDefaultSubobjectByName, UObject::CanModify, UChildActorComponent::DestroyChildActor, AActor::ProcessEvent, AGroupActor::PostRemove, UEditorEngine::UndoTransaction, UEditorEngine::RedoTransaction, DatasmithRuntime::FSceneImporter, ...
Changed legacy and default behavior:
Move PostReachabilityAnalysis.Broadcast after GatherUnreachableObjects, NotifyUnreachableObjects and ClearWeakReferences.
StaticAllocateObject and the StaticFindObject functions are now checking IsGarbageCollectingAndLockingUObjectHashTables instead of IsGarbageCollecting/IsGarbageCollectingOnGameThread,
but when using the legacy behavior IsGarbageCollectingAndLockingUObjectHashTables should have the same meaning as IsGarbageCollecting.
New default behavior:
Restrict the giant scope of locking FGCCSyncObject and FUObjectHashTables during CollectGarbageInternal to DissolveClusters, VerifyGCAssumptions, PerformReachabilityAnalysis, GatherUnreachableObjects, NotifyUnreachableObjects and ClearWeakReferences.
Remove the giant FGCCSyncObject lock completely during IncrementalPurgeGarbage (including UnhashUnreachableObjects and IncrementalDestroyGarbage).
Remove the giant FUObjectHashTables lock completely during IncrementalDestroyGarbage.
This means BeginDestroy, FinishDestroy, destructors and callbacks are all executed without the giant FGCCSyncObject and FUObjectHashTables locks and they are all relying on existing smaller thread safety locks for for accessing the global uboject array and global hash tables.
#jira UE-145217, UE-144461, FORT-369252
#rb francis.hurteau, danny.couture, robert.manuszewski, robert.millar
#rnx
#ROBOMERGE-OWNER: pj.kack
#ROBOMERGE-AUTHOR: pj.kack
#ROBOMERGE-SOURCE: CL 19898875 via CL 19899297 via CL 19899332 via CL 19899335
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)
[CL 19902015 by pj kack in ue5-main branch]
#preflight 6262023aa2579b4c772bfc75
#ROBOMERGE-AUTHOR: keith.yerex
#ROBOMERGE-SOURCE: CL 19865362 via CL 19865432 via CL 19866497 via CL 19868767 via CL 19869044
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)
[CL 19874250 by keith yerex in ue5-main branch]