Had I not been a white male
I'd have been dead sure I was being discriminated against. I was the hottest thing in engineering, or so I thought, and I did have fantastic results - patents (for the company) projects on time and in budget, you name it, I stormed the heights. This was back in the day and I noted no real discrimination in the outfit other than ageism, in this case, the older, more experienced people did well, and yes, even back then being black or female was good for your career - if you were good at your job. So was there discrimination in favor of those people? Not really - they were good. Maybe they had to be better than average to even get an interview, but since I took part in those too - there just weren't many applying.
On the other hand, half-competent other white males had a vise grip on any higher level jobs. Comging as I did at the very tail end of the boomers (I'm now 64) - everyone was 5 years older than me, and no matter what, I was "the kid".
Well, experience (and then running my own company - I really was good at this stuff) showed me that for one thing I was a right arse back then, and frankly, quite well suited for the job I had, but would have been a disaster had I been promoted to management - only doing that in my own outfit showed me that being a great engineer has little to do with being a good manager/owner.
It still frosted me. And as I said above, I'd have been DAMN SURE it was discrimination if I'd had the least excuse to believe that, and even being white male, I latched onto age as a discriminant.
The sad truth is, it's a pyramid and it's narrower at the top. No matter how many would be a good fit there - and I wasn't - there's only so much room anyway. And those who are there and have the power, naturally tend to hang on to it - and can, because they have the power.
Thus in my older age, I put most of this down to human nature, race and gender independent. Our best two software people were a white male and a purple female (who was in town for NIH to study how she was alive despite essentially no heartbeat - she really was purple).
I do agree with Damore very slightly - there are differences between all pigeonholed types, with a lot of overlap. So what? If you suck at math, don't whine non one's offering you a math job (and sucking at math increasingly means you're likely to be male - last 3 really good maths types I met were female). If you're great at facilitating - you might be a manager or a secretary, male or female - and anyone who's been in or run any big outfit knows damn well it could mostly function without any but the secretaries...
In short, in a highly competitive business like I used to be in - beltway bandit consultant to the IC - there was no discrimination that mattered at all - it was pure meritocracy. Whining about the outfit not obeying the peter principle is just human nature...Honest, you're better off if they don't - the Reg is full of tales of clueless bosses and other jerks promoted for some reason other than they'd be good at their new job.