Say I'm selling my shares of company X on May 1st, because I'm generally concerned about the prospects of the company. I realise a loss as a result. Then the economics of the company improve, so I decide to buy back my shares on August 15th same year, so 3.5 months after.
Would this be classified as a wash sale? If so, would it come with penalties? Or would the buy and sell transactions merely be considered as never happened, so I would still keep my original unrealised loss?