Commit Graph

273 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
6622a3cc8d [Distributed] remove unused code 2022-01-27 20:02:08 +09:00
Konrad `ktoso` Malawski
4bf2a92bda [Distributed] Remove @_dynamic replacements; impl remoteCall ad-hoc reqs
Squashed commit of the following:

commit e5a05ffe44
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 17:45:31 2022 +0900

    cleanup

commit 1f751cea5a
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 14:50:33 2022 +0900

    cleanups

commit c632f3215d
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 14:01:09 2022 +0900

    add test for generic from actor decl

commit 09b8bd50a7
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 14:00:58 2022 +0900

    cleanups

commit 31f4d0cffd
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 11:40:51 2022 +0900

    fix test

commit ad4db2fb6c
Merge: 97227edcca 07e2dfda56
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 26 23:31:41 2022 +0900

    Merge branch 'main' into wip-zzz

commit 97227edcca
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 26 21:01:25 2022 +0900

    remove @_dynamic methods!

    fix tests

commit 1c79344dbb
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 19 12:51:09 2022 +0900

    cleanup

    wip

    stuck

    fixed the stack cleanups

    cleanups pretty good now

    weird load

    rki

    works

    remove hack

    add take + throw + return

    fix test

    more tests fixed

    more tests fixed

    more tests fixed

commit 3ed494c175
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Tue Jan 18 21:09:28 2022 +0900

    stack issues in SIL verification

commit 5cf43a7f86
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Tue Jan 18 09:19:51 2022 +0900

    about to call the remoteCall

    goot to return, but missing subs

commit df8e47122a
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 13 14:09:49 2022 +0900

    [Distributed] Refactor Invocation to Decoder/Encoder

    getting there

    done-recording

    working on the string init

    stuck trying to get String initializer SILFunction

    created the remote call target

commit fc7bd62f32
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 23:01:14 2022 +0900

    [Distributed] Pass arguments from Invocation to HBuffer

commit cafc2cc058
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 22:08:47 2022 +0900

    works

commit a7d01837ff
Author: Pavel Yaskevich <pyaskevich@apple.com>
Date:   Tue Jan 11 15:48:58 2022 -0800

    [Distributed] Adjust interface of `swift_distributed_execute_target`

    Since this is a special function, `calleeContext` doesn't point to
    a direct parent but instead both parent context (uninitialized)
    and resume function are passed as last arguments which means that
    `callContext` has to act as an intermediate context in call to accessor.

commit c1f830be27
Author: Pavel Yaskevich <pyaskevich@apple.com>
Date:   Tue Jan 11 17:00:08 2022 -0800

    [Distributed] Drop optionality from result buffer in `_executeDistributedTarget`

    `RawPointer?` is lowered into a two arguments since it's a struct,
    to make it easy let's just allocate an empty pointer for `Void` result.

commit c83c2c37b6
Author: Pavel Yaskevich <pyaskevich@apple.com>
Date:   Tue Jan 11 17:02:45 2022 -0800

    [Distributed] NFC: Update _remoteCall test-case to check multiple different result types

commit 29e7cf50e4
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 21:32:37 2022 +0900

    wip

commit 9128ecc6f8
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 20:46:20 2022 +0900

    wip

commit a6b2a62a67
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 20:38:22 2022 +0900

    wip

commit 8b188f0d43
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 16:55:10 2022 +0900

    wip

commit 3796bec2b9
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 16:55:02 2022 +0900

    wip

commit 0ffc68b5ef
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Tue Jan 11 21:44:58 2022 +0900

    [Distributed] Implementing ad-hoc protocol requirements

commit 78862575e4
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 6 18:03:54 2022 +0900

    cleanup

commit 5f4ab89e25
Merge: 24a628e7c0 fdda6f2ee4
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 6 15:51:39 2022 +0900

    Merge branch 'main' into wip-impl-execute-swift

commit 24a628e7c0
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 6 15:33:21 2022 +0900

    wip

commit 69e7fed09d
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Dec 22 06:36:45 2021 +0900

    [Distributed] comment out distributed_actor_remoteCall for now

commit 376733a9f6
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Tue Dec 21 16:00:06 2021 +0900

    reimplement distributed get type info impls

commit 74ab47886a
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Dec 15 21:37:08 2021 +0900

    [Distributed] Implement func metadata and executeDistributedTarget

    dont expose new entrypoints

    able to get all the way to calling _execute
2022-01-27 17:51:43 +09:00
Pavel Yaskevich
d41173b307 [Distributed] NFC: Adjust test-cases to reflect updates in accessor interface 2022-01-24 10:18:00 -08:00
Pavel Yaskevich
0000e39239 [Distributed] NFC: Add more test-cases for generic distributed methods 2022-01-24 10:18:00 -08:00
Pavel Yaskevich
59ff689f28 [Distributed] IRGen: Teach distributed thunk accessor to load witness tables (when needed) 2022-01-24 10:18:00 -08:00
Pavel Yaskevich
206969a705 [Distributed] Augment parameter/result type decoded to support generic substitutions 2022-01-24 10:17:59 -08:00
Pavel Yaskevich
0e35951213 [Distributed] Stage use of generic environment to decode target parameter/result types 2022-01-24 10:17:59 -08:00
Pavel Yaskevich
b9cc26b271 Merge pull request #40849 from xedin/reenable-remotecall-on-macos
[Distributed] NFC: Disable remote call test on 32-bit watchOS
2022-01-15 10:00:13 -08:00
Pavel Yaskevich
cbf4eb2701 [Distributed] A couple of improvements to HeterogeneousBuffer and test-cases (#40848)
* [Distributed] NFC: Support encoding/decoding of substitutions by `FakeInvocation`

* [Distributed] Fix a bug in heterogeneous buffer iterator

`next()` did not advance offset by the size of the returned element

* [Distributed] NFC: Adjust `echo` test to handle two arguments
2022-01-14 17:46:49 +09:00
Pavel Yaskevich
8b7acc42e9 [Distributed] NFC: Disable remote call test on 32-bit watchOS 2022-01-13 15:01:37 -08:00
nate-chandler
302e063765 Merge pull request #40847 from nate-chandler/wrangle/20220113/1
[Test] Disabled distributed_actor_remoteCall.swift.
2022-01-13 13:48:53 -08:00
Nate Chandler
ae3da173c4 [Test] Disabled distributed_actor_remoteCall.swift. 2022-01-13 13:47:14 -08:00
Konrad `ktoso` Malawski
50ae3bda22 linux still hangs 2022-01-13 18:45:34 +09:00
Konrad `ktoso` Malawski
ef14ff15e8 [Distributed] Refactor Invocation to Decoder/Encoder 2022-01-13 18:27:18 +09:00
Konrad `ktoso` Malawski
930480b864 [Distributed] Pass args from Invocation to HBuffer 2022-01-12 23:48:01 +09:00
Pavel Yaskevich
680698e099 [Distributed] Fix _executeDistributedFunction resume and result buffer (#40814)
* [Distributed] Adjust interface of `swift_distributed_execute_target`

Since this is a special function, `calleeContext` doesn't point to
a direct parent but instead both parent context (uninitialized)
and resume function are passed as last arguments which means that
`callContext` has to act as an intermediate context in call to accessor.

* [Distributed] Drop optionality from result buffer in `_executeDistributedTarget`

`RawPointer?` is lowered into a two arguments since it's a struct,
to make it easy let's just allocate an empty pointer for `Void` result.

* [Distributed] NFC: Update _remoteCall test-case to check multiple different result types
2022-01-12 23:18:40 +09:00
Konrad `ktoso` Malawski
9438cf6b2e [Distributed] Func metadata operations and implement executeDistributedTarget entry (#40605)
* [Distributed] Implement func metadata and executeDistributedTarget

dont expose new entrypoints

able to get all the way to calling _execute

* [Distributed] reimplement distributed get type info impls

* [Distributed] comment out distributed_actor_remoteCall for now

* [Distributed] disable test on linux for now
2022-01-09 23:55:06 +09:00
Arnold Schwaighofer
9c2b91609a Mark test Distributed/Runtime/distributed_no_system_boom.swift as UNSUPPORTED on back_deployment_runtime
rdar://86779689
2021-12-21 12:14:14 -08:00
Arnold Schwaighofer
5c969e6919 Disable Distributed/Runtime/distributed_actor_init_local.swift
It fails on some bots.

rdar://86543336
2021-12-16 08:37:26 -08:00
Konrad `ktoso` Malawski
cee89ec541 [Distributed] DistributedActorSystem renaming and redesign (#40387)
* [Distributed] towards DistributedActorSystem; synthesize the id earlier, since Identifiable.id

* Fix execute signature to what Pavel is working with

* funcs are ok in sil

* fixed lifetime of id in inits

* fix distributed_actor_deinit

* distributed_actor_local

* update more tests

fixing tests

fix TBD test

fix Serialization/distributed

fix irgen test

Fix null pointer crashes

* prevent issues with null func ptrs and fix Distributed prorotocol test

* fix deinit sil test
2021-12-13 11:29:25 +09:00
Saleem Abdulrasool
7f67dcb1f9 test: enable async/Distributed tests on Windows
These were previously disabled due to the UB that caused the tests to
fail.  Now that this has been fixed, restore these tests to running
state in line with the other targets.
2021-11-20 08:24:25 -08:00
Saleem Abdulrasool
306662fd29 Concurrency: fix UB in DefaultActor initialization
This fixes a latent UB instance in the `DefaultActor` implementation
that has haunted the Windows target.  The shared constructor for the
type caused an errant typo that happened to compile which introduced
UB but happened to work for the non-Windows cases.  This happened to
work for the other targets as `swift::atomic` had a `std::atomic` at
on most configurations, and the C delegate for the Actor initializer
happened to overlap and initialize the memory properly.  The Windows
case used an inline pointer width value but would be attempted to be
initialized as a `std::atomic`.  Relying on the overlap is unsafe to
assume, and we should use the type's own constructor which delegates
appropriately.
2021-11-19 10:34:41 -08:00
swift-ci
4592132f0b Merge pull request #40045 from apple/wip-missing-skiptest 2021-11-03 19:52:25 -07:00
Konrad `ktoso` Malawski
fc0e549387 [Distributed] Distributed tests should not run in backdeployment 2021-11-04 07:09:53 +09:00
Doug Gregor
c2ba06c3d2 Make the actor transport an associated type of the DistributedActor protocol.
Eliminate the required use of existentials in distributed actors by
introducing the `Transport` associated type into the
`DistributedActor` protocol. Each distributed actor has a known
(concrete) actor transport type, reducing storage requirements and
transport dynamism when it isn't needed.

Distributed actors can manually specify their `Transport` associated
type or pick up a default by looking for a type named
`DefaultActorTransport`. A library that vends an actor transport can
make create a public typealias `DefaultActorTransport` referring to
its transport, so importing that library and defining a distributed
actor will use that library's transport.

Introduce a type-erased `AnyActorTransport` type to provide an
explicitly dynamic actor transport. This is still an important option,
e.g., for cases where one wants to be able to dynamically change the
transport for testing or different kinds of deployment. For now, we
default to this transport in the library (via `DefaultActorTransport`),
but we may very well want to eliminate this because it will be
ambiguous with client libraries that vend their own
`DefaultActorTransport`.
2021-11-01 22:37:33 -07:00
Konrad `ktoso` Malawski
841bd4260a [Concurrency][Distributed] Handle more cases of isolation, protocols, better errors (#39895)
* [Distributed] Handle more cases of isolation, protocols, better errors/notes

* [Concurrency] Actor sync funcs can conform to async protocol reqs

* [Distributed] Offer fixit to add DistributedActor to type when dist func is encountered

* [Distributed] Witness protocol reqs in dist actor protocol extensions

* try to address availability issues
2021-11-01 19:13:33 +09:00
Karoy Lorentey
5e78c3bfdc [Distributed] Restore availability macro definitions & update to 5.6
The _Distributed module is being introduced in Swift 5.6, so its definitions need to come with matching availability. (We don't have version numbers for the associated OS releases, so we need to use placeholder 9999 availability for these.)
2021-10-28 16:41:37 -07:00
Karoy Lorentey
47956908b7 [Concurrency] SwiftStdlib 5.5 ⟹ SwiftStdlib 5.1 (usages)
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib.

Adjust macro usages accordingly.
2021-10-28 14:36:36 -07:00
Artem Chikin
e961e40c9b Disable flaky distributed_actor_init_local.swift test.
Example failure:
https://ci.swift.org/job/oss-swift-incremental-RA-macos-apple-silicon//1575/console
2021-10-26 10:21:07 -07:00
Kavon Farvardin
f8fb279442 improve robustness of dist actor test
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
2021-10-25 13:50:42 -07:00
Kuba (Brecka) Mracek
38e9f3960a Temporarily disable distributed_actor_init_local.swift test because it's flaky (#39894) 2021-10-24 16:08:37 +09:00
Konrad `ktoso` Malawski
495b020b79 [Windows/Distributed] Disable failing test (#39890)
* [Windows/Distributed] Disable failing test

* Mark windows unsupported instead of xfail
2021-10-24 12:03:50 +09:00
Kavon Farvardin
9a76323b83 throwing sync inits are also not fully working 2021-10-21 21:14:22 -07:00
Kavon Farvardin
f75a6e94e4 capture the known problem with multiple actorReady calls in async inits
We haven't yet integrated more deeply into DI to prevent the multiple calls.
2021-10-21 19:41:31 -07:00
Kavon Farvardin
e545557dee remove redundant defers, now that actorReady is called implicitly 2021-10-21 19:41:31 -07:00
Kavon Farvardin
cc1ae9f931 merge coverage of multiple transport args into a runtime test
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.
2021-10-21 19:41:31 -07:00
Konrad `ktoso` Malawski
407bd539c9 [Distributed] speed-up test StdlibUnittest 2021-10-22 07:14:20 +09:00
Konrad `ktoso` Malawski
630190962f avoid unnecessary @available checks 2021-10-22 07:13:33 +09:00
Konrad `ktoso` Malawski
480bb082a9 [Distributed] Naive impl of whenLocal for distributed actors (#39654)
* [Distributed] Hacky impl of whenLocal for distributed actors

* cleanup & fix one test

* disable test on windows
2021-10-10 12:44:57 +09:00
Konrad `ktoso` Malawski
d5a2344882 [Distributed] Disable distributed_actor_local on windows 2021-10-05 08:00:58 +09:00
Konrad `ktoso` Malawski
b63774f954 [Distributed] disable a few runtime tests on windows for now
don't care about SPECIFIC order of deinits
2021-10-05 06:31:50 +09:00
Konrad `ktoso` Malawski
14c432c11d cleanup 2021-10-05 06:31:50 +09:00
Konrad `ktoso` Malawski
d4df6a3e65 [Distributed] Re-enable runtime tests 2021-10-05 06:31:49 +09:00
Konrad `ktoso` Malawski
bf0681d463 distributed thunk flag 2021-10-02 10:28:38 +09:00
Konrad `ktoso` Malawski
ebdb0610b9 [Distributed] Fix when a distributed thunk is invoked, unlock tests 2021-10-02 00:47:30 +09:00
Konrad `ktoso` Malawski
a9dc94810f [Distributed] calls on self should not call the dist thunk 2021-09-30 22:48:06 +09:00
Kavon Farvardin
20271cbad5 Mark test as unsupported on windows to unblock CI
This is a temporary measure tracked by rdar://82593574
2021-08-31 13:25:40 -07:00
Konrad `ktoso` Malawski
77635280c2 [Distributed] Harden distributed_actor_deinit.swift 2021-08-29 21:02:09 +09:00
Konrad `ktoso` Malawski
c868bdd9f1 [Distributed] resolve synthesis via DerivedConformanceDistributedActor <3 2021-08-27 06:21:34 +09:00
Konrad `ktoso` Malawski
e408fa9722 [Distributed] unlock distributed_actor_deinit test again 2021-08-26 18:27:11 +09:00