Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23390
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 211367d with merge base 61ec450 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
9d457ae to
84780b8
Compare
f74a984 to
68a8b17
Compare
|
@claude review this PR |
|
Claude finished @metascroy's task in 2m 44s —— View job PR Review: #23390I found no blocking correctness bugs. The main issues are that source publication skips the full device flush that bookmark publication uses, even though a damaged bundle is never replaced; the failure paths described in the README are not tested; and the Detailed reviewSummaryThis PR adds Code Quality
API Design
Testing
Performance
RecommendationNeeds Discussion Nothing here is a crash or a data race. Before merging, it's worth settling the durability-vs-no-replacement point (add |
84780b8 to
e36e1ed
Compare
68a8b17 to
65217f5
Compare
|
@claude review this code Updated head: Context on the previous findings: cache identity is supplied by the caller and already includes the selected bundle's export-time digest plus platform/SDK context. We documented that contract rather than deriving a digest-only key inside source preparation. The no-replacement policy and absence of runtime content hashing are intentional. Abandoned-temporary recovery must not blindly sweep another active loader's files; it is separate from normal failure cleanup. Batching repeated directory syncs remains a potential optimization requiring measurement and care with durability ordering, not an established correctness defect. Durability, error propagation, and focused failure-path coverage were strengthened. |
|
Claude finished @metascroy's task in 4m 9s —— View job PR Review: #23390The fixes from the last round hold up and I found no blockers: the manifest path check doesn't account for macOS filename case folding or Unicode normalization, and a few failure-path tests are weaker than they appear. Detailed reviewSummaryThis PR adds The changes from the last round are correct:
The issues below are about manifest path validation and how strong the tests are. Code Quality
API Design
Testing
RecommendationApprove Nothing here blocks merging. The case-folding and Unicode checks in |
65217f5 to
afd4d5a
Compare
e36e1ed to
aaf5f40
Compare
Summary:
Materialize the selected Core AI source bundle on disk under the assets root,
so the SDK can specialize it.
- Source preparation (`runtime/coreai_assets.{h,mm}`): read inline bundle
files through `NamedDataMap` and write them unchanged under the assets root,
keyed by the export-time bundle digest (no runtime payload hashing). Reuse
checks the exact file set, sizes, entry types and directory structure.
Incomplete or malformed existing sources fail without being replaced, since
an SDK model may still be using them. Same-size content changes are not
detected.
- Cold publication stages into `.staging-<uuid>` and publishes with
`renameatx_np(RENAME_EXCL)`, with inspection, staging and publication all
relative to one open root descriptor. If another loader publishes first, its
bundle is validated and used.
- Tests: adds the filesystem snapshot helpers used from here on.
- SDK acquisition is not included here.
- README: the "Asset storage" materialization, publication and completeness
text.
No changes outside `backends/apple/coreai`.
Test Plan:
```
# Local: configure and build only
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_DEPLOYMENT_TARGET=27.0 -DEXECUTORCH_BUILD_COREAI=ON \
-DEXECUTORCH_BUILD_TESTS=ON -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON
cmake --build build --target backends/apple/coreai/all
# CI (macOS 27 runner, .github/workflows/coreai.yml)
ctest --test-dir build/backends/apple/coreai --output-on-failure --no-tests=error
```
CTest runs `coreai_host_test`, which adds the source suite.
ExclusivePublicationValidatesWinnerAndRemovesLosingStaging covers the
concurrent `RENAME_EXCL` race.
# Conflicts:
# backends/apple/coreai/runtime/test/coreai_filesystem_fixture.mm
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# interactive rebase in progress; onto afd4d5a
# Last command done (1 command done):
# pick 572a121 # [CoreAI] Prepare source bundles
# Next command to do (1 remaining command):
# pick e36e1ed # [CoreAI] Harden source-bundle publication and failure handling
# You are currently rebasing branch 'coreai-v2/03b-source-bundles' on 'afd4d5ad9b'.
#
# Changes to be committed:
# modified: backends/apple/coreai/CMakeLists.txt
# modified: backends/apple/coreai/README.md
# modified: backends/apple/coreai/runtime/coreai_assets.h
# modified: backends/apple/coreai/runtime/coreai_assets.mm
# modified: backends/apple/coreai/runtime/test/coreai_filesystem_fixture.h
# modified: backends/apple/coreai/runtime/test/coreai_filesystem_fixture.mm
# new file: backends/apple/coreai/runtime/test/coreai_source_fixture.h
# new file: backends/apple/coreai/runtime/test/coreai_source_fixture.mm
# new file: backends/apple/coreai/runtime/test/coreai_source_test.mm
#
# Changes not staged for commit:
# modified: backends/mlx/third-party/mlx (modified content)
#
Summary: Strengthen publication durability because damaged stored bundles cannot be replaced safely. Keep failures visible and retries under caller control, preserve meaningful errors, and make content-identity requirements explicit. Test Plan: Ran the native host suite on macOS 27: 79 tests passed and one existing APFS invalid-UTF-8 test skipped. All 18 source-bundle tests passed five consecutive runs. Fault injection verified flush ordering, errors without automatic retries, temporary cleanup, and complete contents after post-rename failure. Malformed existing bundles and incomplete concurrent winners were preserved. The Python suite remains blocked during collection by the existing torch/torchao mismatch: torch.ao.quantization.quantizer is missing. # Conflicts: # backends/apple/coreai/README.md # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # interactive rebase in progress; onto afd4d5a # Last commands done (2 commands done): # pick 572a121 # [CoreAI] Prepare source bundles # pick e36e1ed # [CoreAI] Harden source-bundle publication and failure handling # No commands remaining. # You are currently rebasing branch 'coreai-v2/03b-source-bundles' on 'afd4d5ad9b'. # # Changes to be committed: # modified: backends/apple/coreai/README.md # modified: backends/apple/coreai/runtime/coreai_assets.h # modified: backends/apple/coreai/runtime/coreai_assets.mm # modified: backends/apple/coreai/runtime/coreai_storage.h # modified: backends/apple/coreai/runtime/coreai_storage.mm # modified: backends/apple/coreai/runtime/test/coreai_source_fixture.h # modified: backends/apple/coreai/runtime/test/coreai_source_fixture.mm # modified: backends/apple/coreai/runtime/test/coreai_source_test.mm # # Changes not staged for commit: # modified: backends/mlx/third-party/mlx (modified content) #
Summary: Allow canonically equivalent Unicode paths to survive filesystem conversion without changing delivered names or bytes. Ensure reused sources are durable before returning and preserve syscall error and interruption handling throughout publication. Test Plan: Reproduced the composed-Unicode materialization failure before the fix. All 96 native tests passed with zero skips, including Unicode cold/warm loads, alias rejection, flush failures and retries, staging cleanup, and permission errors. All 113 CoreAI Python tests passed. Formatting and whitespace checks passed.
aaf5f40 to
211367d
Compare
Materializes the selected Core AI source bundle under the assets root so the SDK can specialize it (
runtime/coreai_assets.{h,mm}).NamedDataMapand write them unchanged, keyed by the export-time bundle digest (no runtime payload hashing)..staging-<uuid>and publishes withrenameatx_np(RENAME_EXCL), all relative to one open root descriptor. If another loader publishes first, its bundle is validated and used.coreai_host_test, plus the filesystem snapshot helpers used from here on.ExclusivePublicationValidatesWinnerAndRemovesLosingStagingcovers the concurrentRENAME_EXCLrace.No changes outside
backends/apple/coreai.Stack: 4 of 9, based on #23389. Review only this PR's commit. Next: #23391.
Test plan: built locally for macOS 27.0;
ctest -Nlistscoreai_host_test, which the Core AI workflow runs on the macOS 27 runner.lintrunneris clean.