Commit Graph

603 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
dfc2294e42 [Distributed] unlock test which used to fail on 32bit watch 2022-04-25 16:31:22 +09:00
Doug Gregor
8c3d1fb2ca Make sure we don't provide duplicate synthesized conformance table entries.
This was benign with `Sendable`, but is not benign for the `Encodable`
and `Decodable` synthesis for distributed actors, which results in a
crash in TBD generation.

Fixes rdar://92008955.
2022-04-22 15:41:01 -07:00
Doug Gregor
c9dcca4f5e Merge pull request #42577 from ktoso/wip-prevent-multiple-id-synthesis
[Distributed] Guard ID synthesis from happening multiple times
2022-04-22 15:25:33 -07:00
Konrad `ktoso` Malawski
5ffdf0ba44 Merge pull request #42567 from DougGregor/distributed-actor-stored-property-layout
Layout distributed actor id and actorSystem fields first in stored properties
2022-04-22 23:43:31 +09:00
Konrad `ktoso` Malawski
317fdd0740 [Distributed] Guard ID synthesis from synthesizing the property multiple times; e.g. during multi module builds 2022-04-22 23:18:16 +09:00
Doug Gregor
0994918f58 Layout distributed actor id and actorSystem fields first in stored properties
The stored properties `id` and `actorSystem` that are synthesized for
a distributed actor would end up getting placed in fairly random
locations within the stored properties lists based on when they were
synthesized. This means that they (1) weren't always in the prefix, and
(2) weren't always the same order in every translation unit. Hilarity ensues.

Fixes rdar://92142457.
2022-04-21 23:07:16 -07:00
Doug Gregor
4116d7a3d7 Rename the -strict-concurrency= options to be more descriptive.
The three options are now:

* `explicit`: Enforce Sendable constraints where it has been explicitly adopted and perform actor-isolation checking wherever code has adopted concurrency. (This is the default)
* `targeted`: Enforce Sendable constraints and perform actor-isolation checking wherever code has adopted concurrency, including code that has explicitly adopted Sendable.
* `complete`: Enforce Sendable constraints and actor-isolation checking throughout the entire module.
2022-04-20 18:17:33 -07:00
Doug Gregor
f404b58b96 Add -strict-concurrency=limited to tests that specifically need it.
This isolates us from changes in the default.
2022-04-20 09:11:10 -07:00
Pavel Yaskevich
fc662bc8e1 [Distributed] NFC: Adjust accessor tests to check for direct call to decodeNextArgument 2022-04-18 17:27:31 -07:00
Konrad `ktoso` Malawski
560e96fcbe [Distributed] Temporarily simplify SIL tests; avoid a few checks 2022-04-18 16:53:47 -07:00
Konrad `ktoso` Malawski
dadf3011f9 cleanups 2022-04-18 16:53:44 -07:00
Konrad `ktoso` Malawski
79ad9278b2 [Distributed] Retain adhoc decodeNextArgument in distributed thunk 2022-04-18 16:53:10 -07:00
Konrad `ktoso` Malawski
8d8c652ebf Merge pull request #42348 from ktoso/ban-non-protocol-serialization-reqs
[Distributed] Require that SerReq can only be used with protocols
2022-04-16 09:36:16 +09:00
Konrad `ktoso` Malawski
45eaf3393d [Distributed] Require that SerReq can only be used with protocols 2022-04-14 00:25:51 +09:00
Konrad `ktoso` Malawski
edd5880a59 [Distributed] SerializationReq must be associated type on DA 2022-04-13 21:52:15 +09:00
Doug Gregor
fdc6260bc1 Reimplement conformance isolation checking using the actor reference logic.
Reimplement the final client of ActorIsolationRestriction, conformance
isolation checking, to base it on the new "actor reference" logic.
Centralize the diagnostics emission so we have a single place where we
emit the primary diagnostic (which is heavily customized based on
actor isolation/distributed/etc.) and any relevant notes to make
adjustments to the witness and/or requirement, e.g., adding
'distributed', 'async', 'throws', etc. Improve the diagnostics
slightly by providing Fix-Its when suggesting that we add "async"
and/or "throws".

With the last client of ActorIsolationRestriction gone, remove it
entirely.
2022-04-07 17:10:02 -07:00
Doug Gregor
eef2704c86 Reimplement actor isolation checking for referencing a declaration.
Start collapsing the several implementations of actor isolation checking
into a single place that determines what it means to reference a declaration
from a given context, potentially supplying an instance for an actor. This
is partly cleanup, and partly staging for the implementation of the
Sendable restrictions introduced in SE-0338. The result of this check
falls into one of three categories:

* Reference occurs within the same concurrency domain (actor/task)
* Reference leaves an actor context to a nonisolated context (SE-0338)
* Reference enters the context of the actor, which might require a
combination of implicit async, implicit throws, and a "distributed" check.

Throughout this change I've sought to maintain the existing semantics,
even where I believe they are incorrect. The changes to the test cases
are not semantic changes, but reflect the unification of some
diagnostic paths that changed the diagnostic text but not when or how
those diagnostics are produced. Additionally, SE-0338 has not yet been
implemented, although this refactoring makes it easier to implement
SE-0338.

Use this new actor isolation checking scheme to implement the most
common actor-isolation check, which occurs when accessing a member of
an instance.
2022-04-07 09:07:36 -07:00
Konrad `ktoso` Malawski
0d100e6bb1 Merge pull request #42074 from ktoso/wip-avoid-double-typechecking
[Distributed] avoid double typechecking dist func decl
2022-03-30 09:17:07 +09:00
Konrad `ktoso` Malawski
7332e4b3eb [Distributed] avoid double typechecking dist func decl 2022-03-29 09:02:43 +09:00
Anthony Latsis
ba7f301e83 ConformanceChecker: Always diagnose a conformance failure if the requirement check fails in 'ensureRequirementsAreSatisfied' 2022-03-28 23:22:36 +03:00
Konrad `ktoso` Malawski
466c6338d7 [Distributed] Also cover remote distributed call in test 2022-03-25 17:07:43 +09:00
Pavel Yaskevich
2025b44902 [Distributed] Fix ActorSystem requests on protocols that conform to DistributedActor 2022-03-25 16:27:06 +09:00
Konrad `ktoso` Malawski
ef10cd016a [Distributed] Fix generic returning distributed funcs 2022-03-25 16:19:08 +09:00
Kavon Farvardin
456140b079 more coverage for actorSystem assign 2022-03-24 16:20:06 -07:00
Kavon Farvardin
74b358257d more test updates for actorSystem assignment 2022-03-24 16:20:06 -07:00
Konrad `ktoso` Malawski
51e806c16a update distributed_actor_init_local test 2022-03-24 16:20:06 -07:00
Kavon Farvardin
af683dc271 basic implementation of performing an init of the id after an assign of the actorSystem.
The resignID call within the initializer moved into DI, because an assignment to
the actorSystem, and thus initialization of the id, is no longer guaranteed to happen.
Thus, while we previously could model the resignation as a clean-up emitted on all
unwind paths in an initializer, now it's conditional, based on whether the id was
initialized. This is exactly what DI is designed to do, so we inject the resignation
call just before we call the identity's deinit.
2022-03-24 16:20:01 -07:00
Kavon Farvardin
01a5fafa7c rename default initializer's ActorSystem parameter name to actorSystem
Konrad, myself, and others feel the longer name would be better, rather than just "system"
2022-03-24 16:18:49 -07:00
Kavon Farvardin
1f47442147 remove restrictions on dist-actor init parameters
we will no longer require exactly one ActorSystem-conforming parameter.
2022-03-24 16:18:49 -07:00
Konrad `ktoso` Malawski
8d3e7d91c0 [Distributed] ResultHandler.onReturn must be ad-hoc because SerializationRequirement (#41916)
* [Distributed] Invoke handler.onReturn ad hoc via ast synthesized func

* reformat and cleanup

* remove unused var
2022-03-24 21:44:37 +09:00
Konrad `ktoso` Malawski
d0ee43c870 Disable test while we investigte 2022-03-19 14:25:48 +09:00
Konrad `ktoso` Malawski
14fb9a03ff Merge pull request #41871 from xedin/fix-mark-protocol-issues-related-to-distributd
[Distributed] Strip marker protocols from distributed thunks and accessible functions
2022-03-18 21:08:04 +09:00
Pavel Yaskevich
ab030050b0 [Distributed] NFC: Add accessor section test-case to make sure that marker protocols are not mangled 2022-03-17 15:38:25 -07:00
Pavel Yaskevich
1330e345b7 [Distributed] IRGen: Drop marker protocol requirements from accessible function generic environments
Since marker protocol do not exist at runtime, it's harmful to keep them
in a generic environment because they cannot be checked.

Resolves: rdar://90293494
2022-03-17 15:06:54 -07:00
Konrad `ktoso` Malawski
5a5d1ba2e6 [Distributed] Implement RemoteCallArgument 2022-03-17 22:55:09 +09:00
Konrad `ktoso` Malawski
3ff972b6f8 [Distributed] unlock some tests previously failing 2022-03-17 20:05:31 +09:00
Konrad `ktoso` Malawski
ea29723466 [Distributed] Add name parameter to recordArgument for better interop 2022-03-17 20:05:31 +09:00
Allan Shortlidge
acc9c4a4b8 Tests: Disable distributed_actor_localSystem on watchOS until its failure on that platform can be investigated. 2022-03-16 11:20:53 -07:00
swift-ci
fcde683a32 Merge pull request #41756 from yim-lee/distributed/loccal-actor-system
[Distributed] Offer LocalTestingDistributedActorSystem
2022-03-15 23:47:41 -07:00
Konrad `ktoso` Malawski
4c09b9121d update Distributed module import 2022-03-16 13:45:27 +09:00
Konrad `ktoso` Malawski
8a1c513993 add test and availability annotations 2022-03-15 16:42:58 -07:00
Konrad `ktoso` Malawski
4796fb330e last bits of lingering _Distributed 2022-03-16 08:36:44 +09:00
Konrad `ktoso` Malawski
8c13370242 [Distributed] rename _Distributed to underscoreless module 2022-03-16 08:35:35 +09:00
Konrad `ktoso` Malawski
6caeecdc58 fix locating constructor 2022-03-15 23:50:28 +09:00
Konrad `ktoso` Malawski
4fa0855907 [Distributed] RemoteCallTarget now pretty prints and hides mangled names 2022-03-15 17:34:04 +09:00
Pavel Yaskevich
c6cb3cc784 [Distributed] NFC: Fix incorrect RUN: command in two test-cases 2022-03-11 10:21:51 -08:00
Konrad `ktoso` Malawski
00bf4051a2 [Distributed] disable elf test, need to debug on a linux host 2022-03-12 00:30:14 +09:00
Konrad `ktoso` Malawski
d17329d9f3 [DEBUG] try debugging the issue on CI 2022-03-12 00:15:32 +09:00
Konrad `ktoso` Malawski
d57cf85c78 [Changelog] add Distributed Actors 2022-03-11 22:14:49 +09:00
Konrad `ktoso` Malawski
13cc8b3157 [Distributed] Enable no-longer-experimental distributed by default 2022-03-11 22:14:49 +09:00