If you check camera parameter databases, you’ll see that sensor saturation levels don’t necessarily match the theoretical maximum (4095 for 12 bits, 16383 for 14 bits, 65535 for 16 bits).
RawTherapee camconst.json:
https://github.com/Beep6581/RawTherapee/blob/dev/rtengine/camconst.json
Look for ‘ranges’:
"ranges": {
// measured at ISO 100. ISO differences not measured, but known to exist
"white": [ 16300, 15700, 16300 ], // typical R 16383, G 15778, B 16383
"white_max": 16383
// aperture scaling not measured, but known to exist, at f/1.8 the G channels hits white_max
}
or for ‘levels’:
{ // Quality B
"make_model": "NIKON COOLPIX A",
"dcraw_matrix": [ 8198,-2239,-725,-4871,12388,2798,-1043,2050,7181 ], // DNG v13.2
"ranges": {
"white": [
{ "iso": [ 100, 125, 160, 200, 250, 320, 400, 500, 640, 800 ], "levels": [ 16300, 15700, 16300 ] }, // typical G1,G2 15760-15800 R,B 16383
{ "iso": [ 1000, 1250, 1600, 2000, 2500, 3200 ], "levels": 16300 }, // typical G1,G2, R,B 16383
{ "iso": [ 4000, 5000, 6400 ], "levels": 16200 }, // typical G1,G2, R,B 16383
{ "iso": [ 8000, 10000, 12800 ], "levels": 16000 }, // typical G1,G2,R,B 16383
{ "iso": [ 16000, 20000, 25600 ], "levels": 15700 } // typical G1,G2, R,B 16383
],
"white_max": 16383
}
},
white_max
is the theoretical maximum.
I don’t know where the same kind of data for darktable is stored.