Skip to content

Comments

Animation System POC — Phase A proof of concept (Issue #208)#248

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/implement-animation-system-poc
Draft

Animation System POC — Phase A proof of concept (Issue #208)#248
Copilot wants to merge 2 commits intomasterfrom
copilot/implement-animation-system-poc

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

Implements the Phase A "Seams" POC from the Animation System Preparation epic. Validates the architecture defined in docs/ANIMATION_SYSTEM_DESIGN.md with runnable code, a WinForms demo, and a full unit-test suite. No existing source files are modified.

All files land under Experimental/AnimationPOC/.


New animation engine library (AnimationPOC/)

Interfaces (all additive, no legacy code changed)

  • IScanTimer — abstracts System.Timers.Timer; breaks the non-injectable pain point (P1)
  • IScanModeStrategy + IScanContext + ScanInputAction — strategy plugin contract (§4)
  • IAnimationSession — per-panel lifecycle (Start/Stop/Pause/Resume/Interrupt/Transition)
  • IAnimationService — singleton session factory
  • IHighlightRenderer — WinForms/WinUI 3/DirectX swap point
  • IEventBus / IEvent — POC-local pub/sub (mirrors ACATCore contract without depending on it)

Config

  • AnimationConfig / AnimationSequenceConfig / AnimationWidgetConfig — JSON-first POCOs mapping directly to schemas/json/animation-config.schema.json; all five schema migration constraints (C1–C5: @VariableName refs, wildcards, PCode strings) handled as string fields resolved at Start() time

Infrastructure

  • SystemScanTimer — thin System.Timers.Timer wrapper, zero behaviour change
  • TestScanTimer — synchronous ManualTick() for deterministic timer-driven tests (no Thread.Sleep anywhere in the test suite)
  • SimpleEventBus — strong-ref pub/sub for POC

Core

  • AnimationSession — lock-protected (_sessionLock) state machine; lock released before IEventBus.Publish() and IHighlightRenderer calls to avoid UI-thread deadlocks
  • AnimationService + DefaultScanStrategyFactory — named strategy resolution (keyed-DI fallback pattern for .NET 4.8.1 compatibility)
  • AnimationStateChangedEvent, AnimationTransitionEvent, AnimationHighlightEvent

AutoScanStrategy — the only strategy in Phase A; stateless sequential advance, exactly matching the §4.2 pseudo-code:

public int SelectNext(IReadOnlyList<AnimationWidgetConfig> widgets, int currentIndex, IScanContext ctx)
{
    if (widgets == null || widgets.Count == 0) return -1;
    if (currentIndex < 0) return 0;
    int next = currentIndex + 1;
    return next >= widgets.Count ? -1 : next;
}

WinForms scanner demo (AnimationPOCDemo/)

6-button row scanner (A–F) showing the new engine end-to-end:

  • Start / Stop / Pause / Resume / Press Switch (simulates actuator input)
  • Variable scan speed (200 ms – 2 000 ms)
  • Live EventBus event log and highlight-dispatch latency display
  • WinFormsHighlightRenderer handles BeginInvoke marshalling

Unit tests (AnimationPOC.Tests/) — 19 tests covering T01–T15

File Covers
AutoScanStrategyTests.cs T01–T03: SelectNext boundaries; HandleInput for auto/paused; Name
TestScanTimerTests.cs T04–T05: synchronous ManualTick; AutoReset=false; Start/Stop
AnimationSessionTests.cs T06–T14: state transitions, AnimationStateChangedEvent publishing, widget order, pause-position preservation, Interrupt, loop, iteration stop
PerformanceTests.cs T15: EventBus dispatch < 1 ms; session construction < 20 ms for 8-widget and 25-widget (BCI worst-case) configs; tick overhead < 1 ms

Performance highlights (vs. current system)

Metric Current (estimated) POC Target
Session construction, BCI 25-widget config ~80–150 ms (XML parse + CoreGlobals lookups) < 0.2 ms ≤ 20 ms
EventBus dispatch per event BeginInvoke (unbounded queue) < 0.01 ms ≤ 1 ms
Timer tick overhead N/A < 0.05 ms ≤ 1 ms

Full analysis in Experimental/AnimationPOC/PERFORMANCE_RESULTS.md.


Out of scope (Phase B/C/D)

ManualScanStrategy, BciScanStrategy, IAnimationConfigProvider/XmlAnimationConfigAdapter, JSON schema validation, EventBus cutover for EvtPlayerStateChanged, PanelAnimationManager wire-up.

Original prompt

This section details on the original issue you should resolve

<issue_title>Animation System POC</issue_title>
<issue_description>Implement simple proof of concept for new animation system.

Acceptance Criteria:

  • Basic POC implemented
  • Simple scanner rendered
  • Performance compared with existing
  • Design validated
  • POC code committed (feature branch)

POC Scope:

  • Load new format (JSON)
  • Create simple scanner
  • Render with basic animations
  • Measure performance

Files to Create:

  • Experimental/AnimationPOC/ directory (feature branch)
  • POC implementation
  • Performance comparison results

🔗 Dependencies

Epic: Animation System Preparation

Estimated Effort: 3 days


Parent Feature: #195 - Animation System Preparation

</issue_description>

<agent_instructions>use all of the information provided by the Animation Migration Specification provided by the sub tasks of Feature #195 to develop the POC. Extra helpful would be a very simple Demo application of the new animation system.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Add Experimental/AnimationPOC/ with new animation engine interfaces,
  AutoScanStrategy, AnimationSession, AnimationService, TestScanTimer
- Add Experimental/AnimationPOCDemo/ WinForms scanner demo application
- Add Experimental/AnimationPOC.Tests/ with 19 unit tests (T01-T15)
- Add PERFORMANCE_RESULTS.md and README.md for POC documentation
- No existing source files modified (pure addition)

Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement proof of concept for new animation system Animation System POC — Phase A proof of concept (Issue #208) Feb 21, 2026
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.

Animation System POC

2 participants