Commit Graph

580 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
0caf03d63f [Distributed] adjust test to pass with less accurate diagnostics; while we work on getting them back 2022-06-17 12:35:54 -07:00
Pavel Yaskevich
cae01486c6 [CSApply] Distributed: Inject distributed thunk when necessary
Replace distributed member references with distributed thunks
when access happens outside of distributed actor context. This
significantly simplifies distributed compute properties implementation.
2022-06-17 12:35:48 -07:00
Konrad `ktoso` Malawski
5a5b7c007c towards distributed getters 2022-06-17 12:12:16 -07:00
Konrad `ktoso` Malawski
079bbcf517 wip 2022-06-17 12:12:16 -07:00
Doug Gregor
774a94f69d Make sure we can dig out the (distributed) actor from an archetype.
Fixes #59356 / rdar://94976378.
2022-06-14 10:57:29 -07:00
Konrad `ktoso` Malawski
8e6d72190c [Distributed] Further witness checking cleanup and tests 2022-06-14 14:12:39 +09:00
Konrad `ktoso` Malawski
911b42f597 workaround for #59356 while still implementing the witness feature 2022-06-10 21:17:37 +09:00
Konrad `ktoso` Malawski
bd052eedd7 improve FIXME to link to issue 2022-06-10 13:41:37 +09:00
Konrad `ktoso` Malawski
7792a3127b [Distributed] Implement missing case in permitting witnesses 2022-06-10 12:46:33 +09:00
Konrad `ktoso` Malawski
402501da93 [Distributed] Also prevent mutating remoteCall impls 2022-05-31 15:09:50 +09:00
Konrad `ktoso` Malawski
2b0b38968a [Distributed] onReturn ad-hoc req must not be mutating 2022-05-31 11:53:10 +09:00
Doug Gregor
6390fcb1c9 Merge pull request #59086 from DougGregor/se-0338-sendable 2022-05-25 19:30:20 -07:00
Ben Barham
efc9469444 Merge pull request #58975 from bnbarham/make-features-consistent
[Tests] Make OS features consistent
2022-05-25 16:02:43 -07:00
Doug Gregor
a8e16297a9 Sendable checking for overrides.
When an override means crossing an actor boundary, check Sendability of
parameters and results.
2022-05-25 15:17:47 -07:00
Luciano Almeida
d95cd97703 [Sema] Improving implicit closure capture diagnostic wording 2022-05-24 20:49:45 -03:00
Ben Barham
c163e0fe5e [Tests] Make OS features consistent
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.

Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00
Karoy Lorentey
ba525375c6 [wrangler] Unconditionally disable test/Distributed/Runtime/distributed_actor_init_local for now 2022-05-18 17:58:45 -07:00
Konrad `ktoso` Malawski
bec6a94c61 [Distributed] disable local_init test for 32bit platforms 2022-05-12 08:01:22 +09:00
Konrad `ktoso` Malawski
2a89cea262 [Distributed] restore id synthesis in DerivedConformance infra for multi module cases 2022-05-09 18:34:08 +09:00
Konrad `ktoso` Malawski
1675669e43 Revert "[Distributed] workaround for LocalTestingDAS crashes;"
This reverts commit bcd0f64e91.
2022-05-08 19:37:24 +09:00
Konrad `ktoso` Malawski
1e489d6c0b [Distributed] Force the order of properties in AST 2022-05-08 18:20:50 +09:00
Evan Wilde
a7558d34e5 Disabling failing test distributed_actor_init_local 2022-05-07 11:32:45 -07:00
Konrad `ktoso` Malawski
bcd0f64e91 [Distributed] workaround for LocalTestingDAS crashes;
This happens to work, but is not a real fix; we are not handling well
types declared in a library evolution enabled library, which this DAS
is. Without this, at runtime, we crash in LocalTestingDAS using actor
initializers
2022-05-07 07:28:55 +09:00
Konrad `ktoso` Malawski
90e034f1dc [Distributed] Diagnose missing inout on remoteCall decls 2022-05-05 07:09:03 +09:00
Josh Soref
a806726948 spelling: thesystem
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:37:02 -04:00
Josh Soref
75fd05675c spelling: exploded
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:37:02 -04:00
Artem Chikin
3589d06b7d Disable failing distributed actor tests. Example failure: https://ci.swift.org/job/oss-swift-incremental-ASAN-RA-macos//408/console. Resolves rdar://92277271 2022-04-25 16:58:14 -07:00
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