Files
reims-vgpu/guest/bundle
Anees Iqbal 5fc2e3c20c 🐛 Read a library URL of no scheme as the file at its path
newLibraryWithURL:error: read its URL through Foundation's URL loading, which
refuses a URL of no scheme (NSURLErrorDomain -1002), and answered nil and
NSCocoaErrorDomain 256. Espresso names each of its kernels' libraries by such
a URL (-[EspressoMetalKernelsCache lazySetup]), so on the device it had no
kernel library and every GPU Vision and Core ML request threw: Geekbench 7's
workload 302, Photos, FaceTime's and Continuity Camera's effects, on every
host GPU.

The device now opens the file at the URL's path, whatever its scheme, as Metal
does, and answers Metal's errors for a file it cannot read
(src/RgfxLibraryFile.*). Measured with a .metallib of our own at each URL form,
alike on macOS 26.7.1's AMD Radeon Pro 5300M and Intel UHD 630 and macOS
27.0.1's M3 Max (jobs m3-max-20286, 20287, 20288):
  - a URL of no scheme, absolute, relative to the current directory or with
    percent escapes, a file URL, one relative to a file URL, and an http or
    other scheme's URL of a file's path: the file's library;
  - no file there: MTLLibraryErrorDomain 6, "library not found", for a file
    URL too, which answered Foundation's read error before;
  - a URL of no path (data:): MTLLibraryErrorDomain 6, "Invalid file url";
  - a file it may not open: MTLLibraryErrorDomain 1, "metal library file PATH
    failed to open with error: Permission denied";
  - a directory or an empty file: MTLLibraryErrorDomain 1, "Invalid library
    file (unexpected end of file)".
A URL of another scheme is no longer fetched through URL loading.

The other URL readers do not read this way: a binary archive's descriptor URL
must be a file URL, the IO handles take Metal's own check of a file URL, and
dynamic libraries are not supported. The shell tests read each URL form, and
compare each answer with this Mac's Metal's.
2026-11-12 03:43:38 -08:00
..