Skip to content

Comments

Android/fix evalue string serialization#17609

Draft
kirklandsign wants to merge 2 commits intomainfrom
android/fix-evalue-string-serialization
Draft

Android/fix evalue string serialization#17609
kirklandsign wants to merge 2 commits intomainfrom
android/fix-evalue-string-serialization

Conversation

@kirklandsign
Copy link
Contributor

Summary

toByteArray() used toString() (returning "EValue@...") instead of
toStr(), and allocated the buffer using char count instead of byte
count. fromByteArray() threw an exception for strings instead of
deserializing them. Fix both directions using a length-prefixed
format, and also fix the misleading "Unknown Tensor dtype" error
message. Add round-trip tests for ASCII, empty, and Unicode strings.

Test plan

CI

toByteArray() used toString() (returning "EValue@...") instead of
toStr(), and allocated the buffer using char count instead of byte
count. fromByteArray() threw an exception for strings instead of
deserializing them. Fix both directions using a length-prefixed
format, and also fix the misleading "Unknown Tensor dtype" error
message. Add round-trip tests for ASCII, empty, and Unicode strings.
Chinese (3-byte UTF-8) and emoji (4-byte UTF-8 + surrogate pairs)
cover more encoding edge cases than Japanese hiragana alone.
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 21, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17609

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 New Failures, 1 Unrelated Failure

As of commit 8d18fec with merge base cf08087 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 21, 2026
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant