Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23388
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 7998984 with merge base 0b3d26d ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Summary:
Add the filesystem layer the Core AI runtime uses for its asset and bookmark
cache (`runtime/coreai_storage.{h,mm}`, `runtime/coreai_file.h`).
- Prepare an absolute storage root chosen by the application. Creating a root
also excludes it from backup; inspecting an existing root changes nothing.
- Enumerate directories through descriptors and return sorted names, failing
on operational errors rather than returning partial listings.
- Write new files relative to a directory descriptor and `fsync` each file and
its parent directory.
- Publish data atomically: write a temporary file, `fsync` and `F_FULLFSYNC`
it, `renameat` it into place and sync the directory. Readers see either the
old or the new complete bytes. A failure before the rename leaves the old
bytes and removes the temporary file.
- Tree removal is not included here; it lands with cache clearing.
- README: the "Asset storage" root, durability and backup-exclusion text.
Trust model: the application owns the cache directory. The helpers do not
defend against other processes of the same user renaming or replacing paths
inside it.
Fault injection points use `storage_fault()`, which compiles to a constant 0
unless `COREAI_ASSETS_TESTING` is defined. Only the `coreai_host_test` target
defines it.
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 storage suite.
AtomicPublicationPreservesOldBytesOnFailure checks that a failed rename leaves
the old bytes and no `.tmp-*` entry.
metascroy
force-pushed
the
coreai-v2/01-export-parser
branch
from
October 5, 2026 03:14
0485975 to
8bdd47d
Compare
metascroy
force-pushed
the
coreai-v2/02-filesystem
branch
from
October 5, 2026 03:14
aa99feb to
7998984
Compare
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.
Adds the filesystem layer the Core AI runtime uses for its asset and bookmark cache (
runtime/coreai_storage.{h,mm},runtime/coreai_file.h).fsynceach file and its parent directory.fsync+F_FULLFSYNCit,renameatit into place and sync the directory. A failure before the rename keeps the old bytes and removes the temporary file.storage_fault(), which compiles to a constant 0 unlessCOREAI_ASSETS_TESTINGis defined (only incoreai_host_test).coreai_host_test.No changes outside
backends/apple/coreai.Stack: 2 of 9, based on #23387. Review only this PR's commit. Next: #23389.
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.