Skip to content

WIP: reperform pass/delegate from current handler frame#368

Open
proboscis wants to merge 1 commit intomainfrom
issue/vm-fix-dispatch-regression/run-20260323-121041
Open

WIP: reperform pass/delegate from current handler frame#368
proboscis wants to merge 1 commit intomainfrom
issue/vm-fix-dispatch-regression/run-20260323-121041

Conversation

@proboscis
Copy link
Copy Markdown
Owner

Summary

  • change handle_forward() to read the current handler's ProgramDispatch from the current segment instead of recovering forwarding context via current_dispatch_id() / dispatch_origin_for_dispatch_id()
  • reuse the current frame's effect, handler_continuation, and prompt marker when building the parent reperform path for Pass / Delegate
  • drop the now-unused caller-visible helper that existed only to support the old DispatchId lookup path

Validation

  • cargo check in packages/doeff-vm-core
  • uv run --with maturin maturin develop --release in packages/doeff-vm
  • uv run pytest tests/core/test_vm_ocaml5_violations.py -q34 passed in 0.12s
  • uv run pytest tests/test_pass_dispatch_context_regression.py -q ❌ timed out inside run(...)
  • uv run pytest tests/test_cache_memo_rewriter_with_env.py -q ❌ timed out inside run(...)
  • minimal manual repro (timeout 12s uv run python -u ...) printed only:
    • start run
    • program perform EffectA
      and then hung before any Python handler body executed

Current status

This is intentionally incomplete per issue guidance. The change moves Pass / Delegate toward an OCaml-5-style reperform that takes (effect, k) from the current handler frame instead of looking the dispatch context up by ID, but built-in handler layers are still reperforming into the wrong place before user handlers are reached.

Refs: vm-fix-dispatch-regression

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.

1 participant