Skip to content

Harden startup plugin loading and add progress feedback#1297

Open
francescofugazzi wants to merge 4 commits into
MrNeRF:masterfrom
francescofugazzi:master
Open

Harden startup plugin loading and add progress feedback#1297
francescofugazzi wants to merge 4 commits into
MrNeRF:masterfrom
francescofugazzi:master

Conversation

@francescofugazzi

Copy link
Copy Markdown
Contributor

This PR makes startup plugin loading more robust and visible, especially for heavy plugins that can otherwise stall the splash screen.

Changes:

  • Defer startup plugin autoload until the UI is initialized.
  • Add a startup plugin loading progress bar to the splash screen.
  • Suspend Python-driven panel updates, signal flushing, and scene sync while startup plugin preload is running.
  • Keep the splash screen visible until plugin loading completes, and only show the click-to-continue prompt at 100%.

Example:

  • densification is a representative heavy plugin for this path, since it can take several seconds to import when loaded at startup.

Notes:

  • The goal is to keep startup responsive even when plugins are slow or expensive to import.
  • This keeps the issue isolated in LichtFeld startup handling rather than requiring plugin changes.

@shadygm shadygm self-requested a review June 14, 2026 10:35
@shadygm

shadygm commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR! Here are some of my comments:

  1. There seems to be a bug with the splash screen, it currently takes up the width of the viewport when before it was not.
image
  1. I'm not 100% sure we want to have the plugin loading status on the splashscreen, that is up to @MrNeRF to decide.

  2. The UI looks kinda funky on startup, maybe it is because of the deferred loading implemented?

image
  1. Merge with master, some changes have happened since the PR

@MrNeRF

MrNeRF commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Hey, I am looking at the pr. Not 100% sure about shifting the work into the main thread.

When I added the system I added an explicit warning for the plugin developers so that they don't do heavy initializations on startup. For instance, the densification plugin loading warns explicitly:

[15:23:18.385] [warn] module.cpp:1818 [Python] Plugin 'densification' module load took 1371ms — defer heavy imports to speed up startup: densify: 1370ms

I think it MUST be fixed in the plugin @shadygm.
Maybe I should add something that refuses the load of plugins if they block the startup.

Anyway, I think the pr has some nice bits. The startup overlay must be fixed. I also think that the loading bar with the added text surrounding should be represented in a much more compact way.

Issues:

  • Startup overlay (blocker)
  • Language selection broken (blocker)
  • I need to click into the scene so it starts rendering (huge blocker)
  • Locales are missing.

@MrNeRF MrNeRF self-requested a review June 14, 2026 13:56

@MrNeRF MrNeRF left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments above

- Defer startup plugin autoload until after the UI is initialized to prevent heavy plugin imports from freezing the splash screen.
- Add a startup plugin loading progress bar so long-running imports remain visible during application startup.
- Suspend Python-driven panel updates, signal flushing, and scene sync while startup plugin preload is running to avoid main-thread/GIL stalls.
- Keep the splash screen visible until plugin loading completes, and only reveal the click-to-continue prompt at 100%.
- Use `densification` as the representative heavy plugin for this startup path, since it can take several seconds to import when loaded at startup.
- Keep the startup plugin loading text aligned with the plugin that is actually being imported, so the splash no longer shows stale counts or the wrong plugin name while the next plugin is loading.
- Change the final completion state to a simple Loaded once the last startup plugin finishes.
- Hide the plugin progress row entirely when no plugins are configured to load at startup.
- Fix the additional startup crash path caused by clicking or resizing the window while plugin autoload is still running.
- Preserve the existing startup loading flow and responsiveness work from the previous commit.
@francescofugazzi francescofugazzi marked this pull request as draft June 14, 2026 14:23
- Rework the startup plugin loading row to keep the layout compact and stable during progress updates.
- Prevent the late-stage alignment shift when loading transitions to completion.
- Keep splash dismissal as a click-anywhere action only after startup loading completes.
- Preserve language selection behavior while the splash is visible.
- Localize startup plugin loading strings across supported locales.
- Refresh the completed loading message when the UI language changes so it stays in sync.
@francescofugazzi

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback.

I addressed the earlier startup issues by keeping the splash layout compact and stable, fixing the language selector / locale strings, and making the startup plugin status update correctly during the load sequence.

I moved the startup plugin preload onto the main thread so it stays synchronized with the UI and the Python/RML startup state. That avoids the freeze/deadlock behavior we were seeing when a heavy plugin imported during startup, and it lets the splash keep showing live progress instead of stalling.

The main tradeoff is that the window remains blocked until startup loading completes. That is still the downside of this approach, but it is the safest way I found to keep startup deterministic and prevent the more severe startup hangs/crashes.

@francescofugazzi francescofugazzi marked this pull request as ready for review June 15, 2026 11:06
@francescofugazzi francescofugazzi requested a review from MrNeRF June 15, 2026 14:32
@MrNeRF

MrNeRF commented Jun 15, 2026

Copy link
Copy Markdown
Owner

I am afk this week. I will look into it when back. However, the rendering should load directly otherwise it has a big impact on my workflow.

@MrNeRF MrNeRF left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just blocking until I have reviewed it.

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.

3 participants