Skip to content

Finish VisPy volume rendering and native teardown - #98

Merged
gselzer merged 9 commits into
pyapp-kit:mainfrom
kephale:fix/volume-clip-padding
Nov 18, 2026
Merged

gselzer merged 9 commits into
pyapp-kit:mainfrom
kephale:fix/volume-clip-padding

Conversation

@kephale

@kephale kephale commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #97.

This completes the SceneX VisPy path needed by Lodstone hosts:

  • keep orthographic volume bounds inside the near/far clipping planes with a 10% backend-neutral depth margin
  • apply aspect/letterbox zoom only in-plane, rather than scaling clip depth
  • add projection coverage and a real nonblank VisPy volume render regression
  • make canvas close idempotent, uninstall its GUI event filter, detach retained ViewBoxes, and release the canvas adaptor
  • add an explicit adaptor-registry cleanup path so tests and embedding hosts can release native scene objects while Qt/OpenGL is still alive
  • close every canvas created during tests, including canvases instantiated directly rather than through scenex.show()

The teardown changes eliminate the Linux exit-139 and macOS exit-138 crashes that occurred after all tests had passed.

Validation:

  • full GitHub matrix is green across Linux, macOS, and Windows; VisPy and pygfx; Qt, wx, and Jupyter; Python 3.10 through 3.14
  • formerly failing Ubuntu Python 3.10 VisPy/PyQt6 job: 171 passed, 43 skipped, normal process exit
  • local forced VisPy/Qt suite: 171 passed, 23 skipped, 3 environment-specific deselections
  • pre-commit: Ruff, mypy, Pyright, typos, and metadata hooks pass

@codecov

codecov Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.86%. Comparing base (a161fac) to head (9dd4892).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   88.10%   88.86%   +0.75%     
==========================================
  Files          64       64              
  Lines        3305     3349      +44     
==========================================
+ Hits         2912     2976      +64     
+ Misses        393      373      -20     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kephale kephale changed the title Fix blank VisPy volumes from exact depth clipping Finish VisPy volume rendering and native teardown Aug 31, 2026
@gselzer

gselzer commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

@kephale thanks for the PR! Sorry I didn't respond sooner!

The teardown changes eliminate the Linux exit-139 and macOS exit-138 crashes that occurred after all tests had passed.

Thank you very much for doing this - these were a constant annoyance, but the activation energy was just a little too high for me to debug on a non-Windows system 😅

Unsure if you're still working on this - let me know if/when you'd like any review!

@kephale

kephale commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

@gselzer yeah i think this one is ready for review!

@gselzer gselzer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks so much @kephale!

Few things I'd like to clean up before merge

Comment thread src/scenex/adaptors/_vispy/_canvas.py Resolved
Comment thread src/scenex/adaptors/_vispy/_canvas.py Resolved
Comment thread src/scenex/adaptors/_vispy/_canvas.py Resolved
Comment thread src/scenex/utils/projections.py Resolved
Comment thread src/scenex/adaptors/_registry.py Resolved
Comment thread src/scenex/adaptors/_registry.py Resolved
Comment thread tests/adaptors/_vispy/test_canvas.py Resolved
Comment thread tests/adaptors/_vispy/test_canvas.py Resolved
Comment thread tests/adaptors/_vispy/test_volume.py Resolved
@kephale

kephale commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Awesome, thank you @gselzer! I'm hoping to work through this early in the week

@tlambert03

Copy link
Copy Markdown
Member

thank you so much @kephale! Great to see you here... and would love to catch up soon. i'm interested in learning about lodstone, and looking into whether we could use/depend on it in ndv

@kephale

kephale commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@gselzer this one could be worth checking in on when you get a chance!

@gselzer
gselzer force-pushed the fix/volume-clip-padding branch from 55c7587 to 66c4893 Compare November 18, 2026 15:26
is_closed was removed in the recently released rendercanvas v3.0, and
get_closed has been available since v2.5.1 (our lower bound)

@gselzer gselzer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Love it, thanks again @kephale!

@gselzer
gselzer merged commit 12a1e02 into pyapp-kit:main Nov 18, 2026
76 of 78 checks passed
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.

VisPy volume render is blank with zoom_to_fit

3 participants