Retail CD to scene FLAC
This is theoretically possible we think, but there are difficult problems to solve and automate to make this even feasible.
CD to WAV
The meta data of the .flac file is stored in the .srs files. The FLAC file contains the MD5 of the WAVE file used to create the FLAC together with the encoder.
[encoder] => libFLAC 1.2.1 20070917 [md5_data_source] => d217efde19c84c5805d0ecd529194d59
A problem is people ripping with or without the offset correction. Basically, every CD drive isn't aligned perfectly, so when a program asks for a certain sector to be read, it actually reads to the left or right of that sector. It ranges anywhere from just a few sectors, to hundreds. You can correct for it if you are aware of it. EAC has offset correction.
There is a big database with offset corrections for most drives:
There is a tool needed to extract the CD and tries to match the MD5. It checks the sectors for any sample shifts. If a scene release is just shifted 20 samples over, one could just recreate the offset and then get an md5 perfect copy of it.
WAV to FLAC
Once the proper WAV file is obtained, rerunning with the correct tool could yield the proper FLAC file. But like RAR, it seems some external factors such as the amount of threads could be involved.
Q: Why doesn't the same file compressed on different machines with the same options yield the same FLAC file?
A: It's not supposed to, and neither does it mean either encoding was bad. There are many variations between different machines or even different builds of flac on the same machine that can lead to small differences in the FLAC file, even if they have the exact same final size. This is normal.