Thanks all for the suggestions. I’ve experimented a lot and still haven’t cracked the code, but am learning many things that don’t work.
I don’t have the answer, but to guess, it is what I expect. You go from Input Profile (camera matrix) > Working Profile (user selected) > Application Color Space [when lut module is turned on] > Working Space > Output Profile (user selected). In other words, the application color space handles the transform from input > lut > output. Now it is my understanding that ‘application color space’ should match embedded profile of the LUT. png, AND/OR the assigned profile of original blank haldclut, but the below experiments don’t necessarily prove that, unless I’ve got it wrong somehow.
The image viewer is colour managed properly and is not applying any transformation back to sRGB. It displays what’s embedded. The only transformation would be to my display, which is equivalent to sRGB, but that is also true of image editors like darktable.
Experiment 1
As per original post, when ‘application color space’ is set to match embedded profile of png, and lut 3d module is placed after filmic, between input and output profile, all three look different. The one that looks most right according to expectations is the srgb lut, used with ‘application color space’ set to srgb. This is to be expected, given this lut was made from an srgb image.
Experiment 2
When ‘application color space’ is set to working profile (linear rec 2020, in this instance), and lut 3d module is placed after filmic, between input and output profile, all three look different, and wrong.
Experiment 3
Logically, this is also how I anticipate it working, but testing, when lut 3d module is moved after output profile in pipeline, the ‘application color space’ dropdown disappears. When I keep LUT the same (eg. srgb), and change output profile (eg. from srgb, to argb, to linear rec 2020), the resulting image is always the same, and wrong. When I keep output profile the same (eg. srgb) and change LUT (eg. from srgb, to argb, to linear rec 2020) the resulting image always looks different, and wrong.
However, this experiment comes with a quirk, probably a bug. If I have lut 3d placed before output color profile, application color space set to srgb, then move module after output profile, I get result X. However if I have lut 3d placed before output color profile, application space set to linear rec 2020, then move module after output profile, I get result Y. Given result X <> Y, the application space must still be taking effect despite disappearing from GUI, and I do not understand how it comes to that effect, for it does not match the results of experiment 1.
Experiment 4
I assign the blank haldclut three different spaces: srgb, argb, linear rec 2020. I apply the same preset to all three and save, with those spaces embedded. Now viewed in image viewer, each haldclut looks different.
I put lut 3d before output in darktable, open each of these three png luts with ‘application color space’ set to srgb, and they all look the same, and as expected. Hooray! But wait… this is all with ‘application color space’ set to srgb. This doesn’t seem right. Shouldn’t my srgb lut work with srgb application, argb with argb, l rec 2020 with l rec 2020, etc… ?
To test in another program, I create a synthetic gradient image and assign it three different colour spaces, then apply my luts to them. Problem is, each lut gives the same result on the same gradient, instead of different results on the same gradient, and same results on different gradient. What I mean is, the srgb lut on the srgb gradient should look the same as the argb lut on the argb gradient, and the l rec 2020 lut on the l rec 2020 gradient, etc… But that isn’t what happens.
The DT manual on ‘application color space’ doesn’t give a lot of clues. It says, “Choose the color space for which the selected 3D LUT file has been built.” But as stated, with application color space set to srgb, all of these luts now look the same despite being assigned and embedded three different profiles. So I still don’t understand.