Commit Graph

1128 Commits

Author SHA1 Message Date
danny couture
5311d0b7f6 Disable postload group in editor as it cause circular dependencies by trying to flush everything instead of only what's necessary
Only preload the current package instead of the whole hierarchy recursively

#rnx
#rb PJ.Kack, Francis.Hurteau
#preflight 64788f45947ff6973c0a1e7c

[CL 25788188 by danny couture in ue5-main branch]
2023-06-05 04:32:48 -04:00
Matt Peters
9337daf49c EditorBulkData: Remove accidentally-submitted debug code.
#fyi Paul.Chipchase
#rb None, trivial
#rnx
#preflight None, trivial

[CL 25716020 by Matt Peters in ue5-main branch]
2023-05-31 17:54:34 -04:00
Wojciech Krywult
d1baf24722 AsyncIO: Fixed incorrect handling of the STAT_AsyncFileMemory stat.
I've reviewed all code using async requests and we had multiple places incorrectly handling the stat: some placed failed to decrease the counter, while others would decrease it when they shouldn't. The main cause was the fact that when we create an async request and pass nullptr as the target memory, the request allocates the memory itself and increases the STAT_AsyncFileMemory. However, when we call GetReadResults() on such requests, the responsibility is on the caller to balance the calls and decrease the stat, which is not very obvious and leads to the mentioned bugs. On top of that, when we call GetReadResults() we may not have the knowledge as to whether the returned memory was allocated by the request or not (which may affect whether we should touch the stat at all).

Resolved by adding IAsyncReadRequest::ReleaseMemoryOwnershipImpl member, which may be used by request implementations to do the proper clean up (balance the stat). This way requests take the full responsibility for their changes and users of the requests don't need to know their implementation details.

#preflight none
#rb Patrick.Laflamme
#jira UE-185064

[CL 25664733 by Wojciech Krywult in ue5-main branch]
2023-05-29 12:11:37 -04:00
kirill zorin
b6ee3a6c64 Fix UE_LOG callsites that have format string-related UB
#rb trivial
#preflight 647107780a6634dbb236a0a6

[CL 25651638 by kirill zorin in ue5-main branch]
2023-05-26 15:52:39 -04:00
danny couture
6d4c3e6e1c Add missing PlayInEditorID scope in zenloader
#rnx
#rb Francis.Hurteau
#preflight trivial

[CL 25644091 by danny couture in ue5-main branch]
2023-05-26 11:59:40 -04:00
francis hurteau
a4583b242d When releasing export bundle process node for a set of depedent packages, release non zen packages containing classes prior to non zen packages that do not.
#rb PJ.Kack, Danny.Couture
#preflight 646e57092c0a5da0dc318f0a

[CL 25630944 by francis hurteau in ue5-main branch]
2023-05-25 17:54:07 -04:00
dan thompson
5f360661f3 Move GuardedInt.h to Core as it's about to be needed elsewhere.
#rb devin.doucette
#preflight 6467a9a52c0a5da0dcd0afa9

[CL 25553319 by dan thompson in ue5-main branch]
2023-05-19 17:51:45 -04:00
zousar shaker
b0d5721dde Initial implementation of DiffOnly mode for ZenServer as Cooked Output Store. Lacking detailed header diffing, but stubbed in for future addition. When using ZenServer as Cooked Output Store the packages use the ZenPackageSummary header format instead of the PackageFileSummary header format. This is how data is stored in ZenServer and the format it is when fetched. Data produced in process is transformed into this format ahead of diffing.
The code for parsing a view of the ZenPackageSummary has been extracted from AsyncLoading2.cpp into a private h/cpp and is possible to use from the header diffing code when printing out detailed diffs, but is not used yet.

#rb matt.peters
#rb pj.kack
#jira UE-175237

[CL 25549055 by zousar shaker in ue5-main branch]
2023-05-19 14:43:02 -04:00
andriy tylychko
9465046a9b fixed buffer overrun in ArchiveStackTrace that was causing mem corruption during cooking
#rb per.larsson
#preflight 64676fa70577c206c78929fc

[CL 25548171 by andriy tylychko in ue5-main branch]
2023-05-19 13:50:49 -04:00
paul chipchase
4335d78604 Deprecate four FBulkData flags that no longer serve any useful purposes: BULKDATA_Unused, BULKDATA_ForceStreamPayload, BULKDATA_SerializeCompressedBitWindow and BULKDATA_BadDataVersion
#rb Per.Larsson
#jira none
#preflight 64674758c571db717b037aaf

- BULKDATA_ForceStreamPayload and BULKDATA_SerializeCompressedBitWindow have not done anything for sometime.
- BULKDATA_BadDataVersion was a bug added some years ago which could've caused DDC pollution. Since then the DDC keys for the problematic assets have been changed several times and there should no longer be any danger.
- BULKDATA_Unused technically works but is unused and there does not seem to be any demand for it. This flag will probably remain deprecated for longer than the others to check for any valid external feedback.

[CL 25541994 by paul chipchase in ue5-main branch]
2023-05-19 06:27:58 -04:00
francis hurteau
a72c1633af Remove DeferredPostLoadGroup ensure validating a wrong assumption
#rb trivial
#preflight 646527e74404e3cdd229c2fa

[CL 25518692 by francis hurteau in ue5-main branch]
2023-05-17 19:10:43 -04:00
kirill zorin
de8db5ff76 Converting ARO-facing raw pointers to TObjectPtr ahead of raw pointer ARO API deprecation.
#rb zousar.shaker
#rb markus.breyer
#rb robert.manuszewski

#preflight 646391406b1406b54ab15460

[CL 25489627 by kirill zorin in ue5-main branch]
2023-05-16 10:52:49 -04:00
paul chipchase
b7eae46d3a Make FEditorBulkData thread safe.
#rb Danny.Couture, Devin.Doucette, Per.Larsson
#jira UE-140944
#preflight 645e2c76b71b8186aaca29db


*** FLinkerLoad
- Attaching/detaching both FBulkData and FEditorBulkdata to a FLinkerLoad should now be thread safe.
- Note that this does NOT fix the long standing issue when a FPackage is GCed before some of the UObjects (assets) inside of that package, which causes any remaining bulkdata to be detached (and unable to load off disk) without forcing payloads into memory. This will be addressed as its own work item.
-- FEditorBulkData can still attempt to load its payload from a package after detachment as a fall back measure that is preferable to a crash.

*** FEditorBulkData
- Forced to use FRecursiveMutex at the moment some methods that need locking make calls into the bulkdata registry which can make calls back to the calling bulkdata object ending up with recursive locking, at least for now.
- This might look like a lot of locks being introduced, but FEditorBulkData methods are called relatively infrequently., in a test project with a semi large amount of data (~16GB) cooking from a cold DDC benchmarked at roughly the same wall time before/after these changes.
- Added a comment block to the header describing the thread safety expectations of the class.
- Made the class final as we really don't want to deal with inherited bulkdata types as we did with the old system.
- Since FLinkerLoad attachment/detachment is now thread safe we can detach from any pre-existing AttachedAr when running the assignment operator and attach to the AttachedAr of the provided bulkdata. This means copied/assigned bulkdata do not need to force their payloads into memory.
- Cleaned up some comments in the header.

[CL 25485916 by paul chipchase in ue5-main branch]
2023-05-16 02:28:26 -04:00
jason weiler
6c15961c22 FORT-603307 - Changing a script variable type without changing the name was asserting in AsyncLoader2.
#rb [at]Robert.Manuszewski
#preflight-645ba171e81da34de94786a1

[CL 25411002 by jason weiler in ue5-main branch]
2023-05-10 14:11:19 -04:00
paul chipchase
a6e0bbb136 Fix potential truncation issue in AsyncLoading2
#rb PJ.Kack
#jira none
#rnx
#preflight 645a13fd013f3751583f0380

- If the value being stored in ExportBundleEntriesCount exceeds MAX_int32 then we will end up failing the check below and printing an error anyway so we might as well just cast at this point.

[CL 25385553 by paul chipchase in ue5-main branch]
2023-05-09 08:00:57 -04:00
paul chipchase
3171307812 Fix a bug where FArchiveCrc32 would not hash all of the data provided to it if the data was sufficiently large enough.
#rb Sebastien.Lussier
#jira none
#rnx
#preflight 6453d22b4d593c0b428dacfe

- This should only change the hash when FArchiveCrc32::Serialize is called on buffers larger than MAX_int32 in size, which given the current use cases of FArchiveCrc32 is probably not occuring anywhere anyway.
- Found this issue when fixing truncation warnings.
- Serialize accepts data lengths of type int64 but FCrc::MemCrc32 would silently truncate the data to int32.
-- This doesn't result in the data being hashed up to length MAX_int32 as the iteration inside of MemCrc32 (at least in some implementations) uses a signed index, passing in larger values will result in this index being negative and our loop checks for that index being reduced to 0.
- To fix this we should call FCrc::MemCrc32 with the data length clamped to MAX_int32 and then make repeated calls until the entire buffer hash been hashed.

[CL 25384518 by paul chipchase in ue5-main branch]
2023-05-09 05:30:06 -04:00
robert millar
41c6ff78ec Allow streamable manager to flush only the relevant async loading requests for a given streamable handle.
#rb ben.zeigler,francis.hurteau

[CL 25363331 by robert millar in ue5-main branch]
2023-05-05 21:36:05 -04:00
francis hurteau
025b52b2dd Fix infinite loading when flushing a package with a deferred post load group
#rb PJ.Kack, Danny.Couture
#preflight 64550e36994d8a3d0a26f643

[CL 25356816 by francis hurteau in ue5-main branch]
2023-05-05 12:46:20 -04:00
paul chipchase
d91ff399b2 Add an overload to FEditorBulkData::UpdatePayload that takes a FCompressedBuffer directly
#rb Per.Larsson
#jira none
#rnx
#preflight 6453ce50d863ba2621851360

- FCompressedBuffer will calculate the FIoHash of its data and FEditorBulkData can take the hash from there rather than calculating one itself. If you create one with no compression codec set you could use that to control when the hashing takes place before passing the data to FEditorBulkData.
- In the future we might change FEditorBulkData to hold its data in a FCompressedBuffer, allowing us to avoid decompressing the payload unless someone actually asks for it in uncompressed format.
- Added some unit tests

[CL 25352762 by paul chipchase in ue5-main branch]
2023-05-05 08:27:38 -04:00
paul chipchase
f684fc8020 Do not treat FIoHash as a rvalue when updating a payload as it doens't actually do anything.
#rb trivial
#jira none
#rnx
#preflight 64536fc1743c256cd6e71b28

[CL 25332030 by paul chipchase in ue5-main branch]
2023-05-04 04:59:21 -04:00
paul chipchase
5f4e2f7770 Fix potential truncation issue in FArchiveStackTraceWriter.
#rb trivial
#jira none
#rnx
#preflight 644a6b7f877716c8784935db

- LastDifferenceCallstackOffsetIndex was only ever being used as a int32 so changed it to that type.

[CL 25298576 by paul chipchase in ue5-main branch]
2023-05-02 04:21:21 -04:00
danny couture
f507757f38 Remove some zenloader tracing recently added that caused perf and trace size regression
#rnx
#rb trivial
#preflight trivial

[CL 25282853 by danny couture in ue5-main branch]
2023-05-01 08:08:30 -04:00
francis hurteau
36421c6ba7 Reverse the post load order for PostLoadGroups start with dependencies in ZenLoader
Also use the PostLoadGroup to run the deferred post load using the group to prevent race with ConditionalPostLoad with async and non async PostLoad

#rb PJ.Kack, Danny.Couture
#preflight 644700b8641e2c3cb4dbcaf0, 644ad94eb208f61af83567ea

[CL 25238989 by francis hurteau in ue5-main branch]
2023-04-28 16:02:04 -04:00
paul chipchase
3224a8ab34 Update the experimental FEditorBulkData sidecar saving feature to use FPackageTrailer
#rb Per.Larsson
#jira UE-139530
#rnx
#preflight 644bc6e4f502608229ff7e68

- The functionality remains mostly the same and is still disabled by default.
- We use the older legacy serialization path if sidecar saving is enabled.
- Updating the code to use FPackageTrailer allows us to finally delete the older which was the precursor to the FPackageTrailer system. This will allow us to combine some code paths in the future and reduce complexity.

[CL 25232459 by paul chipchase in ue5-main branch]
2023-04-28 11:05:06 -04:00
joe pribele
3c7379f5c0 changed ArchiveObjectCrc32 to not resolve unresolved FObjectPtr the path name of an object can be obtained from a FObjectPtr without resolving
https://p4-swarm.epicgames.net/reviews/25174152

#rb tim.smith
#preflight 644aa8c2693defa68d7e65d3

[CL 25218417 by joe pribele in ue5-main branch]
2023-04-27 13:09:01 -04:00