anchor.diff:      let archetypeSlots = dictPlus<uint64, ArchetypeSlot> HashIdentity.Structural []
       let componentTypes = dictPlus<string, Type> HashIdentity.Structural []
       let subscriptions = dictPlus<EcsEvent, Dictionary<uint32, obj>> HashIdentity.Structural []
  +    let subscribedEntities = dictPlus<EntityRef, int> HashIdentity.Structural []
       let queries = List<IQuery> ()
   
       let createArchetype (archetypeId : ArchetypeId) =
  
positive.code:     member this.UnregisterComponent<'c, 's when 'c : struct and 'c :> 'c Component> (entityRef : EntityRef) (state : 's) =
          this.UnregisterNamedComponent<'c, 's> typeof<'c>.Name entityRef state
  
      member this.UnregisterEntity (entityRef : EntityRef) (state : 's) =
          match archetypeSlots.TryGetValue entityRef.EntityId with
          | (true, archetypeSlot) ->
              let archetype = archetypeSlot.Archetype
              let mutable state = state
              for compName in archetype.Stores.Keys do
                  let eventData = { EntityRef = entityRef; ContextName = compName }
                  state <- this.Publish<EcsRegistrationData, obj> (EcsEvents.Unregistering compName) eventData (state :> obj) :?> 's
              for termEntry in archetype.Id.Terms do
                  let eventData = { EntityRef = entityRef; ContextName = termEntry.Key }
                  state <- this.Publish<EcsRegistrationData, obj> (EcsEvents.Unregistering termEntry.Key) eventData (state :> obj) :?> 's
              archetype.Unregister archetypeSlot.ArchetypeIndex
              state
          | (false, _) -> state
  
      member this.RegisterQuery<'q when 'q :> IQuery> (query : 'q) =
          for archetypeEntry in archetypes do
              let archetype = archetypeEntry.Value
              if query.CheckCompatibility archetype then
                  query.RegisterArchetype archetype
          queries.Add query
          query
  
      member this.RegisterEntity archetypeId comps state =
          let mutable state = state
          let archetype =
  
negative.code:             archetype.Unregister archetypeSlot.ArchetypeIndex
              archetypeSlots.Remove entityRef.EntityId |> ignore<bool>
              let archetypeId = archetype.Id.AddTerm termName term
              this.RegisterEntityInternal archetypeId comps entityRef
          | (false, _) ->
              let archetypeId = ArchetypeId.singleton termName term
              let comps = dictPlus HashIdentity.Structural []
              match term with Extra (compName, _, comp) -> comps.Add (compName, comp.Value) | _ -> ()
              this.RegisterEntityInternal archetypeId comps entityRef
  
      member this.UnregisterTerm (termName : string) (entityRef : EntityRef) =
          if termName.StartsWith Constants.Ecs.IntraComponentPrefix then failwith "Term names that start with '@' are for internal use only."
          match archetypeSlots.TryGetValue entityRef.EntityId with
          | (true, archetypeSlot) ->
              let archetype = archetypeSlot.Archetype
              let comps = archetype.GetComponents archetypeSlot.ArchetypeIndex
              archetype.Unregister archetypeSlot.ArchetypeIndex
              archetypeSlots.Remove entityRef.EntityId |> ignore<bool>
              let archetypeId = archetype.Id.RemoveTerm termName
              if archetypeId.Terms.Count > 0 then
                  let archetypeIndex = archetype.Register comps
                  archetypeSlots.Add (entityRef.EntityId, { ArchetypeIndex = archetypeIndex; Archetype = archetype })
          | (false, _) -> ()
  
      member this.RegisterNamedComponent<'c, 's when 'c : struct and 'c :> 'c Component> compName (comp : 'c) (entityRef : EntityRef) (state : 's) =
          match archetypeSlots.TryGetValue entityRef.EntityId with
  