Commit Graph
69 Commits
Author SHA1 Message Date
Philippe Hausler cca423ff03 Remove the disable of availability and mark methods as available to clock/instant/duration (#165)
* Remove the disable of availability and mark methods as available to clock/instant/duration

* Rework availability to be more permissive for tests

* Use hand coded values instead of defines (only available via Darwin versions of Dispatch)

* Adjust additional test availability

* Correct debounce test availability guard

* Update build instructions to indicate Xcode requirements

* Ensure the clock property of the validation diagram is only available for targets that can support it
2022-06-16 13:06:20 -07:00
Thibault Wittemberg 9a3e94d440 compacted: rename unit tests (#166) 2022-06-15 23:28:45 -07:00
Thibault Wittemberg a973b06d06 Fix async channel finishes all (#152)
* asyncChannel: enforce termination for all when finished

* asyncThrowingChannel: enforce termination for all when finished

* asyncChannel: improve unit tests readability

* asyncChannel: adapt the Guide to the new finish behaviour

* asyncChannel: adapt the Guide to the new finish behaviour
2022-05-04 13:07:33 -07:00
Thibault Wittemberg bbbe08d331 zip: improve unit tests readability (#151) 2022-04-25 17:50:09 -07:00
Kristoffer Johansson 94a7ecec28 Moves XCTestCase.validate into its own module (#135)
* Move XCTestCase.validate into it’s own module

* Remove unnecessary import statement
2022-04-08 14:15:55 -07:00
Philippe Hausler 6a8aec2a1f #131 Cancel sends as if they were terminal events on task cancellation (#132) 2022-04-08 10:44:30 -07:00
Philippe Hausler 18749897a8 #113 Define the first element of throttled sequences by not exceeding the rate (and fix a expectation misalignment of events) (#133)
* #113 Define the first element of throttled sequences by not exceeding the rate (and fix a expectation misalignment of events)

* Update guide for throttle referencing the first element and duration measurement
2022-04-01 11:40:44 -07:00
Tiago Lopes 442d20e8c8 Fix TestRangeReplaceableCollection.swift file name (#128) 2022-03-30 10:20:19 -07:00
Laszlo Teveli b136d48e7f Adjacent Pairs (#111) 2022-03-29 10:01:55 -07:00
Reza Shirazian 4b5a3ef050 measureSequenceThroughput-duration-clean-up (#125)
duration and start property in measureSequenceThroughput is vestigial from early development. This PR cleans that up.
2022-03-29 09:10:51 -07:00
Reza Shirazian fac138c517 #45 - Two sided performance test for merge (#114)
This PR extends `measureSequenceThroughput` to take two outputs so functions like merge/ zip etc can be tested by both sides.
2022-03-28 17:09:22 -07:00
Philippe Hausler 21f20e9030 Only emit diagnostics for unexpected diagram mismatches (#103) 2022-03-24 15:14:40 -07:00
Philippe Hausler 98d4229317 Add shims and adjust availability to allow for swift 5.6 toolchains to build until source stability is achieved (#100)
* Add shims and adjust availability to allow for swift 5.6 toolchains to build until source stability is achieved

* Restore availability again
2022-03-24 12:09:07 -07:00
kperryua d4bdb34283 Add a no-separator variant of joined() to match the stdlib (#87)
* Add a no-separator variant of joined() to match the stdlib

* @inlinable and @frozen
2022-03-18 14:04:00 -07:00
Philippe Hausler e87e9ddd02 Reduce warnings for preconcurrency and non mutated vars (#88) 2022-03-17 16:13:57 -07:00
Philippe Hausler 3447a342ac Get nearly everything up and rolling for linux (#85)
* Get nearly everything up and rolling for linux

* Alter validation diagrams for an internal function to expect failures
2022-03-17 15:14:57 -07:00
Philippe Hausler 571bfd1a60 Add an implementation of inclusive reductions (#81) 2022-03-15 13:08:15 -07:00
Philippe Hausler 7545f0b7d2 Remove debugging prints from validation tests 2022-03-14 13:53:21 -07:00
Philippe Hausler 9d46190d67 Implement source location information for pairwise block builders (#58)
* Implement source location information for pairwise block builders

* Enable better source locations for latest validation diagrams

* Use the new naming for partial builders

* Ensure pairwise builder expressions preserve source locations
2022-03-14 13:51:00 -07:00
Philippe HauslerandKevin Perry 6ba2c05cfa A full knobs-and-dials buffering strategy transformation (#61)
* A full knobs-and-dials buffering strategy transformation

* Refine the AsyncBuffer type to require actor and add some additonal tests for custom buffer types

* Migrate the internal state to an actor

* Remove default unbounded policy from buffers

* Remove some dead code tests and fix space removal to avoid superfluous checks

* Simplification of nominal state machine, which helps eliminate actor interleaving issues. Fixed error/termination handling. Validation diagram tests, using “delay next” operators

* Most robust behavior when multiple tasks are concurrently accessing the iterator

* Removed Envelope, added base iterator Sendable requirement, and added conditional Sendable conformances

* Minor future-proofing

Co-authored-by: Kevin Perry <kperry@apple.com>
2022-03-14 13:41:44 -07:00
Philippe Hausler f0f348a680 Unify naming of chunks a bit more (#74) 2022-03-14 11:47:07 -07:00
Philippe Hausler 09803ec7f9 Rename tests for Task.select and remove the testable import to enable release mode testing (#79) 2022-03-11 17:59:03 -08:00
Philippe Hausler 8ae8027341 Print diagnostics such that the comparisons of expected versus actual use the diagram as would be written (#77) 2022-03-11 16:24:24 -08:00
Philippe Hausler 4b11faad62 Clean up some more warnings via an additional Sendability pass audit (#72) 2022-03-11 12:56:43 -08:00
Kevin Perry fee904ba10 Add delayNext “,” operator to validation diagram 2022-03-08 16:54:53 -08:00
Philippe Hausler a52b55c8ac Reduce warnings from preconcurrency issues and unused values (#71) 2022-03-07 12:55:17 -08:00
Kevin Perry 625ac79d5f Tweaked signatures of chunks/chunked methods 2022-03-03 12:08:57 -08:00
Philippe Hausler 61bc878106 Add a performance tuned asynchronous iterator for creeating asynchronous byte sequences (#39)
* Add a performance tuned asynchronous iterator for creeating asynchronous byte sequences

* Some spelling fixes and language clarity improvements

* Add some more detail on the docs for the `AsyncBufferedByteIterator` initializer

* Move the storage to a usable from inline type
2022-03-01 13:25:55 -08:00
Philippe Hausler 9377b4de58 Validate AsyncSequence specification SE-0323 (#60) 2022-03-01 12:37:45 -08:00
Philippe Hausler 2683ddc9c3 Rename to AsyncChannel (#63) 2022-03-01 09:11:37 -08:00
kperryua b8242c4a6b Add sequences that chunk values into collections based on a variety of criteria (#55)
* Add sequences that chunk values into collections based on a variety of criteria

* Factor out Merge2 logic so its termination behavior can be customized

* Rewrite AsyncChunksOfCountAndTriggerSequence in terms of the newly configurable merge state machine

* Name changes

* Fixed tests

* Enable chunked(byTime:) functions

* Broken up into one file per sequence
2022-02-23 17:17:20 -08:00
Philippe Hausler eb0ddf54cc Rename validation tests to match latest testing API (#59) 2022-02-23 15:53:21 -08:00
Philippe Hausler 4c35512ba6 implement a sequence for debouncing incoming events to an expected quiescence duration (#43)
* implement a sequence fir debouncing incoming events to an expected quiessence duration

* Ensure debouced sequences are sendable and update testing to the new validate method

* Add hangover tests and cancel sleep per iteration of production
2022-02-23 15:04:45 -08:00
Philippe Hauslerandkperryua 7969001299 Add a detailed proposal-like guide for AsyncSequence validation (#56)
* Add a detailed proposal like guide for MarbleDiagram

* Slight spacing change

Co-authored-by: kperryua <kperry@apple.com>

* Fix some pluralization agreement

Co-authored-by: kperryua <kperry@apple.com>

* Clarify the testing of merge and add a future direction for unordered groups

* rename the diagram system to a more general 'validate' based name

* Spelling fixes

* Grammar fixes for credits

Co-authored-by: kperryua <kperry@apple.com>
2022-02-22 11:03:27 -08:00
Philippe Hausler 5bfab6f07a Add a timer based async sequence (#54)
* Support cancellation for marble diagrams

* Add a timer based async sequence

* Test skewing events by sleeps inside the map

* A less confusing skew cancellation tick
2022-02-18 16:44:07 -08:00
Philippe Hausler 46b3bb088b implement a sequence for throttling incoming rates to a minimum spaced duration (#41)
* implement a sequence for throttling incoming rates to a minimum spaced duration

* Add delayed emission tests for throttle
2022-02-18 00:06:06 -08:00
Philippe Hausler d96606e7f7 Clean up the marble diagram implementation and factor it into a per Task based queue system (#44)
* Split the marble diagram code out into their own files for easier refactoring

* Update latest landing InstantProtocol definition stub

* Migrate to a per Task based queue system to avoid blocking valid future jobs

* Factor inputs to be specialized waits for side tracking

* Add grouping support

* Add tests for grouping and parse failures

* Fixup misstep in package definition for clock stub imports for the marable diagrams

* Add descriptions for partial iterations for debugging aides

* Simplify Task.select implementation to handle continuations more encapsulatedly

* Add descriptions for WorkQueue items for debugging and use stable work queue drains
2022-02-18 00:05:36 -08:00
Philippe Hausler 303e6a9b15 Add marble diagrams for merge and correct partial state transitions (#42) 2022-02-18 00:04:44 -08:00
Philippe Hausler f20f7fbe85 Rework marble diagrams to account for task execution (#40)
* Rework marble diagrams to account for task execution

* Add marble diagram tests to validate failure paths

* Test for space no-op in marable diagram DSL

* Factor out parsing into events and generalize
2022-02-14 11:50:05 -08:00
Philippe Hausler 47aa4ccba6 A continuous form of reduce and a throwing variant of that reduction (#35) 2022-02-08 10:16:17 -08:00
Philippe Hausler d905d2a465 Async on both send and iteration subject like behavior (#34)
* Async on both send and iteration subject like behavior

* rename the initial state to idle for subjects
2022-02-01 09:21:06 -08:00
Philippe Hausler 0e37dffc8c Correct generation rename misstep 2022-01-31 15:40:40 -08:00
Philippe Hausler 845d11a3bd Marble diagram based testing (#30)
* First draft at marble diagram based tests

* Correct indefinite marble runs, support grouping, and properly handle any number of inputs (by the result builder construction)

* enhance isolation of diagrams with fileprivate
2022-01-31 15:28:17 -08:00
Philippe Hausler c147131251 Add a testing support item for manual clocks (#27)
* Add a testing support item for manual clocks

* rename `id` to `generation` and add an advance by steps
2022-01-31 15:25:42 -08:00
Philippe Hausler 91aa4a85d4 refine the sample time for throughput measurements so that it does not take so long for the tests (#28) 2022-01-25 14:57:04 -08:00
Philippe Hausler 7e3b1c1164 Add a 2 and 3 arity version of combineLatest (#20) 2022-01-25 13:14:38 -08:00
kperryua 91968fa3e9 AsyncSequence throughput performance tests (#19)
* AsyncSequence throughput performance tests

* Reduce source sequence overhead

* Normalize whitespace

* Added joined() throughput test

* File renaming
2022-01-25 12:07:23 -08:00
Philippe Hausler 18fcfe8e29 [NFC] Fixup attribution dates in comments (#22) 2022-01-25 09:52:32 -08:00
Philippe Hausler 27e6645329 Add a validator testing support mechanism (#24)
* Add a validator testing support mechanism

* Move the remaining support items into the test support directory

* Add rudimentary tests to validate the validator
2022-01-24 17:40:58 -08:00
kperryua 4c93fa2c87 Merge pull request #17 from apple/pr/joined
Add a sequence for joining multiple async sequences with separators
2022-01-24 17:24:23 -08:00