You've already explained that clipping in raw data was difficult to detect (has different forms), and that clipping values may even depend on the color channel.
Imagine a theoretical picture, with, after pre_mul or cam_mul applied, has:
red clipping to 60000.
green clipping to 40000 (I consider g and g2 to have the same behavior).
blue not clipping, climbing up to 50000.
How does dcraw_process() -no_auto_bright=1- stretch this result to 65535?
I guess it can't stretch each channel independently, since this would mess the white balance.
Does it stretch 40000 to 65535, applying a multiplicator of 53535/40000 to each channel, and so adding some artificial clipping to red and blue?
Or does it stretch 60000 to 65535, applying a multiplicator of 65535/60000 to each channel?
In that case, there is no artificial clipping, and no data lost, but the information that green is clipping does not appear clearly to the library user...
Last hypothesis, it applies the 65535/60000 multiplicator to each channel, except for the blue values of 40000 which are artificially put to 65535?
Or anything I've not thought of?