Skip to content

Deterministic Simulation Testing (DST) #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 21, 2025
Merged

Deterministic Simulation Testing (DST) #177

merged 5 commits into from
Apr 21, 2025

Conversation

Tomperez98
Copy link
Collaborator

@Tomperez98 Tomperez98 commented Apr 21, 2025

Adds deterministic simulation testing (DST) to the python sdk.

This PR implements the mechanics to run dst against the resonate python sdk and a rudimentary DST test that solely ensures invariant checks (aka assertions) are not violated.

In addition to DST this PR also includes:

  • general refactoring and renaming
  • add bridge component to handle dispatching of commands
  • removes the processor component (for the time being)
  • rename task source to message source
  • add tasks to the local store
  • local store is now the default store

Tomperez98 and others added 3 commits April 21, 2025 12:26
Setup CI

Setup CI

Good progress on task transition table

Progress with David

wip

wip

Organize resonate

Fix naming on CI workflow

Gracefull shutdown of poller

tests passing

stop poller first and then resolve

Move to resonate folder

mutate durable promise

Add an use chain encoder

Encode and decode at store lvl

Increase timeout CI

Make encoder private at the edges

Add local impl for callbacks

wip

Wiring inplace

Commands to models

Delete app.py

Add tickable poller

local store: transition tasks and from_dict/to_dict

remove app.py

transition task

transition task

use transition in task store

remove previous create method

wroking

Cool local

Remove file

app.py passing

Add equivalency tests

wip

wip

wip

wip

wip

Add futures to function

stepable store

timeout on step

Remove processor from scheduler

Scheduler request defunctionalisation

Fix tests

Fix tests

test passing

tests passing

All possible ways to run a function from resonate

all to overwrite deps

Fix possible race condition

Remove threading local and use containers

remove app.py

fix signatures on register

use mocking

cover all test cases

assert expected cmd

Add dst simulator (#144)

* Add dst simulator

* Wire up opts

* Update options

* Add dst workflow

Add test for type annotations (#147)

Create notify and add notify message to the local store (#146)

* Handle notify callbacks and tasks

* task completed -> completed

* Replace complete promise check

Add timeout option (#145)

* Add dst simulator

* Wire up opts

* Update options

* Add dst workflow

* Add timeout option

* draft test for signature

* remove unused fixture

* Lint fix

* require all callables to receive ctx

---------

Co-authored-by: David Farr <[email protected]>

Registry with versions (#148)

* Add dst simulator

* Wire up opts

* Update options

* Add dst workflow

* Add timeout option

* draft test for signature

* remove unused fixture

* Lint fix

* require all callables to receive ctx

* registry with versions. Need to fix tests

* test for run passing

* All tests passing

* remove nested if

* Remove registry.remove (#149)

* Fix tests

* add registry methods as overloads

* make registry private

* rollback local store change

---------

Co-authored-by: David Farr <[email protected]>

Small name changes and handle Function in register, run, and rpc

Add unicast, anycast, and anycast_with_pref addresses (#151)

* Add unicast, anycast, and anycast_with_pref addresses

* Remove anycast with preference

Add validation (#150)

* Add validation

* Add some validation

* validations

* Add prefix and raise in function

* Add unittests

* test validations

* move validations to the registry

* Implement suggested changes

* uncomment tests cases

* cover all cases

* add bunch of tests

* all validations

* Run unregister with string

* Update registry and tests

---------

Co-authored-by: David Farr <[email protected]>

Tags to options (#153)

* Pass options

* tests passing

* propagate tags to scheduler

Enable Retry Policies (#155)

Add delay q (#156)

* Surface area changes to enable retry policies

* Retry policies on scheduler

* retry policy at the end of coro

* test retry policies progression

* Retry as options

* Add delay q

* integrate delays with scheduler

* missing coroutine tests

* tests passing

* remove unused commet

Add local message source (#157)

Refactor scheduler to be deterministic (#159)

Rigourous more/done types and lfnc/rfnc dataclasses (#160)

Add durable as option and options per invocation type (#161)

* Add options per function invocation type

* uncomment assertion. Add registry + runners interaction

* Add durable option on the edges

* draft durable option integration into the scheduler

* integrate durable options into the scheduler

Support for calling conventions (#152)

Sleep convention (#164)

* Sleep convention

* Minimal ctx protocol

Promise and AWT translation (#165)

* Promise and AWT translation

* unyielded use AWT instead of Promise

* remove helper methods

Initial version of bridge (#154)

* Initial version of bridge

correctly implement durable or non durable (#166)

Finalize dst (#167)

Get retry policy correct for top lvl (#168)

File for clock and routers (#169)

* File for clock and routers

* Local store support sleep

Add subscribe to remote store (#170)

Fix pyright and ruff warnings and use version in the invoke function … (#171)

* Fix pyright and ruff warnings and use version in the invoke function of the bridge

* Assert that version is set

Encoder only on stores (#172)

Add subscriptions and heartbeats to dst (#173)

Add detached to dst tests (#174)

Add support for delays to the bridge (#175)

Co-authored-by: David Farr <[email protected]>
@Tomperez98 Tomperez98 requested a review from dfarr April 21, 2025 18:02
@dfarr dfarr changed the title Add Deterministic Simulation Testing (DST) for the Python SDK Add Deterministic Simulation Testing (DST) Apr 21, 2025
@dfarr dfarr changed the title Add Deterministic Simulation Testing (DST) Deterministic Simulation Testing (DST) Apr 21, 2025
Copy link
Member

@dfarr dfarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@dfarr dfarr merged commit ec4fc22 into main Apr 21, 2025
1 check passed
@dfarr dfarr deleted the dst branch April 21, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants