We've encountered a regression when upgrading from macOS 26.3.1 to macOS 26.4. Where code utilizing the _Differentiation module would run correctly on 26.3.1 and no longer works on 26.4, due to not being able to find libswift_Differentiation.dylib.
Reproducer
A single file.swift file
import _Differentiation
func main() {
let (value, pullback) = valueWithPullback(at: 2, of: thing)
let gradient = pullback(1)
print("Hello, value \(value), hello, gradient \(gradient)!")
}
@differentiable(reverse)
func thing(_ x: Double) -> Double {
x * x
}
Run:
swiftc file.swift
./file
Results in error (on macOS 26.4):
dyld[99609]: Library not loaded: /usr/lib/swift/libswift_Differentiation.dylib
Referenced from: <47946056-7393-34BB-8CAC-6D8E3358E68E> /Users/jaap/Developer/tmp
Reason: tried: '/libswift_Differentiation.dylib' (no such file), '/usr/lib/swift/libswift_Differentiation.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libswift_Differentiation.dylib' (no such file), '/usr/lib/swift/libswift_Differentiation.dylib' (no such file, not in dyld cache)
zsh: abort ./file
As this was working on OS versions prior to 26.4 we compared between 26.3.1 and 26.4
where the executable is looking for the required .dylib:
on macOS 26.3.1
$ DYLD_PRINT_SEARCHING=1 ./file
...
dyld[63151]: find path "/usr/lib/swift/libswift_Differentiation.dylib"
dyld[63151]: possible path(original path on disk): "/usr/lib/swift/libswift_Differentiation.dylib"
dyld[63151]: possible path(cryptex prefix): "/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libswift_Differentiation.dylib"
dyld[63151]: possible path(original path): "/usr/lib/swift/libswift_Differentiation.dylib"
dyld[63151]: found: prebuilt-dylib-from-cache: (0x0C38) "/usr/lib/swift/libswift_Differentiation.dylib"
most importantly it looks like it was found as a prebuilt in the dylib cache.
dyld[63151]: found: prebuilt-dylib-from-cache: (0x0C38) "/usr/lib/swift/libswift_Differentiation.dylib"
on macOS 26.4 however the .dylib can no longer be found:
$ DYLD_PRINT_SEARCHING=1 ./file
...
dyld[6347]: find path "/usr/lib/swift/libswift_Differentiation.dylib"
dyld[6347]: possible path(original path on disk): "/usr/lib/swift/libswift_Differentiation.dylib"
dyld[6347]: possible path(cryptex prefix): "/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libswift_Differentiation.dylib"
dyld[6347]: possible path(original path): "/usr/lib/swift/libswift_Differentiation.dylib"
dyld[6347]: not found: "/usr/lib/swift/libswift_Differentiation.dylib"
dyld[6347]: Library not loaded: /usr/lib/swift/libswift_Differentiation.dylib
Referenced from: <F0762EE2-2812-35E7-BEE3-52EE97038B2C> /Users/zacharycole/Developer/misc/diff_dylibs_check
Reason: tried: '/usr/lib/swift/libswift_Differentiation.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libswift_Differentiation.dylib' (no such file), '/usr/lib/swift/libswift_Differentiation.dylib' (no such file, not in dyld cache)
[1] 6347 abort DYLD_PRINT_SEARCHING=1 ./file
Between the two OS versions the searchpaths seem to be the same so our assumption is that the libswift_Differentiation.dylib has been removed from the dyld-cache in the newest (26.4) releases.
Is this intentional or is this a bug?