Lossless 8-bit WEBP export is not actually lossless: output image data differs from 8-bit PNG and from 8-bit TIFF
I tested exporting into PNG, TIFF, WEBP, all with 8-bit & lossless. Settings as depicted on the 3 respective screenshots.
Sample shot taken from https://redmine.darktable.org/issues/12060 (https://redmine.darktable.org/attachments/download/3783/DSC00501.ARW.xz)
I attached XMP file here, it is the simplest (default settings + disabled sharpening and orientation, so only the essential modules are active + base curve)
I checked the hashes of the image data (that is, a hash of decoded pixel data and nothing else) with Imagemagick (identify -verbose) and found that PNG and TIFF results are the same just as expected but WEBP result is different.
$ identify -verbose DSC00501.png 2>/dev/null | grep signature signature: b1d84729fece09d57247ccfd9e7387b8287a1f663c3b1e49999efe7af4ade4e0 $ identify -verbose DSC00501.tif 2>/dev/null | grep signature signature: b1d84729fece09d57247ccfd9e7387b8287a1f663c3b1e49999efe7af4ade4e0 $ identify -verbose DSC00501.webp 2>/dev/null | grep signature signature: fe39b5bbf824bab14bcab5a509214ef453e7233f92f48e9e1e5e3e476fb41fca
It is also possible to observe the difference visually, here WEBP image has more blurry body of the guitar but sharper cyclic lines at the right edge of the body of the guitar.
I also tried to encode the PNG result into WEBP manually using cwebp 0.6.1, and it works losslessly, unlike darktable's WEBP encoder.