Depsgraph: Modernization #121019

Open
opened 2024-04-24 12:35:58 +02:00 by Sergey Sharybin · 0 comments

This task is aimed to be a parent task for the dependency graph upgrades for an upgraded requirements. The goal is to convert the current system to a better state, without involving another big rewrite, as it is not very practical.

In this task it is more a compilation of aspects which needs to be addressed, with a brief description. Those could be split into separate "sub-tasks" in order to allow more detailed design and discussions.

API

  • Use deg::Depsgraph everywhere, avoiding the reinterpert cast from/to opaque pointer. The deg::Depsgraph definition could still stay private to the despgraph module.
  • Support tagging specific RNA properties, by their PointerRNA. Goal: allow tagging individual custom properties, and limit updates to things which are connected to it.
  • Allow sub-classing AbstractBuilderPipeline outside of the DEG module.
  • More "batched" iteration of instances, providing array of transforms more directly, avoiding creation of temporary in-memory objects.

Builder

  • Merge Nodes and Relations builder
  • Cleanup of the collections builder, with more clear separation between collections referenced by objects, and collections coming from the layer collections.
  • Move ID builders to ID_Type.
  • Solve implicit decisions in the RNANodeQuery::construct_node_identifier. Possibly make it so RNA gives require information in a generic manner (which will be needed to support tagging RNA properties).
  • Revisit the visiiblity optimization. It works, but with limitations, and implementation feels a bit ad-hocky. Feels like it could become more prominent core feature, with clarity of what each visibility means at every step of the depsgraph timelife.

Debugging

Technical artists should access to performance and relation debugging as a core functionality. Currently it is done via gnuplot for timing and graphviz for relations. The graphviz is especially bad, as it only handles very small graphs.

  • Make performance debugging a core feature in Blender, displayed in the Space Info
  • Similarly, make make it possible to debug and visualize dependencies (OppsWindow)

Optimizations

  • Avoid unnecessary re-evaluations when a single custom property is changed (see the RNA property tagging).
  • Allow weak pointers to IDs in custom properties, avoiding all the IDs referenced by custom properties becoming a part of the depsgraph.
  • Revisit the situation about unwanted evaluations (like, via disabled modifiers/constraints). A lot of work was done, but is unclear if all use-cases were covered. Need to go over reports, like #99572, #89599, #73199, #111021.
  • Tighter integration with geometry nodes, especially the Switch node. Goal: avoid evaluation of geometry which is referenced by the geometry node tree, but is not needed for its actual evaluation.
This task is aimed to be a parent task for the dependency graph upgrades for an upgraded requirements. The goal is to convert the current system to a better state, without involving another big rewrite, as it is not very practical. In this task it is more a compilation of aspects which needs to be addressed, with a brief description. Those could be split into separate "sub-tasks" in order to allow more detailed design and discussions. **API** * Use `deg::Depsgraph` everywhere, avoiding the reinterpert cast from/to opaque pointer. The `deg::Depsgraph` definition could still stay private to the despgraph module. * Support tagging specific RNA properties, by their `PointerRNA`. Goal: allow tagging individual custom properties, and limit updates to things which are connected to it. * Allow sub-classing `AbstractBuilderPipeline` outside of the DEG module. * More "batched" iteration of instances, providing array of transforms more directly, avoiding creation of temporary in-memory objects. **Builder** * Merge Nodes and Relations builder * Cleanup of the collections builder, with more clear separation between collections referenced by objects, and collections coming from the layer collections. * Move ID builders to `ID_Type`. * Solve implicit decisions in the `RNANodeQuery::construct_node_identifier`. Possibly make it so RNA gives require information in a generic manner (which will be needed to support tagging RNA properties). * Revisit the visiiblity optimization. It works, but with limitations, and implementation feels a bit ad-hocky. Feels like it could become more prominent core feature, with clarity of what each visibility means at every step of the depsgraph timelife. **Debugging** Technical artists should access to performance and relation debugging as a core functionality. Currently it is done via gnuplot for timing and graphviz for relations. The graphviz is especially bad, as it only handles very small graphs. * Make performance debugging a core feature in Blender, displayed in the Space Info * Similarly, make make it possible to debug and visualize dependencies ([OppsWindow](https://docs.blender.org/api/htmlII/x3447.html)) **Optimizations** * Avoid unnecessary re-evaluations when a single custom property is changed (see the RNA property tagging). * Allow weak pointers to IDs in custom properties, avoiding all the IDs referenced by custom properties becoming a part of the depsgraph. * Revisit the situation about unwanted evaluations (like, via disabled modifiers/constraints). A lot of work was done, but is unclear if all use-cases were covered. Need to go over reports, like #99572, #89599, #73199, #111021. * Tighter integration with geometry nodes, especially the Switch node. Goal: avoid evaluation of geometry which is referenced by the geometry node tree, but is not needed for its actual evaluation.
Sergey Sharybin added the
Type
To Do
Module
Core
Interest
Dependency Graph
labels 2024-04-24 12:36:11 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#121019
No description provided.