TL;DR - we’ve become aware of an issue when using Burst with Xcode 13.3 or newer to build for iOS/iPadOS/tvOS or using IL2CPP with macOS. The bug isn’t exactly a Burst issue, but what we believe to be a general Clang bug that we’ve uncovered affecting LLVM versions 12+, which manifests as a miscompilation of the Hash128 constructor as produced through IL2CPP, which causes issues in Burst with SharedStatic. To fix/workaround this, we’re going to have to land a fix for the Hash128 constructor to the 2022.1, 2021.3, and 2020.3 editors.
In the meantime we advise holding on the 13.2.1 release of Xcode when doing iOS/iPadOS/tvOS and IL2CPP with macOS builds with Burst.
The reason this issue manifests in Burst is when using SharedStatic’s. For those that do not know, SharedStatic’s use a Hash128 to create a hash of the types to GetOrCreate so that each SharedStatic gets a unique location in memory backing it. Burst and managed both have to generate the same hash for the same types to ensure they both access the same memory location, and we observed with Xcode 13.3 and newer that half of the hash was being incorrectly generated in the Hash128 constructor that was being produced via IL2CPP and compiled with Xcode’s Clang. This meant that Burst was accessing what it thought was a previously created SharedStatic, but since the managed side (IL2CPP) had used an incorrect hash, Burst was doing a null pointer dereference. Since SharedStatic’s are used so heavily in DOTS code (EG. the TypeManager in Entities), users using DOTS will be affected by the issue.
Hello @sheredom ! Is there any update on this or any bug tracking tickets we can follow? We have some folks whose iOS devices have been updated to an extent where they can no longer build without upgrading Xcode to 13.3
@sheredom I know this is a long shot but is there any chance at all that this issue or similar has persisted into 13.4.1, only for macOS builds but regardless of the scripting backend? For whatever reason Unity 2020.3 and 2021.3 just cannot get Burst to work for that.