Despgraph: Rename "copy-on-write" to "copy-on-evaluation" #118338

Merged
Hans Goudey merged 8 commits from HooglyBoogly/blender:depsgraph-cow-rename into main 2024-02-19 15:54:18 +01:00
Member

The depsgraph CoW mechanism is a bit of a misnomer. It creates an
evaluated copy for data-blocks regardless of whether the copy will
actually be written to. The point is to have physical separation between
original and evaluated data. This is in contrast to the commonly used
performance improvement of keeping a user count and copying data
implicitly when it needs to be changed. In Blender code we call this
"implicit sharing" instead. Importantly, the dependency graph has no
idea about the actual CoW behavior in Blender.

Renaming this functionality in the despgraph removes some of the
confusion that comes up when talking about this, and will hopefully
make the depsgraph less confusing to understand initially too. Wording
like "the evaluated copy" (as opposed to the original data-block) has
also become common anyway.

The depsgraph CoW mechanism is a bit of a misnomer. It creates an evaluated copy for data-blocks regardless of whether the copy will actually be written to. The point is to have physical separation between original and evaluated data. This is in contrast to the commonly used performance improvement of keeping a user count and copying data implicitly when it needs to be changed. In Blender code we call this "implicit sharing" instead. Importantly, the dependency graph has no idea about the _actual_ CoW behavior in Blender. Renaming this functionality in the despgraph removes some of the confusion that comes up when talking about this, and will hopefully make the depsgraph less confusing to understand initially too. Wording like "the evaluated copy" (as opposed to the original data-block) has also become common anyway.
Hans Goudey added 1 commit 2024-02-15 17:22:41 +01:00
The depsgraph CoW mechanism is a bit of a misnomer. It creates an
evaluated copy for data-blocks regardless of whether the copy will
actually be written to. The point is to have physical separation between
original and evaluated data. This is in contrast to the commonly used
performance improvement of keeping a user count and copying data
implicitly when it needs to be changed. In Blender code we call this
"implicit sharing" instead. Importantly, the dependency graph has no
idea about the _actual_ CoW behavior in Blender.

Renaming this functionality in the despgraph removes some of the
confusion that comes up when talking about this, and will hopefully
make the depsgraph less confusing to understand initially too. Wording
like "the evaluated copy" (as opposed to the original data-block) has
also become common anyway.

---

There is one place where the naming got worse, that is the
`LIB_TAG_COPIED_ON_EVAL_EVAL_RESULT` enum value. Maybe someone can
think of a better name for that.
Hans Goudey added this to the Core project 2024-02-15 17:23:14 +01:00
Hans Goudey requested review from Sergey Sharybin 2024-02-15 17:23:23 +01:00
Hans Goudey requested review from Jacques Lucke 2024-02-15 17:23:24 +01:00

The naming is indeed better represents the nowadays design. The one thing where I think we can do better name is the ID_RECALC_EVALUATED_COPY .

What about something like ID_RECALC_SYNC_TO_EVAL ?

The naming is indeed better represents the nowadays design. The one thing where I think we can do better name is the `ID_RECALC_EVALUATED_COPY `. What about something like `ID_RECALC_SYNC_TO_EVAL` ?
Author
Member

What about something like ID_RECALC_SYNC_TO_EVAL ?

What about ID_SYNC_TO_EVAL_COPY? To me the "copy" word is helpful to explain there's a different data-block that's copied from the original.

> What about something like `ID_RECALC_SYNC_TO_EVAL` ? What about `ID_SYNC_TO_EVAL_COPY`? To me the "copy" word is helpful to explain there's a different data-block that's copied from the original.

I would keep the ID_RECALC_ prefix. It would be weird to have it for some recalculations, but bot for this one. So, ID_RECALC_SYNC_TO_EVAL_COPY :)

I would keep the `ID_RECALC_` prefix. It would be weird to have it for some recalculations, but bot for this one. So, `ID_RECALC_SYNC_TO_EVAL_COPY ` :)
Hans Goudey added 2 commits 2024-02-16 19:00:30 +01:00
Hans Goudey added 1 commit 2024-02-16 19:00:36 +01:00
Rename LIB_TAG_COPIED_ON_EVAL_EVAL_RESULT to LIB_TAG_COPIED_ON_EVAL_FINAL_RESULT
Some checks reported errors
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
ca4d343d20
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey added 2 commits 2024-02-16 19:03:43 +01:00
Improve comment
Some checks failed
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
f0e4049117
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey added 2 commits 2024-02-19 14:32:55 +01:00
Fix build error
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
8102dbaca8
Author
Member

@blender-bot build

@blender-bot build
Sergey Sharybin approved these changes 2024-02-19 15:33:44 +01:00
Sergey Sharybin left a comment
Owner

Mainly checked naming. Looks good!

Mainly checked naming. Looks good!
Hans Goudey merged commit 81a63153d0 into main 2024-02-19 15:54:18 +01:00
Hans Goudey deleted branch depsgraph-cow-rename 2024-02-19 15:54:20 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
Asset Browser Project
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
2 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#118338
No description provided.