Commit Graph

142 Commits

Author SHA1 Message Date
devin doucette
70d0aea9a6 DDC: Added support for 64-bit sizes in the legacy cache
Includes an optimization to avoid an extra copy of data loaded from the cache.

#jira UE-103039
#preflight 6205f379b84973a2bb76d942
#lockdown Aurel.Cordonnier
#rb Zousar.Shaker

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18954059 in //UE5/Release-5.0/... via CL 18954686 via CL 18955089
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18955195 by devin doucette in ue5-main branch]
2022-02-11 12:56:47 -05:00
devin doucette
778a7d292b DDC: Added compression support to legacy cache values
The cache stores can individually control their "legacy mode" now, which offers a choice of ValueOnly, ValueWithLegacyFallback, LegacyOnly.
- Using ValueOnly will forward every legacy request through the Value API, which compresses values by default and supports values larger than 2 GiB.
- Using ValueWithLegacyFallback behaves like ValueOnly, but misses from GetValue are forwarded to GetCachedData, and stored with PutValue if found.
- Using LegacyOnly will forward every legacy request through the Legacy API.

FLegacyCacheValue uses shared state to ensure that each value is compressed or decompressed at most once.

#jira UE-134381
#preflight 62054b430c64e1822f41231b
#lockdown Mark.Lintott
#rb Zousar.Shaker
#rnx

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18940270 in //UE5/Release-5.0/... via CL 18941016 via CL 18941392
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18941401 by devin doucette in ue5-main branch]
2022-02-10 14:57:42 -05:00
devin doucette
517947112b DDC: Reorganized cache policy code into its own files
- FCacheRecordPolicyBuilder now disallows adding value policies with flags that only make sense for records.
- FCacheRecordPolicyBuilder now disallows adding multiple value policies for the same value.
- FCacheRecordPolicyBuilder now skips addition of value policies that match the default policy.

#rb Matt.Peters
#rnx
#preflight 61f471cc6b5aea38e5c64cb6

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18782116 in //UE5/Release-5.0/... via CL 18782123 via CL 18782168
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18782178 by devin doucette in ue5-main branch]
2022-01-28 20:34:31 -05:00
devin doucette
b6bc462f04 DDC: Made ICacheStore private and removed ICache::CancelAll
#rb Zousar.Shaker
#rnx
#preflight 61f2da78801201ab3862d5ac

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18756063 in //UE5/Release-5.0/... via CL 18756070 via CL 18758707
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18760714 by devin doucette in ue5-main branch]
2022-01-27 15:43:52 -05:00
devin doucette
b412a532ed DDC: Added MakeResponse(EStatus) to the cache request types
#rb Zousar.Shaker
#rnx
#preflight 61f1b88fc0033b39f89c8d84

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18744557 in //UE5/Release-5.0/... via CL 18744970 via CL 18745683
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18745958 by devin doucette in ue5-main branch]
2022-01-26 17:07:56 -05:00
zousar shaker
109bb67a95 Fix bug where serialization of delimeter character for CachePolicy serialization (comma ',') was being serialized as an int32 ("44") due to mixing of UTF8 builder and TCHAR character.
#rb matt.peters
#preflight 61f1997573238441cb66c9ea

#ROBOMERGE-AUTHOR: zousar.shaker
#ROBOMERGE-SOURCE: CL 18740488 in //UE5/Release-5.0/... via CL 18740829 via CL 18742806
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18743180 by zousar shaker in ue5-main branch]
2022-01-26 15:35:13 -05:00
matt peters
464d8e698f CachePolicy: Add Save/Load to StringBuilder.
CacheRecordPolicy: Add Save/Load to CompactBinary
#rb Devin.Doucette
#rnx
#preflight 61f005391f5c4c6f64941707

#ROBOMERGE-AUTHOR: matt.peters
#ROBOMERGE-SOURCE: CL 18722255 in //UE5/Release-5.0/... via CL 18722342 via CL 18722401
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18722411 by matt peters in ue5-main branch]
2022-01-25 09:50:39 -05:00
devin doucette
6ab080890c DDC: Renamed cache request and response types from Chunk to GetChunk
#rb Zousar.Shaker
#rnx
#preflight 61e5ec410705ece855b8da74

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18635634 in //UE5/Release-5.0/... via CL 18635654 via CL 18635655
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18637582 by devin doucette in ue5-main branch]
2022-01-18 04:47:59 -05:00
devin doucette
836757d1c2 DDC: Moved GDDCIOThreadPool out of Core
The DDC thread pool is a temporary workaround for issues with high-latency cache accesses happening on regular worker thread, which are reduced in number in 5.0 compared to 4.27. Moving it to be private within DDC will keep it easy to remove once the high-latency caches are accessed through an async API.

#rb Zousar.Shaker
#rnx
#preflight 61e5b194873f2ea48f3e0b02

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18634975 in //UE5/Release-5.0/... via CL 18634980 via CL 18634997
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18637555 by devin doucette in ue5-main branch]
2022-01-18 04:45:24 -05:00
devin doucette
0888c913f5 DDC: Fixed an assert when doing a put from a cache plugin
#jira UE-139259
#rb Zousar.Shaker
#rnx
#preflight 61e1b9c23a6da83197bbad07

#ROBOMERGE-OWNER: Devin.Doucette
#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18620142 in //UE5/Release-5.0/... via CL 18620423 via CL 18620470
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18620499 by devin doucette in ue5-main branch]
2022-01-14 13:35:25 -05:00
devin doucette
1883382ae7 DDC: Added functions to transform a cache policy and build policy
#rb Zousar.Shaker
#rnx
#preflight 61e0aa6e341d372424e948f1

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18617338 in //UE5/Release-5.0/... via CL 18617349 via CL 18617359
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18617376 by devin doucette in ue5-main branch]
2022-01-14 09:48:40 -05:00
devin doucette
3725815687 DDC: Added ILegacyCacheStore and folded the key length limit into the new FLegacyCacheKey
This API adds a little bit of overhead but, in exchange:
- Offers a path to migrate to the new Value API.
- Offers a path to provide compression while falling back to the previous format.
- Offers a path to backends batching requests without consuming a worker thread.
- Avoids copying the value multiple times during async puts.

#rb Zousar.Shaker
#rnx
#preflight 61e0a32fed50181feb57c5d6

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18607028 in //UE5/Release-5.0/... via CL 18607056 via CL 18607101
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18607126 by devin doucette in ue5-main branch]
2022-01-13 17:30:44 -05:00
devin doucette
394fd0642b DDC: Made the backend namespaces consistent in advance of introducing ILegacyCacheStore
#rb Zousar.Shaker
#rnx
#preflight 61e04880250b9537f77549d7

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18597466 in //UE5/Release-5.0/... via CL 18597469 via CL 18597485
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18597488 by devin doucette in ue5-main branch]
2022-01-13 11:09:29 -05:00
devin doucette
32844891bd DDC: Do not pass null completion callbacks from ICache into ICacheStore
#rb Zousar.Shaker
#rnx
#preflight 61dc80c4892dee612b348b71

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18565644 in //UE5/Release-5.0/... via CL 18565663
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18565672 by devin doucette in ue5-release-engine-test branch]
2022-01-10 16:54:04 -05:00
devin doucette
5c5ec11c61 DDC: Added a value API to ICacheStore
The new API is only implemented for the file system cache store for now. Support for the other cache stores will follow.

#rb Zousar.Shaker
#rnx
#preflight 61d93dd9411c1403a3ee8758

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18561274 in //UE5/Release-5.0/... via CL 18561311
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18561332 by devin doucette in ue5-release-engine-test branch]
2022-01-10 12:13:18 -05:00
devin doucette
35393bbb2b DDC: Split FPayload into separate FValue and FValueId types
A payload was conceptually a value with an ID. That has been formalized by removing the ID from the payload and having separate FValue and FValueId types. This separation cleans up the API in a few areas, and provides a more natural path to providing a basic key/value API.

#rb Zousar.Shaker
#rnx
#preflight 61d704c04c252480ca284d61

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18531844 in //UE5/Release-5.0/... via CL 18531856
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18531864 by devin doucette in ue5-release-engine-test branch]
2022-01-06 11:05:57 -05:00
devin doucette
48f68493ef DDC: Removed the Put/Get compatibility functions from ICache
#rb Zousar.Shaker
#rnx
#preflight 61d49a971a3fd09dcbc87978

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18511490 in //UE5/Release-5.0/... via CL 18511542
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18511622 by devin doucette in ue5-release-engine-test branch]
2022-01-04 14:38:48 -05:00
devin doucette
8e3ba57e91 DDC: Moved the ICacheStore Context params to be a Name member of the request types and return them in the completion params
#rb Zousar.Shaker
#rnx
#preflight 61d3729eaf44b43628f4bdc9

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18507435 in //UE5/Release-5.0/... via CL 18507440
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18507451 by devin doucette in ue5-release-engine-test branch]
2022-01-04 09:26:33 -05:00
devin doucette
0f14d13c88 DDC: Fixed the logged cache summary stats
Stats from the root node must be a superset of stats from the rest of the nodes. The key length limiter is always the root node at present, and has been updated to include stats for the structured cache.

#rb Zousar.Shaker
#rnx
#preflight 61d318cc932a02483cb29797

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18501391 in //UE5/Release-5.0/... via CL 18501397
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18501400 by devin doucette in ue5-release-engine-test branch]
2022-01-03 11:24:10 -05:00
charles bloom
d6c8d22b81 Fix DDC should not sanitize $ characters because it makes $ characters
SanitizeCacheKey and ValidateCacheKey should check the same condition

#rb devin.doucette, danny.couture

#ROBOMERGE-AUTHOR: charles.bloom
#ROBOMERGE-SOURCE: CL 18455963 in //UE5/Release-5.0/... via CL 18455975
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v898-18417669)

[CL 18455987 by charles bloom in ue5-release-engine-test branch]
2021-12-14 12:35:14 -05:00
devin doucette
4d164bdfd5 DDC: Added a uint64 UserData to ICacheStore requests to make completion callbacks more efficient
Requests to Put and Get now specify the policy independently for each record or key, but the implementations have not yet been updated to take this into account.

The existing Put and Get API has been maintained temporarily to allow the conversion to happen separately, and will be removed after callers have been converted to use the new API.

#rb Zousar.Shaker
#rnx
#preflight 61b2e550ee0de9822e2e84dc

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18443052 in //UE5/Release-5.0/... via CL 18445037
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18445201 by devin doucette in ue5-release-engine-test branch]
2021-12-13 13:32:28 -05:00
devin doucette
53f316587b DDC: New filesystem cache store directory layout and file format
- Implemented only for the structured cache initially.
- Records are stored as compact binary packages with payloads stored within the record if small enough.
- Records are stored in Records/{Bucket}/{01}/{23}/{456789abcdef0123456789abcdef01234567} based on the hash in the cache key.
- Content that exceeds the size allowed for storage within the record is stored in Content/{01}/{23}/{456789abcdef0123456789abcdef01234567} based on the hash of the content.
- Both records and content are written to disk with their hash as a suffix, and are always checked on load.
- Maximum size of compressed data stored in the package can be configured by MaxRecordSizeKB and MaxValueSizeKB.
- Maintenance of the cache, to delete unused files, has been rewritten and can now scan ~175k files/second on modern hardware, though is limited to 10k files/second in the config to avoid adding too much overhead.

#rb Zousar.Shaker
#preflight 618b75c14a0c609a29204032
#preflight 618bfb5ec717ba4e929b7ac0

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18133085 in //UE5/Release-5.0/... via CL 18133356
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v889-18060218)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 18133430 by devin doucette in ue5-release-engine-test branch]
2021-11-10 13:08:00 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
devin doucette
3331f68391 DDC: Added ECachePolicy::PartialOnError and implemented partial cache records in the filesystem and memory backends
#rb Zousar.Shaker
#rnx
#preflight 615f703dcec44a000146cf80

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 17759092 in //UE5/Release-5.0/... via CL 17760688
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v879-17706426)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17760906 by devin doucette in ue5-release-engine-test branch]
2021-10-08 11:01:21 -04:00
Devin Doucette
a077feffbd DDC: Reworked ICacheStore to allow partial records, filtering of payloads, and loading parts of payloads
- ICacheStore::Put() has updated documentation to reflect the requirements of partial records.
- ICacheStore::Get() now takes a FCacheRecordPolicy, which is implicitly constructible from ECachePolicy, and allows setting the policy by payload.
- ICacheStore::GetPayload() is replaced by ICacheStore::GetChunks(), which allows loading parts of payloads.
- ICacheStore::CancelAll() is moved to ICache::CancelAll() because the cache can track requests at the top level and cancel them without exposing cancellation on individual cache stores.
- ECachePolicy::SkipLocalCopy has been removed because it is difficult to reason about.
- ECachePolicy::SkipData flags now have a documented meaning for put requests, to hint that record existence implies payload existence.
- The filesystem and memory cache stores have been updated to support partial records, filtering of payloads, and loading parts of payloads.
- Requesting part of a payload will decompress the entire payload for now, until compressed buffers expose a way to decompress only part.
- Fixed a bug in FTexturePlatformData::AreDerivedMipsAvailable() that caused it to return false for structured cache keys.

#rb Zousar.Shaker
#rnx
#preflight 615e03241ed62f0001b95454

#ROBOMERGE-OWNER: Devin.Doucette
#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 17748550 in //UE5/Release-5.0/... via CL 17748555
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v879-17706426)
#ROBOMERGE-CONFLICT from-shelf
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17748602 by Devin Doucette in ue5-release-engine-test branch]
2021-10-07 09:11:32 -04:00