Skip to content

Make MPQ attributes loading opt-in - #61

Open
draxxris wants to merge 1 commit into
wowemulation-dev:mainfrom
draxxris:mpq-attributes-opt-in
Open

Make MPQ attributes loading opt-in#61
draxxris wants to merge 1 commit into
wowemulation-dev:mainfrom
draxxris:mpq-attributes-opt-in

Conversation

@draxxris

Copy link
Copy Markdown

Pull Request

Summary

Large HD archives can require excessive memory when loading optional attributes metadata. Callers that do not need this metadata should be able to skip it safely.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test improvements
  • Build system/dependency changes
  • Security fix

Changes Made

  • Add an OpenOptions::load_attributes switch.
  • Allow large MPQ archives to skip optional (attributes) metadata.
  • Preserve (attributes) discoverability.

Testing

cargo test --manifest-path Cargo.toml -p wow-mpq test_attributes_loading_can_be_skipped

Test Cases Added/Modified

  • Unit tests
  • Integration tests
  • Compliance tests (StormLib compatibility)
  • Performance benchmarks
  • Manual testing

Test Results

$ cargo test --manifest-path Cargo.toml -p wow-mpq test_attributes_loading_can_be_skipped
...
running 1 test
test archive::tests::test_attributes_loading_can_be_skipped ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 184 filtered out; finished in 0.00s

     Running tests/buffer_pool_integration.rs (target/debug/deps/buffer_pool_integration-3a2bf3e8ad5788f3)

Tested On

  • Linux
  • macOS
  • Windows
  • Cross-compilation targets

WoW Versions Tested

  • 1.12.1 (Vanilla)
  • 2.4.3 (TBC)
  • 3.3.5a (WotLK)
  • 4.3.4 (Cataclysm)
  • 5.4.8 (MoP)
  • Other: Custom game engine that uses only MPQ assets, not WoW itself

Quality Assurance

Code Quality

  • Code follows project style guidelines
  • Self-review of code completed
  • Code is properly documented
  • No obvious performance regressions
  • Error handling is appropriate

Add an OpenOptions switch for optional (attributes) metadata so large archives can open without the multi-gigabyte metadata allocation. Keep the metadata entry discoverable and add a fixture that verifies both skipped and explicit loading paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant