Skip to content

feat(resources): Migrate resource consumers to ResourceManager system - #785

Draft
ChronosWS wants to merge 13 commits into
PommeMC:masterfrom
ChronosWS:feat/resource-manager
Draft

ChronosWS wants to merge 13 commits into
PommeMC:masterfrom
ChronosWS:feat/resource-manager

Conversation

@ChronosWS

@ChronosWS ChronosWS commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #822

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor / code cleanup
  • Performance improvement
  • Chore / tooling
  • Documentation

Overview

This is the companion to PR #822 which introduces the Resource system. This migrates from the original per-consumer serialization and resource handling code to the centralized system with shared loading and consistent lookup/behavior. Additionally, live resource pack changes are now supported while you are connected to a game server. No general asset-format rewrite is included; the aim is more consistent and extensible resource handling.

  • All non-shader resource access now goes through the new ResourceManager
  • Dynamic reloading of resources is supported, including changing resource packs while in a connected state
  • Headless use cases are also migrated to this system.

Compatibility

  • Some Pomme-specific behavior, such as how panorama faces, have been removed in favor of the Vanilla behavior now that fallback is supported by the resource system itself. This is unlikely to be noticed in practice unless someone is building broken themes.

Review Notes

Most of the changes in this PR are relatively mechanical and so hopefully are easy to review. Idiosyncratic resource access is replaced by calls to the ResourceManager. Resource id's now have a typed constructor (including compile-time variants). Asset loading is not refactored here but the edges of that system are touched. Unit tests for the ResourceManager don't appear here - they are in #822.

Testing and validation

Validation State
just client-pre-pr Passed: formatting, all five strict Clippy commands, 1,617 tests passed, 0 failed, 1 skipped. Includes the ignored singleplayer opens_two_worlds_in_one_process test.
cargo check -p pomme-client --all-targets Passed.
Same all-target check with --features test-harness,cpu-bench,ttf-fonts Passed.
git diff --check Passed.

Validation used the pinned nightly toolchain and Vulkan SDK 1.4.363.0 sourced with setup-env.sh --set-dep-ld. The default-feature check and client test build emit two non-fatal dead-code warnings (Action::default_key and TerrainVertices::vanilla); the official strict Clippy gates pass. This does not claim exhaustive coverage of every resource API or platform.

Manual validation has also been completed, including theme changes and adding/removing resource packs during a connected session.

@github-actions github-actions Bot added the merge conflict Conflicts with the base branch and needs a merge label Oct 26, 2026
@ChronosWS
ChronosWS force-pushed the feat/resource-manager branch from 9e0d09f to ca679b1 Compare October 26, 2026 14:46
@github-actions github-actions Bot removed the merge conflict Conflicts with the base branch and needs a merge label Oct 26, 2026
@github-actions github-actions Bot added the merge conflict Conflicts with the base branch and needs a merge label Oct 27, 2026
@ChronosWS
ChronosWS force-pushed the feat/resource-manager branch from 9fae734 to e50daea Compare October 28, 2026 00:40
@github-actions github-actions Bot added merge conflict Conflicts with the base branch and needs a merge and removed merge conflict Conflicts with the base branch and needs a merge labels Oct 28, 2026
Introduce the byte/provider layer, resource configuration, registry and metadata APIs without changing decoding or wiring migration consumers. Temporarily allow dead_code and unused_imports only on the Resources module declaration; the dependent migration removes this allowance.
@github-actions github-actions Bot removed the merge conflict Conflicts with the base branch and needs a merge label Oct 29, 2026
@github-actions github-actions Bot added the merge conflict Conflicts with the base branch and needs a merge label Oct 29, 2026
@github-actions github-actions Bot removed the merge conflict Conflicts with the base branch and needs a merge label Oct 29, 2026
@ChronosWS ChronosWS changed the title feat: introduce shared resource management and migrate asset consumers feat(resources): Migrate resource consumers to ResourceManager system Oct 29, 2026
@github-actions github-actions Bot added enhancement New feature or request refactor merge conflict Conflicts with the base branch and needs a merge and removed merge conflict Conflicts with the base branch and needs a merge labels Oct 29, 2026
Replace the obsolete Resources engine with pack backends, suppliers, repository sources, and reloadable managers.

Initialize resource views in AppCore and retain verified installer JARs for format metadata. Preserve the existing asset stack while consumer adoption remains deferred.
Add 211 API-focused resource tests with shared trait assertions and backend fixtures, including test-only supplier helpers and RAII cleanup.

Fix ZIP empty-directory listing parity discovered by the regression tests: construct the prefix as root + directory + slash, matching Vanilla even for an empty directory.
Add direct ResourceId::from_parts construction with private parsing helpers.

Add 15 black-box path_validation cases covering resource representability and pack path containment.
Make selected resource content transferable through Arc suppliers and Send readers, with pinned ZIP generations and atomic close state.

Load the sound registry from the active resource manager and hand selected content to the audio worker for decoding. Invalidate cached buffers on resource activation while retaining incremental streaming without buffering full encoded audio.

Plumb borrowed resources through existing audio callers and update the resource contract documentation.
Move remaining non-shader consumers to ResourceManager with typed and
constant resource IDs and resource-backed font, model, and texture reads.
Integrate local and server pack selection with the shared resource view,
separate application activation from UI catalog capabilities, and bootstrap
headless and benchmark consumers through resources.

Remove the legacy resource-pack manager and filesystem resolver. Preserve
the separate audio migration and the resource-system foundation beneath it.
@ChronosWS
ChronosWS force-pushed the feat/resource-manager branch from 3701f46 to f0fd90b Compare November 2, 2026 14:34
@github-actions github-actions Bot removed the merge conflict Conflicts with the base branch and needs a merge label Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant