Geometry: add utility to check for bad geometry element index dependence #113030

Merged
Jacques Lucke merged 21 commits from JacquesLucke/blender:index-dependence-check into blender-v4.0-release 2023-09-29 21:44:45 +02:00
Member

Sometimes .blend files have compatibility issues between Blender versions, because .blend files depended on the specific order of geometry elements generated by some nodes/modifiers (#112746, #113018). While we make guarantees about the order in some places, that is relatively rare, because it makes future improvements much harder. The functionality in this patch makes it easier for users to notice when they depend on things that are not expected to be stable between Blender builds.

This is achieved by adding a new global flag which indicates whether some algorithms should randomize their output. The functionality can be toggled on or off by searching for Set Geometry Randomization. If there are no differences (or acceptable minor ones) when the flag is on or off, one can be reasonably sure that one does not on unspecified behavior (can't be 100% sure though, because randomization might be missing in some places). If there are big differences, one should consider fixing the file before it comes to an actual breakage in the next Blender version.

Currently, the setting is only available when Developer Extras is turned on, because the setting is in no menu.

With this patch, if we get bug reports with compatibility issues caused by depending on indices, one of the following three cases should always apply:

  • We actually accidentally broke something, which requires a fix commit.
  • Turning on geometry randomization shows that the .blend file depends on things it shouldn't depend on. In this case the user has to fix the file.
  • We are missing geometry randomization somewhere, which requires a fix commit.

image

Sometimes .blend files have compatibility issues between Blender versions, because .blend files depended on the specific order of geometry elements generated by some nodes/modifiers (#112746, #113018). While we make guarantees about the order in some places, that is relatively rare, because it makes future improvements much harder. The functionality in this patch makes it easier for users to notice when they depend on things that are not expected to be stable between Blender builds. This is achieved by adding a new global flag which indicates whether some algorithms should randomize their output. The functionality can be toggled on or off by searching for `Set Geometry Randomization`. If there are no differences (or acceptable minor ones) when the flag is on or off, one can be reasonably sure that one does not on unspecified behavior (can't be 100% sure though, because randomization might be missing in some places). If there are big differences, one should consider fixing the file before it comes to an actual breakage in the next Blender version. Currently, the setting is only available when `Developer Extras` is turned on, because the setting is in no menu. With this patch, if we get bug reports with compatibility issues caused by depending on indices, one of the following three cases should always apply: * We actually accidentally broke something, which requires a fix commit. * Turning on geometry randomization shows that the .blend file depends on things it shouldn't depend on. In this case the user has to fix the file. * We are missing geometry randomization somewhere, which requires a fix commit. ![image](/attachments/d8f48aa5-39ca-4286-96fa-6f5905ba9a3f)
Jacques Lucke added 9 commits 2023-09-28 20:28:36 +02:00
Jacques Lucke added 1 commit 2023-09-28 21:14:17 +02:00
Jacques Lucke added 4 commits 2023-09-28 22:43:35 +02:00
Jacques Lucke added 1 commit 2023-09-28 22:47:58 +02:00
Jacques Lucke added 2 commits 2023-09-28 23:13:27 +02:00
Jacques Lucke requested review from Hans Goudey 2023-09-28 23:13:43 +02:00
Jacques Lucke added 1 commit 2023-09-28 23:14:55 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
1322ce0257
cleanup
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey approved these changes 2023-09-29 17:33:16 +02:00
Hans Goudey left a comment
Member

It would be nice to put this in a menu, but I'm not sure where, so I think it's okay for now.

It would be nice to put this in a menu, but I'm not sure where, so I think it's okay for now.
@ -0,0 +52,4 @@
"Value",
"Randomize the order of geometry elements (e.g. vertices or edges) after some "
"operations where there are no guarantees about the order. This avoids "
"accidentally depending on something that is likely to change in the future");
Member

is likely to -> may?

`is likely to` -> `may`?
JacquesLucke marked this conversation as resolved
@ -0,0 +12,4 @@
namespace blender::geometry {
bool use_debug_randomization();
Member

I guess this is mostly an aesthetic thing, but I'd like to see see these functions have a debug_ prefix, and do the use_debug_randomization themselves. That way the calling code can be nicer without the if statements.

I guess this is mostly an aesthetic thing, but I'd like to see see these functions have a `debug_` prefix, and do the `use_debug_randomization` themselves. That way the calling code can be nicer without the if statements.
JacquesLucke marked this conversation as resolved
Jacques Lucke added 3 commits 2023-09-29 21:40:46 +02:00
Jacques Lucke merged commit cc7da09c1b into blender-v4.0-release 2023-09-29 21:44:45 +02:00
Jacques Lucke deleted branch index-dependence-check 2023-09-29 21:44:46 +02:00

The Developers Extra > Experimental menu has some "permanent" options in the Debugging Panel. Maybe expose this there?

The Developers Extra > Experimental menu has some "permanent" options in the Debugging Panel. Maybe expose this there?
Author
Member

Doesn't sound too bad. The main difference to the other options is that this is not stored in the user preferences. That's because we don't really want people to have it enabled all the time, since it makes things slower.

Doesn't sound too bad. The main difference to the other options is that this is not stored in the user preferences. That's because we don't really want people to have it enabled all the time, since it makes things slower.
Sign in to join this conversation.
No reviewers
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
3 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#113030
No description provided.