Skip to content

fix(engine): recover render nodes after frame failures - #2098

Draft
yuto-trd wants to merge 1 commit into
mainfrom
yuto-trd/fix-render-failure-recovery
Draft

fix(engine): recover render nodes after frame failures#2098
yuto-trd wants to merge 1 commit into
mainfrom
yuto-trd/fix-render-failure-recovery

Conversation

@yuto-trd

Copy link
Copy Markdown
Member

Description

  • Mark a drawable render node dirty when any stage of its render pipeline fails.
  • Clear partial render-node caches while preserving and rethrowing the original exception.
  • Rebuild the drawable graph on the next frame instead of replaying the same faulting operations indefinitely.
  • Add a regression test that reproduces the repeated failure against the previous implementation and verifies recovery on the next render.

The root cause was that RevalidateAll cleared HasChanges before render operations executed. If an operation then threw, the partially evaluated node remained cached as up to date, so subsequent frames reused the same broken operation graph and repeatedly raised InvalidOperationException.

Affected areas

  • Beutl.Engine (rendering / scene / track)
  • Beutl.ProjectSystem (project / document persistence)
  • UI (Beutl.Editor, Beutl.Editor.Components, Beutl.Controls)
  • Beutl.Extensibility (plugin abstractions)
  • Beutl.NodeGraph (node editor)
  • Beutl.FFmpegIpc / Beutl.FFmpegWorker (media IPC boundary)
  • Beutl.Api (server API client)
  • Build / CI / docs only

Breaking changes

None.

Test plan

  • dotnet test tests/Beutl.UnitTests/Beutl.UnitTests.csproj -f net10.0 --filter "FullyQualifiedName~RendererExceptionSafetyTests" --no-restore (3 passed)
  • Related render-node cache, filter crash-safety, and processor exception-safety tests (65 passed)
  • dotnet build src/Beutl.Engine/Beutl.Engine.csproj -f net10.0 --no-restore (0 warnings, 0 errors)
  • git diff --check

Fixed issues / References

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 34b342dc-bc71-4a85-8b54-cd4a39a8e90d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yuto-trd/fix-render-failure-recovery

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

No TODO comments were found.

@drift-check

drift-check Bot commented Jul 15, 2026

Copy link
Copy Markdown

Code Review Bot

No comment/code divergences or documentation drift detected. Reviewed 2 file(s); skipped 0.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
Beutl 17% 10% 10706
Beutl.AgentToolkit 90% 74% 7196
Beutl.Api 19% 12% 1195
Beutl.Configuration 59% 34% 411
Beutl.Controls 30% 13% 5517
Beutl.Core 68% 59% 3069
Beutl.Editor 82% 79% 2857
Beutl.Editor.Components 18% 12% 9779
Beutl.Embedding.MediaFoundation 6% 8% 1374
Beutl.Engine 68% 57% 19111
Beutl.Engine.SourceGenerators 59% 44% 540
Beutl.ExceptionHandler 0% 0% 45
Beutl.Extensibility 46% 58% 107
Beutl.Extensions.AVFoundation 0% 2% 202
Beutl.Extensions.FFmpeg 28% 26% 738
Beutl.Extensions.FFmpeg.Core 49% 30% 323
Beutl.FFmpegIpc 27% 35% 858
Beutl.FFmpegWorker 4% 4% 898
Beutl.Language 44% 50% 1495
Beutl.NodeGraph 26% 17% 2477
Beutl.PackageTools.UI 0% 0% 657
Beutl.ProjectSystem 75% 61% 1266
Beutl.Testing.Headless 88% 92% 15
Beutl.Threading 100% 90% 137
Beutl.Utilities 94% 87% 358
Beutl.WaitingDialog 0% 0% 36
Iciclecreek.Avalonia.Terminal 33% 21% 1164
XTerm.NET 15% 7% 2009
Summary 44% (86648 / 195368) 36% (20766 / 57702) 74540

Minimum allowed line rate is 0%

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