Transparency from previous filters messed up

Adding or subtracting transparency is systematically failing, an I believe I found the general cause.
Many related issues:
Mask from file with GL-transitions bug
Chromakey inverted
Bug report with transparency
(my case: Windows 8.1, 64-Bit, Shotcut 21.02.27)

Example to reproduce: Use “Bar horizontal” in “Mask from file”, after “chroma key advanced” in the same clip.There are checkboxes “Invert” and “Reverse”.

  1. “Invert” should swap the sides by inverting the gradient. But instead, it inverts the transparency generated by the chroma key (or other transparencies generated by previous filters). (Workaround here: Make an inverted customer file)
  2. “reverse” should decide whether adding opacity or adding transparency to previous transparencies (generated transparencies from other filters in same clip or track). This fails because the tickbox does the same as “invert”, only with different bar position. But the functinon is necessary because sometimes we need to expand a chroma-screen, sometimes we need to restrict it to prevent un-wanted punching outside the screen (ie.g. screen behind a car window). No workaround (maybe by rendering in subsequent steps).
  3. Same problem with with ANY transparency-generating filters, like opacity, fade-in with transparency, blend mode (as filter), chroma key. There is no way to control the behaviour with previous transparencies.
  4. Reversing the sequence of filters has no influence. The later filter should override the earlier.

I guess that there is a general bug behind all: Filters seem to mix up the their own alpha output with the alpha previously defined by other filters.

Repairing this may be prevented for compatibility issues! After update, same project has to generate same outcome. SOLUTION: In the filter list, make a 4th tab “Old”. Put all defect filters (all with transparency) into this category and replace them with repaired versions, which ALL have identically:
a) Tickbox “Invert” (the own alpha)
b) Option: “with previous transparency: add opacity / add transparency”
(means: combine as max-value / as min-value).
c) within a track or clip, the later should generally over-rule the earlier
(means has its own alpha input and output for the chain).

Limitations and labels not matching what you expect are not bugs.

Basically a duplicate of your recent post

Please consider volunteering to code the addition of an alpha operations parameter into every filter that affects alpha channel.

Unfortunately, I’m not a programmer.
Would it not be a very easy thing for those who had programmed the existing ones?