Post

Replies

Boosts

Views

Activity

Reply to Network volume and file identity
Thanks, that clarifies the SMB file ID side. For SMB volumes that do set VOL_CAP_FMT_PERSISTENTOBJECTIDS, is there any stable volume/share identifier exposed to clients that should be used to namespace those persistent file IDs when volumeUUIDStringKey is nil? Or should I use their own best-effort namespace such as the mounted volume URL, remount URL, or bookmark/root path?
Topic: Core OS SubTopic:
File Systems Q&A
Tags:
Jun ’26
Reply to documentIdentifierKey description
Thanks, that’s very helpful. Is generationIdentifierKey tied to the current filesystem object/inode, or to the logical document identity represented by documentIdentifierKey? On which common volume/filesystem types are generationIdentifierKey and documentIdentifierKey expected to be supported/reliable? Is there a capability key for this, or should I request the values and treat nil as unsupported?
Topic: Core OS SubTopic:
File Systems Q&A
Tags:
Jun ’26
Reply to Display state of iCloud files
Thanks, that helps. I already use a NSFilePresenter on a root folder to track changes, so I could probably wire that to trigger cell refresh on presentedItemDidChangeUbiquityAttributes. For the initial render of the grid, are you suggesting I somehow resolve the bookmarks and check the URL resource values in one large batch that populates a cache? Obviously one only wants to load the cells that will appear.
Topic: iCloud SubTopic:
iCloud & CloudKit Q&A
Jun ’26
Reply to Display state of iCloud files
Thanks. I should clarify that I’m not using CloudKit records or CKAsset. My app stores security-scoped bookmarks to user-selected files. Some files are regular local Finder files, and some are files in iCloud Drive. The UI is a large thumbnail grid. I maintain my own thumbnail cache, but I also want to display whether the original file is currently local, cloud-only, downloading, or unavailable. Given that model, what is the recommended way on macOS to track the availability of iCloud Drive files without synchronously touching every original file while scrolling the grid?
Topic: iCloud SubTopic:
iCloud & CloudKit Q&A
Jun ’26
Reply to Metal CIKernel instances with arbitrarily structured data arguments
Thank you for your fast reply! According to framework engineers CoreImage doesn't support variable sized arrays as input to a CIKernel, the supported input arguments to a CIKernel are all explained in https://developer.apple.com/metal/MetalCIKLReference6.pdf Are you referring to arrays as input arguments or an array that is sent as data for the input argument? I might be missing something but I don’t see which input arguments are supported on the Swift side in the linked PDF. https://developer.apple.com/documentation/coreimage/cikernel/apply(extent:roicallback:arguments:) only says that "each object in the array must be compatible with the corresponding parameter declared in the kernel routine source code” with a link to the documentation archive which indicates that the arguments must be NSNumber or CIVector. Exceeding those bounds introduces random data in kernel calculations, and possibly memory corruption on write. The interpretation of the feature added in iOS13 and macOS Catalina seems to be that Data type is also supported? It would be great to have some clarification on how the feature is expected to work and what its limitations are, as there seems to be some confusion surrounding this. The linked PDF is dated before the release of iOS13.
Topic: Media Technologies SubTopic: General Tags:
Oct ’25
Reply to Metal CIKernel instances with arbitrarily structured data arguments
Thanks for your reply. Strangely I didn't get an email notification of your reply. Here are some links to other forum posts: https://developer.apple.com/forums/thread/650405 https://developer.apple.com/forums/thread/125431 There is also a discussion here: https://stackoverflow.com/questions/57751660/metal-shading-language-for-core-image-color-kernel-how-to-pass-an-array-of-floa On the Metal side I am using the extern "C" method. I've tried multiple setups using both an array of structs and a simple array of floats: struct MyStruct { float value1; float value2; float value3; float value4; float value5; float value6; }; extern "C" float4 myKernel(coreimage::sample_t pixel, uint count, constant MyStruct *myArray) { for (uint i = 0; i < count; ++i) { MyStruct myStruct = myArray[I]; float valueToProcess = myStruct.value1; Or extern "C" float4 myKernel(coreimage::sample_t pixel, uint count, constant float myValues[]) { On the Swift side the data is sent into the CIColorKernel like: struct MyStruct { let value1: Float let value2: Float let value3: Float let value4: Float let value5: Float let value6: Float } let myArray: [MyStruct] = ... let data = Data(bytes: myArray, count: MemoryLayout<MyStruct>.stride * myArray.count) or let data = myArray.withUnsafeBufferPointer { Data(buffer: $0) } kernel.apply( extent: inputImage.extent, roiCallback: { _, rect in rect }, arguments: [ inputImage, UInt(myArray.count), data ] ) Or let myArray: [Float] = ... let data = myArray.withUnsafeBufferPointer { Data(buffer: $0) } kernel.apply( extent: inputImage.extent, roiCallback: { _, rect in rect }, arguments: [ inputImage, UInt(myArray.count), data ] ) I tried multiple combinations including using SIMD types but couldn’t get any to work reliably, so I’ve reverted back to a fixed set of CIVectors for now. Ideally I need an arbitrary array size that works similarly to a MTLArgumentEncoder. As I already mentioned, I get the expected behavior up to a certain data size (1-2 structs or around 4 floats in the array), afterwards excess data is discarded. As the size grows beyond the threshold the instability randomly increases with flickering and other unexpected results. Thanks! Michael
Topic: Media Technologies SubTopic: General Tags:
Sep ’25
Reply to Metal and Swift Concurrency
Is the best practice of using the Thread class based on that it has less overhead and in turn offers better performance compared to Dispatch or is there other reasoning behind this? What would the downsides be of using a higher level API?
Topic: Graphics & Games SubTopic: Metal Tags:
Jun ’24
Reply to Metal and Swift Concurrency
That makes sense. Exactly what are you referring to when you mean explicit threading? Would you recommend using continuations to bridge tasks from the higher level parts of the app to the render engine? In my use case I'm doing a lot of Core Image render tasks and displaying the results in MTKViews.
Topic: Graphics & Games SubTopic: Metal Tags:
Jun ’24
Reply to Network volume and file identity
Thanks, that clarifies the SMB file ID side. For SMB volumes that do set VOL_CAP_FMT_PERSISTENTOBJECTIDS, is there any stable volume/share identifier exposed to clients that should be used to namespace those persistent file IDs when volumeUUIDStringKey is nil? Or should I use their own best-effort namespace such as the mounted volume URL, remount URL, or bookmark/root path?
Topic: Core OS SubTopic:
File Systems Q&A
Tags:
Replies
Boosts
Views
Activity
Jun ’26
Reply to documentIdentifierKey description
Thanks, that’s very helpful. Is generationIdentifierKey tied to the current filesystem object/inode, or to the logical document identity represented by documentIdentifierKey? On which common volume/filesystem types are generationIdentifierKey and documentIdentifierKey expected to be supported/reliable? Is there a capability key for this, or should I request the values and treat nil as unsupported?
Topic: Core OS SubTopic:
File Systems Q&A
Tags:
Replies
Boosts
Views
Activity
Jun ’26
Reply to Display state of iCloud files
Thanks, that helps. I already use a NSFilePresenter on a root folder to track changes, so I could probably wire that to trigger cell refresh on presentedItemDidChangeUbiquityAttributes. For the initial render of the grid, are you suggesting I somehow resolve the bookmarks and check the URL resource values in one large batch that populates a cache? Obviously one only wants to load the cells that will appear.
Topic: iCloud SubTopic:
iCloud & CloudKit Q&A
Replies
Boosts
Views
Activity
Jun ’26
Reply to Display state of iCloud files
Thanks. I should clarify that I’m not using CloudKit records or CKAsset. My app stores security-scoped bookmarks to user-selected files. Some files are regular local Finder files, and some are files in iCloud Drive. The UI is a large thumbnail grid. I maintain my own thumbnail cache, but I also want to display whether the original file is currently local, cloud-only, downloading, or unavailable. Given that model, what is the recommended way on macOS to track the availability of iCloud Drive files without synchronously touching every original file while scrolling the grid?
Topic: iCloud SubTopic:
iCloud & CloudKit Q&A
Replies
Boosts
Views
Activity
Jun ’26
Reply to Metal CIKernel instances with arbitrarily structured data arguments
Thank you for your fast reply! According to framework engineers CoreImage doesn't support variable sized arrays as input to a CIKernel, the supported input arguments to a CIKernel are all explained in https://developer.apple.com/metal/MetalCIKLReference6.pdf Are you referring to arrays as input arguments or an array that is sent as data for the input argument? I might be missing something but I don’t see which input arguments are supported on the Swift side in the linked PDF. https://developer.apple.com/documentation/coreimage/cikernel/apply(extent:roicallback:arguments:) only says that "each object in the array must be compatible with the corresponding parameter declared in the kernel routine source code” with a link to the documentation archive which indicates that the arguments must be NSNumber or CIVector. Exceeding those bounds introduces random data in kernel calculations, and possibly memory corruption on write. The interpretation of the feature added in iOS13 and macOS Catalina seems to be that Data type is also supported? It would be great to have some clarification on how the feature is expected to work and what its limitations are, as there seems to be some confusion surrounding this. The linked PDF is dated before the release of iOS13.
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to Metal CIKernel instances with arbitrarily structured data arguments
Thanks for your reply. Strangely I didn't get an email notification of your reply. Here are some links to other forum posts: https://developer.apple.com/forums/thread/650405 https://developer.apple.com/forums/thread/125431 There is also a discussion here: https://stackoverflow.com/questions/57751660/metal-shading-language-for-core-image-color-kernel-how-to-pass-an-array-of-floa On the Metal side I am using the extern "C" method. I've tried multiple setups using both an array of structs and a simple array of floats: struct MyStruct { float value1; float value2; float value3; float value4; float value5; float value6; }; extern "C" float4 myKernel(coreimage::sample_t pixel, uint count, constant MyStruct *myArray) { for (uint i = 0; i < count; ++i) { MyStruct myStruct = myArray[I]; float valueToProcess = myStruct.value1; Or extern "C" float4 myKernel(coreimage::sample_t pixel, uint count, constant float myValues[]) { On the Swift side the data is sent into the CIColorKernel like: struct MyStruct { let value1: Float let value2: Float let value3: Float let value4: Float let value5: Float let value6: Float } let myArray: [MyStruct] = ... let data = Data(bytes: myArray, count: MemoryLayout<MyStruct>.stride * myArray.count) or let data = myArray.withUnsafeBufferPointer { Data(buffer: $0) } kernel.apply( extent: inputImage.extent, roiCallback: { _, rect in rect }, arguments: [ inputImage, UInt(myArray.count), data ] ) Or let myArray: [Float] = ... let data = myArray.withUnsafeBufferPointer { Data(buffer: $0) } kernel.apply( extent: inputImage.extent, roiCallback: { _, rect in rect }, arguments: [ inputImage, UInt(myArray.count), data ] ) I tried multiple combinations including using SIMD types but couldn’t get any to work reliably, so I’ve reverted back to a fixed set of CIVectors for now. Ideally I need an arbitrary array size that works similarly to a MTLArgumentEncoder. As I already mentioned, I get the expected behavior up to a certain data size (1-2 structs or around 4 floats in the array), afterwards excess data is discarded. As the size grows beyond the threshold the instability randomly increases with flickering and other unexpected results. Thanks! Michael
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’25
Reply to Metal and Swift Concurrency
Is the best practice of using the Thread class based on that it has less overhead and in turn offers better performance compared to Dispatch or is there other reasoning behind this? What would the downsides be of using a higher level API?
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Metal and Swift Concurrency
That makes sense. Exactly what are you referring to when you mean explicit threading? Would you recommend using continuations to bridge tasks from the higher level parts of the app to the render engine? In my use case I'm doing a lot of Core Image render tasks and displaying the results in MTKViews.
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Jun ’24