Repository navigation
feat(domain): verify handlers that sleep, race, time out and run fibers - #3743
Open
sam-goodwin wants to merge 70 commits into
Open
sam-goodwin wants to merge 70 commits into
sam-goodwin wants to merge 70 commits into
Conversation
… on a virtual clock
… on time and fibers
…library on the handler's timeline
…e timeline, and one that never ends is stopped
Contributor
Website Preview DeployedURL: https://pr-3743-alchemy-website-preview.testing-2b2.workers.dev Built from commit This comment updates automatically with each push. |
Contributor
|
Install the packages built from this commit: alchemypnpm install https://pkg.alchemy.run/alchemy/pr:3743:5915225@alchemy.run (15)pnpm install https://pkg.alchemy.run/@alchemy.run/acme/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/hetzner/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/railway/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/fly/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/gcp/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/aws/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/domain/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/kubernetes/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/docker/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/redis/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/sql/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:3743:5915225Transitive Dependencies (14)pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/s3/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/aws4signer/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/iceberg/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/gcp/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/effect-cluster/pr:3743:5915225pnpm install https://pkg.alchemy.run/@alchemy.run/rivet/pr:3743:5915225pnpm install https://pkg.alchemy.run/@distilled.cloud/rivet/pr:3743:5915225Published |
…e, and the report's lines pinned to the docs
…try across fibers
…hore, ScopedCache and Pool.makeWithTTL
…n out once it is rounded
…sts written as classes
…ore of arrays and objects
…n, Array, JSON and the rest
…on how deep functions call
… and the stream forms of filters and reasons
…on, Optic.get and the library's errors made by the code
…nRef.modify, MutableRef.compareAndSet
…ilterMap and the unsafe forms
…and more of RequestResolver
…ch, and more of Stream
…tMap, Schedule.concatResult
…ceScoped, Match.fn
… changesStream, Sink.never
…form, toTransform, embedInput
…nsafe, Scope.closeUnsafe
…le.get, TxHashMap hash lookups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A handler that sleeps, sets a time limit, races two effects or starts a fiber is now proved, for every duration an input can give:
The prover does not model these. It hands the library the handler's effects and lets the library run them, on time that passes only when no fiber can run. What a race, a time limit, an interrupt or a finalizer does is then what the deployed handler does, by being the same code. Supported this way:
The same holds for what a stream is made of, for a scope the code holds, and for random numbers a seed decides:
More of the language and of plain values is read too:
Optics, sinks, channels and filters are the library's own, composed as it composes them:
Aggregate.predictruns a handler on the same clock, so a prediction of one that waits is made at once:Still reported, each with its reason:
A handler that waits again and again without end is now reported (
waits more than 10000 times: the handler would never end). This is what a stream's own time limit does in a handler:Stream.timeoutworks out its deadline from the clock, and a handler's clock stays at the time the command is handled at.The report's assumptions gain one line: code between two waits takes no time, so a time limit never stops a computation that does not wait.
A path no input takes is no longer reported when the prover stops on it.
Code the library runs at once (a
Stream.partitionQueuefilter, anEffect.callbackregister function, a cache'stimeToLive) takes both sides of a branch an input decides. A side no input takes is dropped when its path is checked. Before, such a branch asked the solver from inside a synchronous run and left the question running.Effect.timed,Sink.timedandSink.withDurationmeasure with the machine's clock, not the handler's, so they are reported.A policy's handler that waits is followed by the search of the model too. A test now pins each line of a report that the docs and the skill quote to a message the prover says.