We were seeing flaky runs due to the hard-to-determine order and point at which
the actor instances were being deallocated in the old version of the test. In addition,
all of the actor addresses were the same, so moving the point of deallocation would
give us a less rigorous test.
This patch puts all of the instances in an array so that we can rely on CHECK-DAG
to check for the deallocations in any order, as a group at the end of the test. The
deallocations are now identifiable using a simple counter for the addresses.
resolves rdar://84574311
Basically turn test/SIL/Distributed into test/Distributed/SIL
Since we have typechecking and runtime tests under there already,
and there are only a handful of distributed-actor specific SIL tests.
the SIL test for ensuring that the transport argument is chosen correctly can
also be covered by a runtime test. It also gives me an excuse to add some
async init coverage too.
Unify the logic for checking and marking accesses as
async/throws/uses-distributed-thunk to reduce the overall amount of
code, clarify the isolated/local/potentially-remote cases, and
consistently set these options. There are tiny semantic improvements
here where, e.g., one can asynchronously use non-distributed
functions, properties, and subscripts if we're in a context where we
know the actor is not remote.
The `@__distributedActorIndependent` attribute is effectively the same
as nonisolated, so start treating it that way by making actor-isolation
checking look for it specifically and conclude "nonisolated". Remove
various special cases for this attribute that don't need to exist.
Remove a few places where we are introducing extra distributed-related
actor isolation checking that either isn't necesssary or is incorrect.
Specifically:
* Hopping to a global actor *from* a distributed-actor isolated context
does not go through a distributed thunk (global actors can't have one).
* "Unrestricted" declarations are always unrestricted, so we don't
need an extra distributed check here (it won't ever occur).
* Actor isolation computation doesn't need a special case for
distributed; it marks too much, overriding (e.g.) global actor
isolation.
The primary semantic change visible here is that distributed actors
can now have truly 'nonisolated' members. They aren't required to be
'distributed' because they can't touch state anyway.