Fix motionblur effect: EffectContext missing state attribute #45

Closed
opened 2026-03-19 10:26:04 +00:00 by david · 1 comment
Owner

Problem

The motion blur acceptance test (tests/test_framebuffer_acceptance.py::TestFrameBufferAcceptance::test_framebuffer_with_motionblur_effect) fails with:

AttributeError: 'EffectContext' object has no attribute 'state'

This occurs when MotionBlurEffect tries to access ctx.state in its process_partial() method.

Root Cause

The EffectContext dataclass in engine/effects/types.py doesn't include a state field, but MotionBlurEffect expects it to access framebuffer history and effect-specific state.

Context

  • MotionBlurEffect and AfterimageEffect need persistent state across frames (history buffer)
  • FrameBufferStage stores history in context keys like framebuffer.{name}.history
  • Effects need to access this via context, but EffectContext structure is incomplete
  • engine/effects/types.py - EffectContext definition
  • engine/effects/plugins/motionblur.py - Effect expecting state
  • tests/test_framebuffer_acceptance.py - Failing test

Proposed Fix

Add a state field to EffectContext that provides access to the pipeline's state dictionary, or provide a more specific mechanism for effects to access framebuffer history.

Test Status

One of 2 failing acceptance tests blocking full test suite pass (672/674 tests would pass after both fixes).


Part of larger effort: Complete pipeline demo and acceptance tests

## Problem The motion blur acceptance test (`tests/test_framebuffer_acceptance.py::TestFrameBufferAcceptance::test_framebuffer_with_motionblur_effect`) fails with: ``` AttributeError: 'EffectContext' object has no attribute 'state' ``` This occurs when MotionBlurEffect tries to access `ctx.state` in its `process_partial()` method. ## Root Cause The `EffectContext` dataclass in `engine/effects/types.py` doesn't include a `state` field, but MotionBlurEffect expects it to access framebuffer history and effect-specific state. ## Context - MotionBlurEffect and AfterimageEffect need persistent state across frames (history buffer) - FrameBufferStage stores history in context keys like `framebuffer.{name}.history` - Effects need to access this via context, but EffectContext structure is incomplete ## Related Files - `engine/effects/types.py` - EffectContext definition - `engine/effects/plugins/motionblur.py` - Effect expecting state - `tests/test_framebuffer_acceptance.py` - Failing test ## Proposed Fix Add a `state` field to EffectContext that provides access to the pipeline's state dictionary, or provide a more specific mechanism for effects to access framebuffer history. ## Test Status One of 2 failing acceptance tests blocking full test suite pass (672/674 tests would pass after both fixes). --- Part of larger effort: Complete pipeline demo and acceptance tests
david closed this issue 2026-03-19 10:34:09 +00:00
Author
Owner

Fixed in commits:

  • 0eb5f1d: Added state property to EffectContext for motionblur/afterimage effects
  • 238bac1: Complete pipeline hot-rebuild implementation with acceptance tests

The motionblur and afterimage effects now properly access the state dictionary through the new ctx.state property, which provides direct access to the internal _state dictionary. This resolves the AttributeError that was preventing the effects from accessing framebuffer history.

Fixed in commits: - 0eb5f1d: Added `state` property to EffectContext for motionblur/afterimage effects - 238bac1: Complete pipeline hot-rebuild implementation with acceptance tests The motionblur and afterimage effects now properly access the state dictionary through the new `ctx.state` property, which provides direct access to the internal `_state` dictionary. This resolves the AttributeError that was preventing the effects from accessing framebuffer history.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: klubhaus/sideline#45