[desc] Execute pre & post process in the farm#2984
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2984 +/- ##
===========================================
+ Coverage 81.99% 82.02% +0.03%
===========================================
Files 69 69
Lines 9315 9688 +373
===========================================
+ Hits 7638 7947 +309
- Misses 1677 1741 +64 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
098429a to
598b8d6
Compare
6593892 to
a65cd5b
Compare
a65cd5b to
1581af0
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces preprocessing and postprocessing capabilities to Meshroom's node execution system. These new stages allow nodes to perform setup work before chunk processing and cleanup/aggregation work after all chunks complete. The implementation treats pre/post-processing as special chunks with dedicated indices, integrates them into the task submission system, and updates the UI to display these stages.
Changes:
- Added
ChunkIndexenum to distinguish preprocess (-2), postprocess (-1), and standard chunks (0+) - Implemented task ordering system (
OrderedTasks,OrderedTask,OrderedNode) to schedule pre/post-processing relative to chunks - Updated UI (QML) to display preprocess/postprocess chunks in the chunks list view
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| meshroom/core/desc/node.py | Added add_method_flag decorator to detect overridden preprocess/postprocess methods |
| meshroom/core/node.py | Implemented ChunkIndex enum, created pre/post-process chunks, updated chunk processing logic |
| meshroom/core/submitter.py | Added OrderedTask/OrderedNode/OrderedTasks classes for task dependency ordering |
| meshroom/core/taskManager.py | Updated to pass forceCompute to pre/postprocess calls |
| meshroom/core/graph.py | Added debug print statements for graph execution (should be removed) |
| meshroom/ui/qml/Utils/Colors.qml | Added null check for chunk color handling |
| meshroom/ui/qml/GraphEditor/NodeLog.qml | Simplified chunk log file access |
| meshroom/ui/qml/GraphEditor/NodeEditor.qml | Changed to use allChunks property, increased width for "postprocess" text |
| meshroom/ui/qml/GraphEditor/ChunksListView.qml | Refactored to handle pre/postprocess chunks with ChunkIndex enum |
| bin/meshroom_compute | Added --preprocess and --postprocess flags, updated chunk iteration handling |
| bin/meshroom_createChunks | Moved preprocess/postprocess calls outside chunk loop |
| localfarm/localFarm.py | Improved logging format |
| localfarm/README.md | Added comprehensive documentation for local farm (contains typo: "famr") |
| tests/test_submit.py | Added test_orderTasks to verify task ordering logic |
| tests/test_compute.py | Updated to call pre/postprocess outside chunk loop, added duplicate prepareLogger call |
| tests/plugins/meshroom/pluginSubmitter/PluginSubmitter.py | Updated test plugins to demonstrate pre/postprocess usage |
Comments suppressed due to low confidence (4)
localfarm/README.md:8
- Spelling error: "famr" should be "farm"
> Note that the local famr only works in Unix for now because we use `fork` for daemonization.
meshroom/core/submitter.py:76
- The comment for EXPANDING is identical to PREPROCESS. It should describe that this task executes a node's expanding process (for nodes whose chunk count is not determined yet).
EXPANDING = auto()
"""Task that executes a node preprocess method"""
meshroom/core/submitter.py:78
- The comment for CHUNK is misleading. Based on the code context, CHUNK represents a task that executes a single chunk of a parallelized node, not a task that will expand. The "expanding" behavior is handled by the EXPANDING task type.
CHUNK = auto()
"""Task that will expand during the processing"""
meshroom/core/submitter.py:184
- Spelling error in documentation: "orger" should be "order"
Take all the nodes and connections and orger them by processing step
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
servantftransperfect
left a comment
There was a problem hiding this comment.
Can't you use simple introspection ?
is_overridden = type(self).preprocess is not Node.preprocess
not sure of the grammar
ec321ae to
9dddaa9
Compare
PR description
We introduce a new feature that enables preprocessing and postprocessing tasks.
In this new version, these tasks are considered as new chunks and can be implemented on custom nodes.
On the scheduling/submitter part, preprocessing are executed before all chunks, and postprocessing are executed after them.
This way these can be used to prepare data for processing in chunks (preprocessing), and then concatenate data from all chunks (postprocessing).
Adding preprocessing/postprocessing tasks
It's very simple and follows what we already use with
process/processChunkImpact on the UI
If there no preprocess/postprocess the chunks will not be displayed on the UI.
Implementation notes
add_method_flagdecorator to be able to check whether a method is overloaded or not.preprocessandpostprocessmethods are flagged with it, and we know if we have a pre/postprocess using this systemNote to the reviewers
Merging