I have an Early 2013 model MacBook Pro running the latest version of Yosemite. I have been using it heavily for the last three and a half years. During this time, it has had infrequent but random crashes where the system froze, requiring a hard reboot. Since the last six months, I have been noticing noise-like lines appearing on the display from time to time, which go away after a short while. I suspected some hardware inside was failing.
Two weeks ago I enabled FileVault on the disk. The process took one and a half day. Last week, the system froze while I was working. After a few minutes, the screen went black completely. Pressing the power button did nothing apart from making the sleep LED blink several times. After several attempts in vain to boot the system, I attempted to clear NVRAM, which somehow worked. Once logged into the system, I checked logs but couldn't find anything helpful. I ran a combination of verify and repair permissions, and verify and repair disk operations, which ran successfully. I resumed my day to day work. I disabled FileVault, and performed an encrypted Time Machine backup.
Two days later, when the disk was decrypted and the backup was ready, I finally rebooted the system. It has not come back since. It gets stuck on the screen with the Apple icon and the loader, the brightness of the screen dimming and then going up back and forth, while the spinner under the progress bar spinning while intermittently freezing for a while.
At this point, I have tried resetting NVRAM and SMC several times to no avail. I have rebooted into recovery and verified that the disk has no issues. I have attempted several times to boot into Safe Mode, only to be thrown back to the same screen which the system stuck in a loading state, the screen dimming and brightening.
Before this happened, I was using f.lux. The dimming and brightening of the screen convinced me that the problem could be one of f.lux misbehaving. I booted into single user mode and remove f.lux from Applications. No luck, though.
What options do I have now to recover my system? Could this be the result of a hardware fault?
UPDATE: If I boot into Verbose mode, after a dump of text whizzes buy, the system becomes stuck in the following sequence: the black terminal window becomes clear, and the following lines are printed one by one:
Sandbox: mdworker(448) deny mach-lookup com.apple.audio.audiohald
A number of these are printed, along with some other lines about deny read of certain com files, etc, but the above one is more frequent. Once these lines are printed, they screen flickers, the text is cleared, and start printed again. And this goes on for as long as I can wait.
PS: I should point out that a week ago I had Kaspersky AV installed on the system. In the verbose logs, I saw one line about failure to load a Kaspersky related com file. Taking a cue, I dived into single user mode and removed Kaspersky completely. However, it didn't change anything. The error message displayed above continues to show up again and again without the system getting anywhere.
UPDATE: I ran an extended Apple Hardware test. It did not find any trouble.