Skip to content

Fast renderer: retry an effect that raised, like the default renderer - #67

Merged
maartenbreddels merged 1 commit into
masterfrom
fix/fast-retry-failed-effects
Sep 29, 2026
Merged

maartenbreddels merged 1 commit into
masterfrom
fix/fast-retry-failed-effects

Conversation

@maartenbreddels

Copy link
Copy Markdown
Contributor

Part of the audit of REACTON_FAST=1 against the default renderer. This is one small PR per finding; this one is F2.

Problem

When an effect raises, Effect.executed stays False, and the default renderer runs it again on the next tree walk. The fast renderer skips a component whose element and state did not change (the clean-subtree fast path). So a failed effect in the root component, or in a memoized child, was never retried in fast mode.

Fix

The clean-subtree fast path in _RenderContextFast._render now also requires that the context has no effect work left: no effect that was never executed, and no pending next effect. The check loops over that component's own effects, so it is cheap. The benchmarks do not change: leaf update 0.65 ms, memo subtree skip 1.20 ms. The default renderer is not touched.

Tests

  • test_failed_root_effect_is_retried_on_later_tree_walk and test_failed_effect_in_memoized_child_is_retried_on_later_tree_walk fail on master with REACTON_FAST=1.
  • test_effect_cleanup_exception_does_not_retry_cleaned_effect checks that a cleanup that raised does not cause an extra retry.
  • With this PR, all three pass in both modes.
  • Full suite: 212 passed (default), 213 passed (fast).

The fix was written by a codex worker and verified by me. It is small, so it got no crossreview.

🤖 Generated with Claude Code

When an effect raises, it stays marked as not executed, and the default
renderer runs it again on the next tree walk. The fast renderer skipped
a component whose element and state did not change, so for the root
component and for memoized children a failed effect was never retried.
A component with effect work left to do is now never skipped as clean.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@maartenbreddels
maartenbreddels merged commit ef0642c into master Sep 29, 2026
24 checks passed
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