Commit Graph

1709 Commits

Author SHA1 Message Date
ben marsh
34e682d7a2 Horde: Updated bundle file format and addressing scheme. Not yet enabled by default.
File format:
* Bundles are now just a stream of packets, but packets follow the stanard bundle signature format, allowing interop with older file formats.
* All import/export information is stored in packets, allowing them to be decoded without reading the a monolithic bundle header. Previous implementation did not factor in the size of header metadata with bundles, nor the size of supporting data structures, which could dwarf the size of payload data. Splitting headers into separate packets allows us to separate the packet size from read size, and still allows "over-reading" of bundles to prefetch additional coherent data for low-latency connections.

Locators:
* Blob locators now have a standard URI syntax; the #fragment portion of the URI identifies an embedded resource within the bundle, with parameters encoded using media-fragment syntax.
* Blob locators now encode the packet offset and length to support reading of individual packets.
* Packets and exports can be referenced directly with the same scheme, eg. bundle: "foo/bar", packet: "foo/bar#pkt=100,0", export: "foo/bar#pkt=100,0&exp=4".
* The packet import table now encodes arbitary string locators for each individual export in a prefix tree, with each node being a cachable handle to an individual blob object.
* Since blob locators are now effectively standard URIs, we can use them to link to content on other servers, or to link between separate endpoints on the same server.

Interop:
* Bundle writer options now include a setting for the maximum version number to use when writing bundles, allowing both codebases to exist side by side.
* Added separate LatestV1 and LatestV2 version number constants to identify encoding scheme to use before we migrate fully to V2 encoding.

Resource usage:
* Writes between layers in the write pipeline - with the exception of compression - are now done into final buffers, reducing the churn on memory allocations causing requiring frequent GC runs.
* Buffers allocated in the write process reserve memory against a fixed memory limit tracked in BundleCache; buffers allocated for asynchronous writes will now cause items to be purged from the cache to stay below the fixed memory limit.
* Buffers are reference counted, and can transfer ownership to the cache layer once unlocked.
* Buffers are now manually allocated and freed on the unmanaged heap to avoid needing to trigger the garbage collector.

Misc:
* The cache supports async initiatlization of values, fixing previous issue where multiple writes are executed.
* Handles now support equality comparisons to avoid having to construct temporary string objects for cache keys.

#jira

[CL 29599111 by ben marsh in ue5-main branch]
2023-11-09 11:46:56 -05:00
ben marsh
8f70f57c47 Horde: Remove default implementation of IBlobHandle.FlushAsync.
#jira

[CL 29587866 by ben marsh in ue5-main branch]
2023-11-08 22:07:44 -05:00
ben marsh
53f183b286 Horde: Allow storing arbitrary IDisposable data along with BlobData objects, rather than requiring an IReadOnlyMemoryOwner.
#jira

[CL 29563878 by ben marsh in ue5-main branch]
2023-11-08 11:57:37 -05:00
ben marsh
a7a017106a Horde: Improved cache for reading bundles.
* Now supports caching of generic async operations, with resource accounting done by explicit calls to acquire disposable objects.
* When a resource is requested that would exceed the hard limit specified in an option, cache items are purged until the resource can be satisfied.
* Items in the cache are reference counted, and will not be purged while referenced.

#jira

[CL 29563686 by ben marsh in ue5-main branch]
2023-11-08 11:51:04 -05:00
ben marsh
3869d6991c Horde: Rename INodeReader -> IBlobReader and INodeWriter -> BlobWriter.
#jira

[CL 29527908 by ben marsh in ue5-main branch]
2023-11-07 14:08:36 -05:00
ben marsh
7acd01bd34 EpicGames.Core: Add a deterministic memory allocator to EpicGames.Core for use with large allocations, reducing pressure on the LOH.
* Currently supports allocation from the global heap (GlobalHeapAllocator), through memory mapped files (VirtualMemoryAllocator), or through the standard .NET shared MemoryPool (PoolAllocator).
* ChunkedMemoryWriter now accepts an optional IMemoryAllocator argument for configuring where to obtain chunks from, defaulting to the previous behavior of using the shared .NET memory pool.
* Added a RefCountedMemoryWriter class which can implement reference counting on handles returned by IMemoryAllocator instances.

#jira

[CL 29523179 by ben marsh in ue5-main branch]
2023-11-07 12:09:28 -05:00
ben marsh
66829761be Horde: Change BlobHandle to be an interface so writer interfaces can also implement it.
#jira

[CL 29509421 by ben marsh in ue5-main branch]
2023-11-06 20:47:29 -05:00
ben marsh
03a25fcbe5 EpicGames.Core: Add a utility class for managing a reference counted object, running a custom disposer when the refcount reaches zero. Also modify IReadOnlyMemoryOwner to support a custom disposer (which may be a ref-counted handle).
#jira

[CL 29506301 by ben marsh in ue5-main branch]
2023-11-06 19:14:58 -05:00
ben marsh
8f84b395b6 Horde: Support nested blob handles, and return separate identifiers from each.
#jira

[CL 29505428 by ben marsh in ue5-main branch]
2023-11-06 18:55:15 -05:00
ben marsh
ccc5dfdf8a Horde: Rename BundleReaderCache to BundleCache. Will be used for tracking write data also.
#jira

[CL 29495211 by ben marsh in ue5-main branch]
2023-11-06 14:14:33 -05:00
ben marsh
454c01b8f4 Fix race waiting for empty event in ThreadPoolWorkQueue before disposing it.
#rb Mattias.Jansson

[CL 29488309 by ben marsh in ue5-main branch]
2023-11-06 10:27:36 -05:00
tim smith
e3e873e820 Cleaned up wording of confusing error message.
#rnx
#rb tim.smith

[CL 29485195 by tim smith in ue5-main branch]
2023-11-06 06:37:54 -05:00
carl bystrom
b196c09157 Horde: Add connection preference parameter to compute client
[CL 29381676 by carl bystrom in ue5-main branch]
2023-11-02 17:39:13 -04:00
joe kirchoff
2af1531909 Rename Box -> UBA
#rnx
#jira UE-198632

[CL 29328890 by joe kirchoff in ue5-main branch]
2023-11-01 15:35:29 -04:00
andrew scheidecker
91489e5c60 Add an optional Verse language version field to uplugins. There's currently only one valid version: 0.
#rb Markus.Breyer

[CL 29275425 by andrew scheidecker in ue5-main branch]
2023-10-31 10:57:17 -04:00
joe kirchoff
89e61b9c33 UnrealBuildTool: Rename some shared classes
#rnx
#jira UE-198294

[CL 29258027 by joe kirchoff in ue5-main branch]
2023-10-30 19:40:57 -04:00
ben marsh
43f9819d8b EpicGames.Core: Trim whitespace from the end of log lines before trying to parse JSON log events. Fixes output from child UBT processes (which have trailing CR/LF characters) from being parsed of JSON log events.
#jira UE-197915

[CL 29181514 by ben marsh in ue5-main branch]
2023-10-27 10:05:40 -04:00
ben marsh
44e76df913 Horde: Compute service fixes for older clients.
* Pass 128mb as the read length when reading entire bundles. Older clients do not support passing 0 to indicate 'entire blob'.
* Fix requests to read zero bytes resulting in remote not sending any response packets.
* Always create a cache for bundle data when reading from the remote. Since we always over-read from the source bundle, disabling the cache results in re-reading entire bundles multiple times. Not observed previously due to BundleReaderCache.None actually using the default cache size.

[FYI] Bryan.Johnson, Ryan.Hummer, Carl.Bystrom
#jira

[CL 29159721 by ben marsh in ue5-main branch]
2023-10-26 20:43:30 -04:00
carl bystrom
9af9ab8df8 Horde: Add connection mode preference for allocating compute resources
[CL 29148722 by carl bystrom in ue5-main branch]
2023-10-26 16:26:51 -04:00
tim smith
15a80cd16c Improved error message with TObjectPtr appearing in function signatures.
#rb tim.smith

[CL 29129481 by tim smith in ue5-main branch]
2023-10-26 07:26:13 -04:00
carl bystrom
b928b7579c Horde: Add support for tunneling in ServerComputeClient
[CL 29096194 by carl bystrom in ue5-main branch]
2023-10-25 14:18:12 -04:00
ben marsh
c0a4b03a21 Horde: Add an overload to read data for a blob without reading an entire BlobData object.
#jira

[CL 29094194 by ben marsh in ue5-main branch]
2023-10-25 13:34:24 -04:00
ben marsh
27ef216d18 Horde: Missing file.
#jira

[CL 29092036 by ben marsh in ue5-main branch]
2023-10-25 12:19:22 -04:00
ben marsh
a57ddebef3 Horde: Add value semantics to blob handles, so they can be used as cache keys.
#jira

[CL 29091839 by ben marsh in ue5-main branch]
2023-10-25 12:14:56 -04:00
carl bystrom
e433f9e3eb EpicGames.Perforce: Add support for updating streams
[CL 29089306 by carl bystrom in ue5-main branch]
2023-10-25 11:03:49 -04:00