Skip to content

Conversation

k-dominik
Copy link
Contributor

@k-dominik k-dominik commented Oct 11, 2025

Expose RequestPool cancellation to ilastik - that way one can e.g. cancel live update.\

builds on top of #339
sister PR in ilastik: ilastik/ilastik#3082

* make volumina request tiles more lazy by first submitting to a queue
* tasks are submitted up to a limit to the lazyflow request pool
* mechanism for cancelling/removing unsubmitted requests from the queue
* As compared to before, ilastik will use way less memory (maybe half)

This enables way better interactive usage of ilastik as number of requests
that are submitted stays limited. Changing conditions (scrolling, dirtyness)
trigger cancellation of queued requests that are not relevant anymore.

Fixes ilastik#135
Fixes ilastik/ilastik#1735
Fixes ilastik/ilastik#1376, at least to a degree
* interface for tile submission slightly changed, getTiles takes second
  argument for viewport Rect
* test_lazy: not really a fix, but stricter testing that helped debug some
  issues with cancellation
time.time() is not guaranteed to be unique.
…azyflow, patch rendererpool, probably sequence of test now different so it used to work coincidentally
Copy link

codecov bot commented Oct 11, 2025

Codecov Report

❌ Patch coverage is 82.12291% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.92%. Comparing base (fe15d9e) to head (3bd1668).

Files with missing lines Patch % Lines
volumina/tiling/tileprovider.py 77.77% 8 Missing ⚠️
volumina/utility/prioritizedThreadPool.py 33.33% 8 Missing ⚠️
volumina/volumeEditorWidget.py 0.00% 8 Missing ⚠️
volumina/volumeEditor.py 37.50% 5 Missing ⚠️
volumina/imageScene2D.py 66.66% 2 Missing ⚠️
volumina/pixelpipeline/datasources/cachesource.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #340      +/-   ##
==========================================
+ Coverage   36.33%   36.92%   +0.59%     
==========================================
  Files         108      109       +1     
  Lines       11439    11577     +138     
==========================================
+ Hits         4156     4275     +119     
- Misses       7283     7302      +19     

☔ View full report in Codecov by Sentry.
📢 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.

from volumina.tiling.tileprovider import renderer_pool

renderer_pool.clear()
QApplication.processEvents()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

kind of hard to get consistent full viewport updates, but processEvents() seems to do the trick

k-dominik and others added 2 commits October 11, 2025 21:03
almost everything (except submit) was already operating under a lock, so the
locking overhead of PriorityQueue can be omitted.

Co-Authored-By: Emil Melnikov <[email protected]>
…azyflow, patch rendererpool, probably sequence of test now different so it used to work coincidentally
@k-dominik k-dominik mentioned this pull request Oct 15, 2025
2 tasks
def clearPendingRequestQueueAndReferesh(self):
from volumina.tiling.tileprovider import renderer_pool

renderer_pool.clear()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactor renderer_pool classes with common abc, as per @btbest's comment:

#339 (comment)

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