Edit 2: Some people are facing battery drain due Google play services (9.x.xxx) which is not anyway related to this bug present in rom. Still here is work around for you
Unfortunately I still get the Wifi bug and I am on the July patch. I remember it disappeared in the May patch but reappeared in the June patch. The way I solve it is just to restart the device every day.
But I do think it may have something to do with Play Services as I do see that often as the app consuming a lot of battery
Work around for it is to disable 4 receivors indicated in below post.
PS: u can use free tool, "My android tools" from playstore.
& disable these 4 things under "RECIEVER" tab from play services
PS: some people claims that it was related to Google Connectivity Service ,but i had it disabled all the time in 6.0 & still drain was gone for me. So i believe it's not actually related to it, after all Google connectivity services is only needed for "Project Fi" (available only in USA) other ppl can simply disable it
Edit: reported to Google (with new screen shots )...here->
If you are also seeing this bug kindly report it in about link and star that issue as well
Well after using phone for entire 3 charging cycles with different settings I think main problem for this is "WiFi always scan" in location setting..many users reported how to turn it off in comments (thanks )
If you still facing this problem...
Go to Settings>Location>Scanning(top right)>Wifi Scanning ( disable it ) & Bluetooth Scanning (disable it as well)
if bug appers after few days, 1st check your "WiFi scanning" in Location again (turn it off if it's on ) it starts automatically after using navigation (randomly) !
In most cases this will solve the problem..but if you are still seeing much battery drain
Then change your Location Setting to Device only ( or you can entirely disable it if you don't relay on Location base Google Now cards )
If all of above fails Wiping Cache In Stock Recovery or Changing WiFi band in WiFi advance setting, also helps in some extreme cases ( as reported by some users )
here is video by @isrmicha for the same steps if you can't figure-out from pics,
(I think Google disabled instant scanning for wifi on QS toggle..so it takes some time for scanning available networks after Turing on wifi)
Click below to see what's the problem with scanning ON, if you are still not aware of it
1st of all i'm fully stock...and i'm very impressed with battery life on 6.0...personally I never got SOT for than 4 hrs on Lollipop but on M it's been almost 4 and half hr and still 23% remaining so overall battery life is much improved for me and DOZE is doing it's work excellently (without any interference )
But the problem is as per stats WiFi is biggest battery drainer for me it shows about 53% use and Power used by it is also too much...i have never seen this much uses of WiFi ! It's more than Drain by Screen On
So is this some kind of bug or just different calculation method ? Seeing overall improved battery life I'm confused to call it bug