Repository navigation
[Bugfix][Wheel] Preserve PIL image state in structured transfer - #3412
Open
zxpdemonio wants to merge 1 commit into
Open
zxpdemonio wants to merge 1 commit into
zxpdemonio wants to merge 1 commit into
Conversation
11 of 30 tasks
zxpdemonio
force-pushed
the
cruz/fix-pil-codec
branch
from
August 14, 2026 03:09
d0257d6 to
80b8792
Compare
13 of 31 tasks
9 of 22 tasks
This branch has not been deployed
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.
Description
The structured media codec previously serialized a PIL image as raw pixels only. GET could reconstruct the pixels, but it lost image state such as the original format, palette, EXIF, ICC profile, and other entries from
Image.info. Encoded PNG and JPEG byte payloads also need to remain byte-exact rather than being decoded and re-encoded.This PR adds a framed binary representation for PIL entries in structured non-tensor fields. It stores raw pixels and validated msgpack state as payload members, while the existing offsets continue to provide row-level partial reads. PNG/JPEG byte entries remain unchanged and byte-exact. The decoder restores the PIL mode, size, format, palette, and supported
Image.infostate, and preserves the existing raw-byte fallback when Pillow is unavailable.The implementation keeps image state out of the bundle manifest/catalog, reuses the existing structured codec and chunk planning paths, and retains BufferPool owners for zero-copy-compatible decoded images until
release_result()is called.Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
Test results:
Result:
99 passed, 29 skipped. The skipped tests require a working Torch/CUDA runtime; the test host has a pre-existing Torch/CUDA shared-library mismatch. Manual coverage included PNG/JPEG encoded-byte preservation, common PIL modes, palette images, EXIF/ICC state, partial row reads, malformed state rejection, missing-Pillow fallback, and BufferPool owner release.Checklist
./scripts/code_format.shPython formatting was intentionally not run to avoid unrelated formatting churn in the existing Python files.
py_compileandgit diff --checkpass.AI Assistance Disclosure
Codex was used to inspect the existing structured codec, implement the focused fix, review failure and lifecycle paths, and run the validation matrix. The submitter reviewed the final diff and test results.