Skip to content

Conversation

@Helco
Copy link
Owner

@Helco Helco commented Oct 30, 2024

Some time ago I theorized that the asset registry has a race condition regarding the order of apply actions (see #344). Also during development of an asset validation command I discovered a very real deadlock (see #386) which can happen when secondary assets fail to load and some (in hindsight) shoddy locking mechanisms in Asset.PrivateLoad

I now want to:

  • Add sufficient amount of unit tests before reworking
  • Rework locking mechanism of Asset.PrivateLoad
  • Add proper asynchronous loading of assets (for parallel tools) alongside the synchronous interface (for gameplay)
  • Prevent any synchronous waits outside of the main thread
  • (at least attempt to) Prevent any asynchronous waits without cancellation tokens registered
  • Workaround STA not being available on Linux (causing NUnit to not be single-threaded)
  • Fix smaller bugs and refactorings when convenient, e.g.:
    • AssetHandle equality
    • AssetHandle.Registry in regards to local registries and handle scopes
    • Inspecting all exceptions from secondary asset loads or multiple primary asset loads
    • Prevent recursive asset dependencies
  • Misc TODOs:
    • Dispose stored secondary handles in all game assets
    • Add tests for AssetHandleScope
    • Add tests for IAssetRegistryStats
    • Retest game before merge
    • Retest validation command before merge

Helco added 28 commits April 3, 2025 10:47
More test cases (with two currently failing)
This breaks everything eeeveen further
@Helco Helco force-pushed the async-asset-registry branch from 1bd8b75 to 39a95ae Compare April 3, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant