Bug #11768

When creating a style, multiple instances of a module should follow order of creation, not the history stack

Added by Huy Hoang over 1 year ago. Updated over 1 year ago.

Target version:
Start date:
Due date:
% Done:


Affected Version:
git master branch
hardware architecture:


I had this problem with multiple instances of Profiled Denoise.

In darkroom, the order of process is always the order where the instances are created. When I create a new instance of a module, the new instance is executed after the existing instances (at least in darkroom and on export).

However, when creating a style that includes those instances, the order of instances follow the order of the history stack, then executed from top to bottom when the style is applied on export.

It works correctly when applying the style to an image in lighttable (darkroom shows the correct order in history stack, and the instances have appended numbers in the same order).

As a work-around, before creating a style, I just have to turn off then on the instances in reverse order so that they appear on the history stack in the correct order from top to bottom.

Took me 3 hours to pin point the problem, using only "-d perf" and identifying the instances based only on their different execution times. Fun!

I guess the order of creation is the fixed reference (since each instance is appended with a number in that order in the darkroom's module list). If so, when creating the style, we just need to follow that creation order instead of the order in the history stack.

I troubleshooted this problem on a freshly compiled version against master branch as of 10/14 (version 2.3.0+982~g487a471)

Associated revisions

Revision 83c90012
Added by Tobias Ellinghaus over 1 year ago

Fix MI in styles applied during export

There are still some issues wrt. styles and mi left, and I hope I didn't
break anything here.

Fixes #11768

Revision 5b2cbc4c
Added by Tobias Ellinghaus over 1 year ago

Update style lists when importing a style

This is part of bug #11768,


#1 Updated by Tobias Ellinghaus over 1 year ago

  • Category deleted (Lighttable)
  • System changed from Ubuntu to all
  • % Done changed from 0 to 20
  • Target version set to 2.4.0
  • Status changed from New to Triaged

#2 Updated by Tobias Ellinghaus over 1 year ago

I had a first look at the code and it seems that styles are not really supporting multiple instances of modules. There are some cases where it happens to work by accident, but in general we have to fix quite a few places to make it work as expected. Not sure if we will get that done in time for 2.4.0.

#3 Updated by Tobias Ellinghaus over 1 year ago

  • % Done changed from 20 to 100
  • Status changed from Triaged to Fixed

#4 Updated by Huy Hoang over 1 year ago

Thanks, Tobias, for the speedy fix. Love your comment "dt_dev_module_duplicate() doesn't work here, it's trying too hard to be clever" :-)

Recompiled from master, tested creating and applying a style with 3 instances of Profiled Denoise:
- correct order of the instances on history stack
- reverse order of the instances on history stack
- random order (2,1,3) of the instances on history stack
- with one instance turn off
- export the style then import back

All worked correctly.

Found one minor bug: when importing a style in, it appears on the style list right away, but the export module doesn't refresh to show it, had to click "edit" the style and save. Perhaps will submit as a new ticket.

Also available in: Atom PDF