Repository navigation
[CoreAI] Reject mutated user inputs at lowering - #23317
Merged
Merged
Conversation
Summary: List every delivered file with its byte size, and a SHA-256 digest per bundle, in the delegate manifest for both inline and sidecar delivery, so a runtime can check the payloads it reads and key its cache on bundle contents. The digest covers a fixed prefix, the file count, and each file's path, size and bytes in UTF-8 path order. `files` changes from a list of paths (inline only) to a map of path to size. Test Plan: ``` python -m pytest backends/apple/coreai ``` 126 passed (coreai-core 1.0.0b3, coreai-torch 0.4.3).
Summary: ExecuTorch owns user inputs, so a Core AI delegate can never take over their in-place mutation. `CoreAIBackend.preprocess` now rejects a delegate whose program mutates a user input, naming the inputs, before conversion. Mutated buffers the delegate owns are unaffected. Test Plan: ``` python -m pytest backends/apple/coreai ``` 126 passed (coreai-core 1.0.0b3, coreai-torch 0.4.3).
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23317
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 1 PendingAs of commit d47e711 with merge base 273ecf9 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
metascroy
marked this pull request as ready for review
October 1, 2026 17:27
SS-JIA
approved these changes
Oct 1, 2026
This branch was successfully 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.
ExecuTorch owns user inputs, so a Core AI delegate can never take over their in-place mutation.
coreai-torchlowers such a mutation to Core AI state, which leaves the.aimodelboundary unable to match what ExecuTorch passes in.CoreAIBackend.preprocessnow raises before conversion when the program mutates a user input:Core AI delegates cannot mutate ExecuTorch-owned user inputs: [...].test_io_compat.py):test_mutated_user_input_is_rejectedlowers a model that mutates its input and expects the error.MutableBufferBoundaryTestdocstring now describes the current behavior.Test plan:
python -m pytest backends/apple/coreaigives 126 passed.