Commit Graph

393 Commits

Author SHA1 Message Date
paul chipchase
6e7f255861 Add a new feature allowing bulkdata cooked output to be split into smaller files to help with data organization and patching efforts.
#rb Per.Larsson, Pere.Rifa
#jira UE-222974

- To enable the feature call FBulkData::SetCookedIndex with a FBulkDataCookedIndex set to a value between 1 - 255. Zero is currently reserved as the default/off state and can be quickly accessed via FBulkDataCookedIndex::Default.
-- Note that we might change the default value in the future, the main reason to keep it as zero for now is that it means FChunkId values will remain unchanged for bulkdata files not using the feature.
- When a bulkdata object has a cooked index it will output to a file with that value based on the following format  <packagename>.CookedIndex.<extension> so a normal bulkdata payload with a cooked index of 5 would end up writing to <packagename>.005.ubulk.
-- This allows the calling systems to control which bulkdata payloads go to which sub files.
- We currently do not support memory mapped payloads or payloads with the duplicate non optional flags. Support and testing for this will be added later.
- Tested saving/editing/loading packages with bulkdata in the editor (vector fields), build/cook/run normal builds, build/cook/run with feature enabled then running the new code with data produced from non modified code and running non modified exe on data generated with the new code.

### IPackageResourceManager
- Added overloads for most methods that take EPackageSegment that also take a FBulkDataCookedIndex and deprecated the older versions.
- Not all methods have been ported over, just the ones I could test but the rest will need the same treatment at some point.

### FLinkerSave
- Now stores each set of bulkdata, optional bulkdata and memory mapped payloads in separate archives, one per cooked index.
- Added a method ::HasCookedIndexBulkData that returns if any of the normal bulkdata payloads contain a non default cooked index. This is used for some paranoid checks when saving packages to the workspace domain.

[CL 36754477 by paul chipchase in 5.5 branch]
2024-10-01 18:59:56 -04:00
per larsson
0cd309c18c Enable DiffContainer command from UnrealPak.exe
#rb Paul.Chipchase
#rnx

[CL 35895219 by per larsson in ue5-main branch]
2024-08-29 10:03:37 -04:00
zousar shaker
670ff52d9d Build fixes (compile shipping, and cook if zenserver not running) for last submission.
[CL 35465110 by zousar shaker in ue5-main branch]
2024-08-12 16:11:37 -04:00
zousar shaker
5cabc11d45 Introduce an interface (ICookArtifactReader) for reading data back from a package store used at cook time, with implementations to either read artifacts from zen (if not present on the filesystem), or read artifacts from the filesystem alone. Also ensured that the reader is used in the places that currently expect to read data for incremental cook. Specifically:
- CookSettings.txt
- DevelopmentAssetRegistry.bin
- Shader code libraries

#rb Matt.Peters

[CL 35461438 by zousar shaker in ue5-main branch]
2024-08-12 14:45:14 -04:00
paul chipchase
7c6b13f767 Fix an issue where incorrect data could be pushed to the DDC during compression for container files.
#rb Per.Larsson
#rnx

- The problem occurs because before we kick off the job to serialize a compressed entry to the DDC (so that we don't have to run compression on the same data each time the container is built) we were also kicking off a job to potentially encrypt the compressed data. It was possible for the encryption job to start modifying the data before we had serialized a copy for the DDC job, meaning that we'd be writing incorrect data to the DDC. Next time the container is built that bad data might be retrieved and the container would become corrupted.
- We now make sure that we finish setting up the DDC job before we kick off the encryption job.
- NOTE: The key for the compressed DDC entries has been changed to flush out the corrupted data already present.

[CL 35132937 by paul chipchase in ue5-main branch]
2024-07-29 05:13:54 -04:00
matt peters
a9f7abf2ef AssetRegistry: Remove direct access to the internal containers on FAssetRegistryState so that we can change them to be more complicated compressed structures in an upcoming change.
Remove some functions that were deprecated in 5.1 .
In AssetRegistryState implementation, tweak some function local variables to work for the upcoming code.
#rnx
#rb Francis.Hurteau

[CL 35122649 by matt peters in ue5-main branch]
2024-07-26 18:48:41 -04:00
zousar shaker
b615d7ba84 Change zen filesystem manifest filter to allow chunk manifest files to be included in the filesystem manifest and be incorporated into snapshots.
[CL 35021699 by zousar shaker in ue5-main branch]
2024-07-23 11:52:39 -04:00
pj kack
c7e041ef02 FPackageId: Deprecate and replace ValueForDebugging with LexToString.
#rb per.larsson
#rnx

[CL 34702722 by pj kack in ue5-main branch]
2024-06-27 04:15:42 -04:00
zousar shaker
22ee781bf7 Ensure asset registry and cook metadata read and write-back functionality works when operating on an imported zen snapshot.
#rb pj.kack

[CL 34675039 by zousar shaker in ue5-main branch]
2024-06-26 10:28:38 -04:00
zousar shaker
d9a5936c76 Extract CookedPackageStore and CookMetadataFiles functionality from IoStoreUtilities.cpp into Internal headers that allow use from IoStoreUtilities as well as PakFileUtilities. Allows Pak commands to accept a projectstore file argument and make use of data stored in zenserver.
#rb pj.kack

[CL 34623816 by zousar shaker in ue5-main branch]
2024-06-24 18:16:10 -04:00
pj kack
73f5b834e0 UnrealPak: Fix seen once crash in the DDC FOnCacheGetValueComplete callback provided by FIoStoreDDCGetRequestDispatcher::DispatchGetRequests.
The HandleDDCGetResult callback was releasing the FIoStoreWriteQueueEntry so that it could be completed and deleted before it was used to update the dispatcher queue size tracking.

#rb per.larsson
#rnx

[CL 34605028 by pj kack in ue5-main branch]
2024-06-24 10:57:32 -04:00
pj kack
f31ca451b7 UnrealPak: Remove the stricter ddc put limits and use the same as for gets.
#rb pj.kack
#rnx

[CL 34596813 by pj kack in ue5-main branch]
2024-06-23 15:54:17 -04:00
pj kack
9b94f8482e UnrealPak: Fix division by zero in logging code
#rb pj.kack
#rnx

[CL 34596800 by pj kack in ue5-main branch]
2024-06-23 15:51:17 -04:00
zousar shaker
839606e1e9 2nd submit: Incremental step towards being able to stage to both a pak build as well as a nopak (streamng) build from a snapshot entirely stored in zenserver (no loose files on the filesystem except a ue.projectstore file).
Key changes:
- Removed the use of cookedfiles.manifest
- Changed IoStore mode of UnrealPak to  be capable of getting zenserver launch data from either a package store manifest (cbobject, metadata) OR a project store marker file (json)
- Ensured that the UAT and IoStore mode of UnrealPak can launch zenserver reliably by passing along the SponsorProcessId when launching zenserver
- Ensured that shader archives (and their accompanying json metadata files) can be read either as loose files on disk or directly from zenserver if it the data for them is internal to zenserver (ie: they have a valid  chunk id)
Remaining work:
- Pak mode of UnrealPak must be able to launch zenserver and pull data from it.

#rb PJ.Kack

[CL 34565129 by zousar shaker in ue5-main branch]
2024-06-21 11:48:33 -04:00
zousar shaker
008dcac8a3 Ensure DLC cook and pak via zenstore don't interfere with the base project cooked output oplogs by segregating their cooked data into its own project id. Tested using EngineTestDLC. EditorDomain oplog is allowed to be shared between the DLC and the base project.
#rb Matt.Peters

[CL 34555257 by zousar shaker in ue5-main branch]
2024-06-21 01:06:39 -04:00
per larsson
2ab6c4c7ba Fixed bug when serializing empty soft package references
#rb Paul.Chipchase
#rnx

[CL 34523321 by per larsson in ue5-main branch]
2024-06-20 05:04:40 -04:00
per larsson
129585ee43 Added option -CookSoftPackageReferences to save soft package references when cooking
#rb Matt.Peters, Paul.Chipchase
#rnx

[CL 34503130 by per larsson in ue5-main branch]
2024-06-19 12:16:51 -04:00
zousar shaker
082e9969db [Backout] - CL34481610
[FYI] Zousar.Shaker
Original CL Desc
-----------------------------------------------------------------
Incremental step towards being able to stage to both a pak build as well as a nopak (streamng) build from a snapshot entirely stored in zenserver (no loose files on the filesystem except a ue.projectstore file).
Key changes:
- Removed the use of cookedfiles.manifest
- Changed IoStore mode of UnrealPak to  be capable of getting zenserver launch data from either a package store manifest (cbobject, metadata) OR a project store marker file (json)
- Ensured that the UAT and IoStore mode of UnrealPak can launch zenserver reliably by passing along the SponsorProcessId when launching zenserver
- Ensured that shader archives (and their accompanying json metadata files) can be read either as loose files on disk or directly from zenserver if it the data for them is internal to zenserver (ie: they have a valid  chunk id)
Remaining work:
- Pak mode of UnrealPak must be able to launch zenserver and pull data from it.

#rb PJ.Kack

[CL 34498668 by zousar shaker in ue5-main branch]
2024-06-19 10:15:01 -04:00
zousar shaker
a7b5faeaf0 Incremental step towards being able to stage to both a pak build as well as a nopak (streamng) build from a snapshot entirely stored in zenserver (no loose files on the filesystem except a ue.projectstore file).
Key changes:
- Removed the use of cookedfiles.manifest
- Changed IoStore mode of UnrealPak to  be capable of getting zenserver launch data from either a package store manifest (cbobject, metadata) OR a project store marker file (json)
- Ensured that the UAT and IoStore mode of UnrealPak can launch zenserver reliably by passing along the SponsorProcessId when launching zenserver
- Ensured that shader archives (and their accompanying json metadata files) can be read either as loose files on disk or directly from zenserver if it the data for them is internal to zenserver (ie: they have a valid  chunk id)
Remaining work:
- Pak mode of UnrealPak must be able to launch zenserver and pull data from it.

#rb PJ.Kack

[CL 34481636 by zousar shaker in ue5-main branch]
2024-06-18 17:33:46 -04:00
pj kack
7d49f13480 UnrealPak: Implement DDC2 async API for iostore compression.
BatchGet with max 128 inflight requests (or ~1 GiB in total) in batches of 8 items (or ~16 MiB each).
BatchPut with max 128 inflight requests (or ~256 MiB in total) in batches of 8 items (or ~1 MiB each).
Skip ddc for chunks smaller than CompressionMinBytesSaved (1KiB by default).
Skip ddc for .umap to avoid cache churn since maps are known to cook non-deterministically.
Skip ddc for shaders that use a different code path in UnrealPak as well as in runtime.
Use a new DDC2 cache key (that includes the CompressionBufferSize) and cache bucket.
Use TArray64/FMemoryWriter64 for serializing the data to support chunks bigger than 2 GiB.
Postpone allocation of compression buffers until the ddc get request completes and the size is known.
Reduce memory buffer limits to 2 GiB and 3 GiB again (earlier temporary bumps to 3 GiB and 4 GiB are not needed after recent task/retraction changes).
Add logging of number of ddc hits and puts.

#jira UE-204758
#rb paul.chipchase, Per.Larsson
#tests identical binary output

[CL 34451300 by pj kack in ue5-main branch]
2024-06-18 01:30:02 -04:00
zousar shaker
e622830c71 Add metadata files (including the DevelopmentAssetRegistry) to the zen filesystem manifest so that snapshots can include the data needed not just to run a game, but also package and iteratively cook one.
[CL 34393507 by zousar shaker in ue5-main branch]
2024-06-15 00:41:47 -04:00
danny couture
6345bd8b29 [TaskGraph/Misc]
- Replace BusyWait API calls to simple Wait

#rnx
#rb kevin.macaulayvacher

[CL 34315066 by danny couture in ue5-main branch]
2024-06-12 13:56:22 -04:00
pj kack
56e5eb8103 UnrealPak: Trivial rename of some IoStoreWriter.cpp variables.
From FChunkBlock::Size to FChunkBlock::DiskSize.
From FIoStoreWriteQueueEntry::CompressedSize to FIoStoreWriteQueueEntry::DiskSize.

#rb pj.kack
#tests identical binary output
#rnx

[CL 34306949 by pj kack in ue5-main branch]
2024-06-12 10:09:34 -04:00
dan engelbrecht
8b1ebc81f9 Add recovery of zenserver from project store operations in addition to the DDC recovery logic
#jira UE-211547
#rb zousar.shaker

[CL 34277558 by dan engelbrecht in ue5-main branch]
2024-06-11 11:06:44 -04:00
dan engelbrecht
c0bf74a232 Make sure we can read large files when saving loose files to non-local remote zenserver
#rb Zousar.Shaker
#jira UE-217522

[CL 34267114 by dan engelbrecht in ue5-main branch]
2024-06-11 04:25:36 -04:00