Commit Graph

273 Commits

Author SHA1 Message Date
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
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
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
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
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
Konrad `ktoso` Malawski
58f0a1c5ca [Distributed] Disable some tests on optimized builds until we fix 2022-03-11 09:29:49 +09: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
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
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
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
bffd956033 [Distributed] improve ad-hoc requirement typechecking 2022-02-11 19:25:48 +09:00
Pavel Yaskevich
e6fad0eb1f [Distributed] NFC: Remove obsolete remoteCall test XFAILs on 32-bit WatchOS 2022-02-10 09:27:22 -08:00
Pavel Yaskevich
4e8f962d9f [Distributed] NFC: Remove OK: which used to be REQUIRES: in remoteCall tests 2022-02-09 16:06:21 -08:00
Pavel Yaskevich
ecf1c1ede1 [Distributed] Runtime: Add missing accessible function section registration on ELF
Resolves: rdar://87240034
2022-02-09 16:06:11 -08:00
Konrad `ktoso` Malawski
6cd1fb2555 [Distributed] Improve error messages on property isolation 2022-02-09 11:42:51 +09:00
Konrad `ktoso` Malawski
c57cb45eac [Distributed] Handle SerializationRequirement in dist get props
- reuse more code about getting the type and requirements
- handle protocols properly, including extensions with where clauses
- improve error messages
2022-02-08 23:08:59 +09:00
Konrad `ktoso` Malawski
d9b79ccdee [Distributed] remoteCall decoding without foundation 2022-02-08 23:06:33 +09:00
Pavel Yaskevich
ab25d4e62a [Distributed] IRGen: Fix loading of the witness tables
The witness table is an array of pointers - `void **`,
which means that the list of the witnesses has type of `void ***`.

Instead of using result of `emitAddressAtOffset` accessor
should set the correct type for the list, which is `void ***`
and emit bit a lot for each of the witness table slots.

Resolves: rdar://87568630
Resolves: rdar://88340451
2022-02-05 01:12:47 -08:00
Konrad `ktoso` Malawski
b19e073bc4 [Distributed] Unlock all tests rdar://88228867 2022-02-03 06:18:54 +09:00
Konrad `ktoso` Malawski
48db739db0 [Distributed] Record generic substitution types for invocation 2022-02-02 18:12:32 +09:00
Pavel Yaskevich
92e62a96ff [Distributed] NFC: Disable remoteCall test on arm64_32 WatchOS simulator
Resolves: rdar://88340451
2022-02-01 11:48:04 -08:00
Pavel Yaskevich
d5c9a4b5b3 [Distributed] NFC: Add SerializationRequirement conformance to decoder in tests 2022-01-31 00:37:59 -08:00
Pavel Yaskevich
82410c678c Merge pull request #41082 from xedin/dist-decode-in-accessor
[Distributed] Augment accessor to be able to decode arguments instead of accepting buffer
2022-01-29 19:15:28 -08:00
Pavel Yaskevich
c3cafcc1ab [Distributed] NFC: Split FakeInvocation into Encoder and Decoder and adjust tests 2022-01-29 14:33:41 -08:00
Pavel Yaskevich
aa44c1dbe1 [Distributed] IRGen: Emit an early return upon argument decoding failure 2022-01-29 14:33:41 -08:00
Pavel Yaskevich
d0fdf20552 [Distributed] Runtime: Switch to use argument decoder instead of heterogeneous buffer 2022-01-29 14:33:41 -08:00
Pavel Yaskevich
8bff147227 [Distributed] Remove extraneous DistributedTargetInvocationArgumentDecoder 2022-01-29 14:33:41 -08:00
Pavel Yaskevich
ebebcecd01 [Distributed] NFC: Disable remoteCall tests due to random failures 2022-01-29 14:07:57 -08:00
Konrad `ktoso` Malawski
31300eada9 [Distributed] Issues on 32bit, disable for now 2022-01-29 09:06:43 +09:00
Konrad `ktoso` Malawski
6a0164d16f [Distributed] Reuse fake actor systems more in tests 2022-01-28 21:21:08 +09:00
Konrad `ktoso` Malawski
7f427c9ca5 [Distributed] implement "roundtrip" tests and AS 2022-01-28 18:50:40 +09:00