The company wouldn't move if it still had to pay 500K.
500K in SF gets you a smaller place and plenty of discretionary income. Companies in other places can often give you a house, but not match the discretionary income.
Pay your engineers 500k in a medium cost of living city and you will have the best employee retention of any company once they get used to their quality of life.