Commit Graph

580 Commits

Author SHA1 Message Date
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
Konrad `ktoso` Malawski
ee7b94104b Merge pull request #41783 from xedin/rdar-90129442
[Distributed] IRGen: Don't emit accessor for distributed thunk specia…
2022-03-11 21:46:12 +09:00
Konrad `ktoso` Malawski
fab04637f2 adjust test since other features were merged since 2022-03-11 18:44:11 +09:00
Konrad `ktoso` Malawski
6d502fc042 [Distributed] Implicit Codable conformance for Dist Actors
[Witness] implement dump() on witness
2022-03-11 18:07:14 +09:00
Pavel Yaskevich
b243d64c61 [Distributed] IRGen: Don't emit accessor for distributed thunk specializations
Only synthesized `async throws` version is directly accessible remotely.

Resolves: rdar://90129442
2022-03-11 01:02:37 -08:00
swift-ci
a024e8fc5f Merge pull request #41602 from ktoso/wip-better-error
[Distributed] better diagnostics for missing actor system typealias
2022-03-10 19:45:21 -08:00
Konrad `ktoso` Malawski
f2d60e16f2 [Distributed] add note explaining DefaultDistributedActorSystem 2022-03-11 11:09:57 +09:00
Kavon Farvardin
25370d2530 Merge pull request #41776 from ktoso/wip-disable-opt
[Distributed] Disable some tests on optimized builds until we fix
2022-03-10 18:06:45 -07:00
Konrad `ktoso` Malawski
58f0a1c5ca [Distributed] Disable some tests on optimized builds until we fix 2022-03-11 09:29:49 +09:00
Pavel Yaskevich
3b97bd5fb2 [Distributed] NFC: Allow 64-bit distributed test only on x86_64 and arm64 2022-03-10 16:08:42 -08:00
Konrad `ktoso` Malawski
5ab8e0834d [Distributed] Reimplement distributed call thunks completely in AST (#41616)
* [Distributed] dist actor always has default executor (currently)

* [Distributed] extra test for missing makeEncoder

* [DistributedDecl] Add DistributedActorSystem to known SDK types

* [DistributedActor] ok progress on getting the system via witness

* [Distributed] allow hop-to `let any: any X` where X is DistActor

* [Distributed] AST: Add an accessor to determine whether type is distributed actor

- Classes have specialized method on their declarations
- Archetypes and existentials check their conformances for
  presence of `DistributedActor` protocol.

* [Distributed] AST: Account for distributed members declared in class extensions

`getConcreteReplacementForProtocolActorSystemType` should use `getSelfClassDecl`
otherwise it wouldn't be able to find actor if the member is declared in an extension.

* [Distributed] fix ad-hoc requirement checks for 'mutating'

[PreChecker] LookupDC might be null, so account for that

* [Distributed] Completed AST synthesis for dist thunk

* [Distributed][ASTDumper] print pretty distributed in right color in AST dumps

* wip on making the local/remote calls

* using the _local to mark the localCall as known local

* [Distributed] fix passing Never when not throwing

* fix lifetime of mangled string

* [Distributed] Implement recordGenericSubstitution

* [Distributed] Dont add .

* [Distributed] dont emit thunk when func broken

* [Distributed] fix tests; cleanups

* [Distributed] cleanup, move is... funcs to DistributedDecl

* [Distributed] Remove SILGen for distributed thunks, it is in Sema now!

* [Distributed]  no need to check stored props in protocols

* remote not used flag

* fix mangling test

* [Distributed] Synthesis: Don't re-use AST nodes for `decodeArgument` references

* [Distributed] Synthesis: Make sure that each thunk parameter has an internal name

* [Distributed/Synthesis] NFC: Add a comment regarding empty internal parameter names

* [Distributed] NFC: Adjust distributed thunk manglings in the accessor section test-cases

* cleanup

* [Distributed] NFC: Adjust distributed thunk manglings in the accessor thunk test-cases

* review follow ups

* xfail some linux tests for now so we can land the AST thunk

* Update distributed_actor_remote_functions.swift

Co-authored-by: Pavel Yaskevich <xedin@apache.org>
2022-03-10 23:58:23 +09:00
Konrad `ktoso` Malawski
040a4a318c [Concurrency][Distributed] Move AnyActor to Concurrency module 2022-03-08 15:28:30 +09:00
Saleem Abdulrasool
6792291d0c Distributed: enable the last batch of tests on Windows
This enables the last of the Distributed tests on Windows.  The addition
of the local configuration is required to deal with the async function
pointer handling being different on Windows.
2022-03-05 20:42:01 -08:00
John McCall
aca744b211 Remove the Flags field from AsyncContext.
Generated code has never actually initialized this field, so we
might as well remove it.  Doing so mostly doesn't impact the ABI
since we don't store anything for arguments or results in the
context as part of the normal call sequence.  We do need to adjust
some of the hard-coded contexts, however, such as continuation
contexts and the statically-sized context for special runtime
async functions.
2022-02-25 16:57:49 -05:00
Andrew Trick
4eb7351f4d Disable MandatoryCopyPropagation.
Mandatory copy propagation was primarily a stop-gap until lexcial
lifetimes were implemented. It supposedly made variables lifetimes
more consistent between -O and -Onone builds. Now that lexical
lifetimes are enabled, it is no longer needed for that purpose (and
will never satisfactorily meet that goal anyway).

Mandatory copy propagation may be enabled again later as a -Onone "
optimization. But that requires a more careful audit of the effect on
debug information.

For now, it should be disabled.
2022-02-18 17:29:04 -08:00
nate-chandler
0011b075fa Merge pull request #41387 from nate-chandler/lexical_lifetimes/destroy_hoisting/add
Hoist destroys of owned lexical values.
2022-02-17 11:36:50 -08:00
Konrad `ktoso` Malawski
94c0e522b0 Merge pull request #41415 from xedin/dist-generic-accessors
[Distributed] Remove class-bound restriction from target invocation decoder
2022-02-17 23:10:10 +09:00
Pavel Yaskevich
7c9ccb1346 [Distributed] NFC: Adjust test-cases for account for new decoder handling 2022-02-16 20:32:33 -08:00
Konrad `ktoso` Malawski
7c145cc55b Merge pull request #41179 from ktoso/wip-improved-adhoc-checks
[Distributed] improve ad-hoc requirement typechecking
2022-02-17 09:16:42 +09:00
Nate Chandler
62dc05fc51 [CopyPropagation] Hoist owned lexical destroys. 2022-02-16 10:31:24 -08:00
Konrad `ktoso` Malawski
1125241eaf [Distributed] harden test under stronger optimizations 2022-02-16 12:10:02 +09:00
Konrad `ktoso` Malawski
b02f9c7a97 [Distributed] ad-hoc req for decodeNextArgument & onReturns
fixup
2022-02-16 08:18:30 +09:00
Konrad `ktoso` Malawski
1caa0b1de0 [Distributed] Handle reqs on DistributedTargetInvocationEncoder 2022-02-14 22:08:16 +09:00
Konrad `ktoso` Malawski
005743c92c [Distributed] implement adhoc requirements properly for Encoder 2022-02-14 16:14:41 +09:00