Optimize slog dispatch for spawned cache tasks#350
Open
proboscis wants to merge 3 commits into
Open
Conversation
Owner
Author
|
Addressed review round 1:
Re-verified after the follow-up fix:
|
Owner
Author
|
Round 3 addressed in 0ac9ceb. Changes:
Why this fixes the root cause:
Validation:
|
proboscis
added a commit
that referenced
this pull request
Mar 18, 2026
Introduces a unified scope abstraction for the doeff VM that separates static scope (handlers, interceptors, variables) from dynamic execution state (segments, frames). Key changes: - Scope as first-class concept: handler chain + interceptors + variable table - Scoped variables with Python-like shadow/nonlocal semantics - GetScopeOf(k) + CreateContinuation(program, scope) replaces GetHandlers - ResumeContinuation becomes trivial (no handler re-installation) - Fixes handler duplication in Spawn structurally - RustStore/ScopeStore replaced by generic variable table - TDD test plan with 24 tests Motivated by: handler duplication bug (#342, PR #350), RustStore violation, ScopeStore leaking into VM segments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
PyTelldispatch so cacheslog()calls can write directly into the Rust store without re-entering the full handler pathdebug_info()on every scanGetHandlers()/Spawn, which removes the duplicated handler chain seen in cached spawned tasksSpawnVerification
uvx maturin develop --releaseuv run pytest tests/test_cache_await_spawn_hang.py -q7 passed in 5.52suv run pytest tests/test_cache_await_spawn_hang.py tests/test_with_handler_type_filter_regression.py tests/effects/test_local_handler_ask.py::test_local_eval_keeps_typed_handler_filtering -q20 passed in 6.65sN=500, persistent sqlite cache, same cache task with cacheslogmonkeypatched on/off)cache_slog_off ok= True elapsed= 1.318 len= 500cache_slog_on ok= True elapsed= 2.089 len= 500GetHandlers()length inside the spawned cached task is now9instead of the duplicated18Notes
cargo testinpackages/doeff-vm-corepassed.cargo testinpackages/doeff-core-effectsis currently blocked by pre-existing scheduler test compile errors that still referenceReadySet::Fifo/ReadySet::Priority; this is unrelated to the writer-dispatch fix.Issue:
slog-handler-perf-concurrent-spawn