I think your salary estimates aren't high enough. In California you're paying around 35% in state/fed income taxes, which means that with $225k gross you have $145k net of taxes and under $100k after living expenses. With $325k gross you're $160k after taxes and living expenses. Even starting at the top of your range, it gets you just over halfway there before investment gains.
So OP was making 300k (roughly standard for a mid-level engineer in the Bay Area at about 20+ different companies here) and dumping 160k of it into index funds every year.
With the market basically doubling over the past 8 years with no inflation, and those returns compounded, it's clear to see how he got to $2m.
This doesn't account for any returns on company stock OP held on to (tech companies have basically doubled the return of the S&P over the past 10 years).
Whether you could replicate OP's experience over the next 10 years, is debatable.
The scenario you describe makes sounds plausible, but it isn’t “I saved $2.2M over my 8 year career”. “Save” ≠ invest in the stock market. The commenter made this seem like the low-risk alternative to taking VC funding, so relying on stock market returns is antithetical to that.