Refactor Packable Format with AssetStore, Caching & Checksum Improvements#18
Merged
afshawnlotfi merged 4 commits intomainfrom Feb 4, 2026
Merged
Refactor Packable Format with AssetStore, Caching & Checksum Improvements#18afshawnlotfi merged 4 commits intomainfrom
afshawnlotfi merged 4 commits intomainfrom
Conversation
- Removed test_load_array.py as it is no longer needed. - Updated test_mesh.py to use Array type for normals and colors in CustomMesh. - Modified test_packable.py to replace np.ndarray with Array in Packable subclasses. - Enhanced test_resource.py to validate Resource and ResourceRef functionality, including checksum calculations and eager loading. - Adjusted tests to ensure proper handling of Resource fields in Packable extraction and reconstruction. - Improved lazy loading tests to verify correct behavior with Resource fields and arrays.
…lication and add save/load methods to Packable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a major refactor of the meshly serialization format, replacing the legacy packed array format with a cleaner, content-addressable asset-based approach. It also adds the
AssetStorefor file-based asset management with deduplication, enhances caching mechanisms, and improves the overall developer experience.Key Changes
🏗️ New Serialization Format
metadata/data.json+metadata/schema.json+assets/{checksum}.bin$refobjects with embedded metadata (shape,dtype,itemsize)vertex_buffer,index_sequence,array)📦 AssetStore Implementation
AssetStoreclass for file-based asset management with content-addressable storagesave()andload()convenience methods toPackable__repr__for better debugging⚡ Caching & Performance
AssetCacheclass with IndexedDB-backed LRU caching for browser environmentscreateCachedProvider()helper for wrapping fetch functions with caching🔧 API Improvements
ExportConstants,JsonSchema,JsonSchemaUtilsfor format handlingArrayUtils.decodeFromRefInfo()for decoding from new$refformatDataHandler,CachedAssetLoaderin favor of simplerAssetProviderPackable.extract()andPackable.reconstruct()APIsmarkerIndices→markers,markerOffsets→markerSizes,markerTypes→markerCellTypes🧪 Test Improvements
Arraytype consistentlyResourcehandling in teststest_asset_store.pyforAssetStorecoveragetest_extract_assets.py,test_load_array.py)Breaking Changes
DataHandlerandCachedAssetLoaderremoved—useAssetCacheandAssetProviderinsteadMeshMetadataandMeshSizeremoved—metadata is now embedded in$refobjectsmarkerIndices→markers, etc.)Migration Guide
Python: