Just for context, I'm a man, and I'm very sorry this happened to you. This is a problem in cultures all over the world, and as a species, we simply have to do better. I have two female relatives who work in tech and both of them have had experiences very similar to yours. Sadly, the younger of my two relatives has had this experience at more than 1 company.

Your post highlights a critical issue: the near total lack of visible justice for the victims. So let me tell you about the invisible justice that gets meted out. This doesn't excuse what happened to you, but I want you to know that there are people who are trying to address this issue in a way that provides significant financial and professional consequences to the perpetrators.

As a manager, it's far easier for me to quietly - dare I say silently - kill someone's career at the company by dead ending them than it is for me to ever do anything formal. With respect to HR, most managers have about as much power as the average employee, which is to say that we can just as quickly end up on the wrong side of the fence as the person being harassed. HR is not our friend either! Therefore, in the case of ordinary harassment, the best thing an employee can do is find a quiet way to put a manager on notice that something is wrong. Then a manager can start watching. We can proactively go through emails. We can start looking for bad behavior while the perpetrator has no idea, and we have the power to use quiet, offhand remarks to make the perpetrators paranoid. We can reassign employees to different work, and we can take work away from them that they really enjoy. I recently punished a loud-mouthed developer by taking him off a feature that he originated and giving it someone else. Yeah, his work was excellent, but it's always easy to find justifications once I know that I have to act.

Men with sexist ideas about how the world should operate, or men who believe that bullying other employees is acceptable, need to understand a few things. When they just can't seem to get that promotion, and feel like they're constantly sand-bagged by their manager, it's very likely because their manager is doing invisible damage control. HR doesn't know. Their manager's manager doesn't know. They don't know, and even if they suspect, there's no way they can ever prove it because there's no paper trail. As a manager, I stop mentoring these guys for promotions and start teaching their well-behaved coworkers instead so that I have a nice slate of well-prepared employees for promotion season.

Even though most of this is invisible, it's happening and it costs these men tens of thousands of dollars over the two and three years they spend waiting for promotions that never come. It's incredibly easy to take someone's excellent technical work and find fault with it for any number of reasons. Yes, this strategy uses some of the same tactics as the perpetrators, but I learned a long time ago that bullies and sexists don't care about rules. So why should I?

Yeah, eventually a bully leaves and some of them get a higher salary elsewhere, but they don't get to leave with a better resume. They don't leave with that title. And make no mistake, their new employer figures them out pretty fast and the same thing happens.