If you export with ‘optical corrections’ only from DxO, with the legacy gamut selected, they align up pretty well again.
If you use the ‘all corrections’ mode, the highlight-recovery system in DxO kicks in to (attempt to) repair the sensor-clipped highlights, which can affect the histogram pretty drastically. If you crop the top half away for example, they are much closer (although I have a sort of black-level difference somewhere… but the ‘shape of the histogram’ as you said, is pretty much the same).
2014-05-30_19-47-01_raw_legacy_1.dng_test.tif (8.5 MB)
from_raw.tif (8.5 MB)
Again, this is purely academic. It’s proof that a linear DNG does contain the ‘same colorspace’, the same sort of data as the original RAW. And that demosaicing does not (have to) mean ‘bring it into another colorspace’ or ‘do stuff with camera profiles’.
Of course, if you start to add algorithms the recover parts, refill parts, change color, apply different profiles, etc… it can all change.
You did get me experimenting again.
And look at this, this is the green channel of the DNG files created by DxO. One in ‘all corrections’ legacy mode, one in ‘all corrections’ wide-gamut mode.
It appears there is not so much difference at all… except in the highlights… which are ‘repaired’ in the legacy version, but remain clipped in the wide-gamut version?
legacy_green.tif (8.5 MB)
wide_green.tif (8.5 MB)
Maybe there is no real export difference, except in clipped highlights? In wide-gamut mode, the highlights-repair doesn’t kick in, because it thinks it has more than enough room left?
This would indicate that ‘the bug’ is maybe not in the DNG export itself, but in the highlight-repair in wide-gamut mode.