-
Notifications
You must be signed in to change notification settings - Fork 649
[FEATURE] Fastplotlib component cleanup #558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@BloggerBust you have the most context on this. |
I see the script re-running because of state changes in fastplotlib plots. Notice that I'm on run '24,' and it doesn't stop! I haven't looked into the latest changes but do you happen to know what might be causing this? @BloggerBust @shivam-singhal ![]() |
not immediately sure, but will take a look |
I would also suggest keeping the examples self-contained. For instance, I had created Maybe we can segregate them into |
Thanks for flagging this! I added logging to the Despite that, the script is still rerunning endlessly, which suggests that I'm currently tied up with another project but will make an effort to investigate this today or tomorrow and I will keep you posted. |
I created a new issue to track the root cause of the infinite rerun behavior here: #565 I created a fix in PR #566, which ensures that component state updates are only processed if the values have actually changed. This prevents unnecessary reruns and resolves the infinite loop observed with Fastplotlib. Feel free to chime in if you spot anything else! |
Hey @shivam-singhal Those objc[...] logs you're seeing — like this:
indicate that two different versions of the GLFW shared library (libglfw) are being loaded at the same time. I would expect this to happen when both glfw and imgui_bundle packages are installed and both include their own GLFW binaries. It's not a crash, but it is undefined behavior and can lead to flaky rendering issues. I am unable to reproduce this since I am running on a Linux distro and those are objective-c errors ( mac specific ). I’d like you to test this with a clean environment and with the latest fix from both PR #599 and PR #566, so that your test is isolated from any unrelated frontend or websocket bugs. Steps to Reproduce in Clean State
This will give you the latest React/WebSocket fix and the script rerun prevention logic from #566 in one branch.
Then check whether you're still seeing any objc[...] logs in the terminal.
Look for any duplicate libglfw.dylib entries and paste the output here so we can help resolve the root cause. Thanks for testing this! This will help us confirm whether the duplicate GLFW issue is still happening after the recent fixes. |
Hey @shivam-singhal, That is a great question! I’ve created a new issue to address this exact concern and replace the current workaround with a more robust solution: [FEATURE] Introduce ContextVar-based session metadata access (e.g., client_id) (#587) The idea is to use a ContextVar during script execution so components can access session-level metadata (like I also noted an alternative approach: implementing a full backend session service to manage per-client metadata. If you think that would be worth the investment at this stage, either for broader use cases or to future-proof things, I'm happy to pursue that route instead. |
This is weird, imgui doesn't need glfw, we use wgpu to render it to any canvas. Might be worth posting an issue on the imgui-bundle repo. |
Uh oh!
There was an error while loading. Please reload this page.
We have support for fastplotlib locally (not via browser yet).
Let's clean up the fastplotlib component so it doesn't cause preswald cli to display
every time it's run
Additionally, to use the fastplotlib component, it seems you need to pass in the preswald service client id. Is there a way to avoid this dependency?
The text was updated successfully, but these errors were encountered: