Oh and there’s bunch of these errors, seems like Burst has some problems when trying to find some methods in a assembly which contains unsafe code. Maybe it can’t handle when there’s TypedReference or other weird unsafe feature?
I mean I’m not expecting Burst to compile anything with TypedReference, but I’m expecting it not to crash when it compiles a method which is in the same assembly as other method which uses TypedReference.
I’ll try to comment out certain parts of the code to confirm it.
2022-05-12 13:18:20.482 Executing job Find Methods (Samples.CosmeticDevice)
2022-05-12 13:18:20.484 Using existing .bhc file for c:\Data\Projects\Volcanoids\Library\ScriptAssemblies\Samples.CosmeticDevice.dll with timestamp 5/12/2022 7:22:29 AM and GUID fb6c87b6-5107-4a57-888a-9b4ab88c6fcb
2022-05-12 13:18:20.536 No existing .bhc file for c:\Data\Projects\Volcanoids\Library\ScriptAssemblies\Rock.Base.dll
2022-05-12 13:18:20.574 Exception while executing job: System.AggregateException: One or more errors occurred. (Unimplemented Instruction RefAnyVal) ---> System.NotImplementedException: Unimplemented Instruction RefAnyVal
at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+InstructionHasher.DecodeInstruction (System.Reflection.Metadata.BlobReader& reader) [0x00509] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashMethodDefinition (System.Reflection.Metadata.MethodDefinitionHandle methodDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader, System.Reflection.PortableExecutable.PEReader peReader, Burst.Compiler.IL.DebugInfo.PortablePdbInstance pdbInstance, Burst.Compiler.IL.Hashing.ILSignatureProvider signatureProvider, Burst.Compiler.IL.Hashing.Storage.BlobCollection blobCollection) [0x00086] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass12_0.<HashImpl>b__4 (System.Reflection.Metadata.MethodDefinitionHandle methodDefinitionHandle, System.Threading.Tasks.ParallelLoopState loopState, System.Int64 i) [0x00000] in <660bf86525254f05bf0505fe2843d6a3>:0
at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x00132] in <f4694e4600d74e03a4e35def8b97021c>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x0025f] in <f4694e4600d74e03a4e35def8b97021c>:0
at System.Threading.Tasks.TaskReplicator+Replica`1[TState].ExecuteAction (System.Boolean& yieldedBeforeCompletion) [0x00000] in <f4694e4600d74e03a4e35def8b97021c>:0
at System.Threading.Tasks.TaskReplicator+Replica.Execute () [0x00023] in <f4694e4600d74e03a4e35def8b97021c>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.TaskReplicator.Run[TState] (System.Threading.Tasks.TaskReplicator+ReplicatableUserAction`1[TState] action, System.Threading.Tasks.ParallelOptions options, System.Boolean stopOnFirstFailure) [0x0005b] in <f4694e4600d74e03a4e35def8b97021c>:0
at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal] (System.Collections.Concurrent.Partitioner`1[TSource] source, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`1[T] simpleBody, System.Action`2[T1,T2] bodyWithState, System.Action`3[T1,T2,T3] bodyWithStateAndIndex, System.Func`4[T1,T2,T3,TResult] bodyWithStateAndLocal, System.Func`5[T1,T2,T3,T4,TResult] bodyWithEverything, System.Func`1[TResult] localInit, System.Action`1[T] localFinally) [0x0017c] in <f4694e4600d74e03a4e35def8b97021c>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException (System.Collections.ICollection exceptions, System.Threading.CancellationToken cancelToken, System.Exception otherException) [0x0000b] in <f4694e4600d74e03a4e35def8b97021c>:0
at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal] (System.Collections.Concurrent.Partitioner`1[TSource] source, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`1[T] simpleBody, System.Action`2[T1,T2] bodyWithState, System.Action`3[T1,T2,T3] bodyWithStateAndIndex, System.Func`4[T1,T2,T3,TResult] bodyWithStateAndLocal, System.Func`5[T1,T2,T3,T4,TResult] bodyWithEverything, System.Func`1[TResult] localInit, System.Action`1[T] localFinally) [0x001db] in <f4694e4600d74e03a4e35def8b97021c>:0
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal] (System.Collections.Generic.IEnumerable`1[T] source, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`1[T] body, System.Action`2[T1,T2] bodyWithState, System.Action`3[T1,T2,T3] bodyWithStateAndIndex, System.Func`4[T1,T2,T3,TResult] bodyWithStateAndLocal, System.Func`5[T1,T2,T3,T4,TResult] bodyWithEverything, System.Func`1[TResult] localInit, System.Action`1[T] localFinally) [0x00050] in <f4694e4600d74e03a4e35def8b97021c>:0
at System.Threading.Tasks.Parallel.ForEach[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`3[T1,T2,T3] body) [0x0002a] in <f4694e4600d74e03a4e35def8b97021c>:0
at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.ParallelForEach[T] (System.Collections.Generic.IEnumerable`1[T] elements, System.Action`3[T1,T2,T3] callback) [0x00018] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashImpl () [0x001c2] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashAssembly (System.String filePath) [0x00007] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheLoader.CreateHashingResult (Mono.Cecil.AssemblyNameReference assemblyNameReference, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.Helpers.DebugLogWriter debugLogWriter) [0x00160] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore.GetAssemblyState (System.String assemblyName, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x000a7] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Server.EntryPointMethodFinder.LoadAllAssemblyReferences (Mono.Cecil.AssemblyDefinition asmDef, System.Collections.Generic.Dictionary`2[TKey,TValue] visited, System.Collections.Generic.Dictionary`2[TKey,TValue] jobProducers, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x00020] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Server.EntryPointMethodFinder.LoadAllAssemblyReferences (Mono.Cecil.AssemblyDefinition asmDef, System.Collections.Generic.Dictionary`2[TKey,TValue] visited, System.Collections.Generic.Dictionary`2[TKey,TValue] jobProducers, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x001de] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Server.EntryPointMethodFinder.LoadAllAssemblyReferences (Mono.Cecil.AssemblyDefinition asmDef, System.Collections.Generic.Dictionary`2[TKey,TValue] visited, System.Collections.Generic.Dictionary`2[TKey,TValue] jobProducers, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x001de] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Server.EntryPointMethodFinder.FindEntryPoints (System.String[] rootAssemblyNames, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, Burst.Compiler.IL.Server.ProfileDelegate profileCallback, Burst.Compiler.IL.Helpers.DebugLogWriter debugWriter) [0x00062] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Server.FindMethodsJob.Execute (Burst.Compiler.IL.Server.CompilerServerJobExecutionContext context) [0x0000c] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Server.CompilerThread.CompilerThreadLoop () [0x00103] in <660bf86525254f05bf0505fe2843d6a3>:0
---> (Inner Exception #0) System.NotImplementedException: Unimplemented Instruction RefAnyVal
at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+InstructionHasher.DecodeInstruction (System.Reflection.Metadata.BlobReader& reader) [0x00509] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashMethodDefinition (System.Reflection.Metadata.MethodDefinitionHandle methodDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader, System.Reflection.PortableExecutable.PEReader peReader, Burst.Compiler.IL.DebugInfo.PortablePdbInstance pdbInstance, Burst.Compiler.IL.Hashing.ILSignatureProvider signatureProvider, Burst.Compiler.IL.Hashing.Storage.BlobCollection blobCollection) [0x00086] in <660bf86525254f05bf0505fe2843d6a3>:0
at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass12_0.<HashImpl>b__4 (System.Reflection.Metadata.MethodDefinitionHandle methodDefinitionHandle, System.Threading.Tasks.ParallelLoopState loopState, System.Int64 i) [0x00000] in <660bf86525254f05bf0505fe2843d6a3>:0
at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x00132] in <f4694e4600d74e03a4e35def8b97021c>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x0025f] in <f4694e4600d74e03a4e35def8b97021c>:0
at System.Threading.Tasks.TaskReplicator+Replica`1[TState].ExecuteAction (System.Boolean& yieldedBeforeCompletion) [0x00000] in <f4694e4600d74e03a4e35def8b97021c>:0
at System.Threading.Tasks.TaskReplicator+Replica.Execute () [0x00023] in <f4694e4600d74e03a4e35def8b97021c>:0 <---