How far will Mayor de Blasio and Schools Chancellor Richard Carranza go in their drive to remake the city’s elite high schools? They’ve got three years to destroy the schools in their bid to “save” them.

Later this month, 25,000-plus high-achieving eighth and ninth graders will take the admissions exam for these schools; about 5,000 will get admission offers in March.

De Blasio and Carranza want to scrap the test so they can hand more than half the seats to black and Hispanic students.

And Carranza has noted that he can simply order the test scrapped for five of the eight schools: the ones created under Mayor Michael Bloomberg. Happily, he’s so far listening to the schools’ principals and leaving well enough alone.

But he and the mayor are also hoping the Legislature will kill or alter the law that mandates performance on the exam as the sole criterion for most admissions to Stuyvesant HS, Brooklyn Tech and Bronx Science — and it’s possible that a Democratic Socialist wave election next month might make that possible.

Short of that, the two leaders are expanding and changing the decades-old Discovery program in hopes that will give them some of the race-based results they want.

But they have another option, because the city Department of Education actually controls the entrance exam itself. And the de Blasio DOE has already watered down the test once, just last year, in theory to align it with the (much-despised) Common Core curriculum.

But that didn’t shift the racial-ethnic mix: As before, only about 10 percent of admissions offers went to black and Hispanic students. But the DOE faces no limits on what else it might do. Heck, it suppressed for five years an outside consultant firm’s finding that the exam as it stands is a valid predictor of future achievement at these elite schools.

For now, de Blasio and Carranza’s hopes rest on the Discovery changes — reserving a full fifth of elite-school seats for minority students from high-poverty schools who pass a special summer-school program after just missing the cut-off score for admission.

But if that doesn’t work, and the Legislature doesn’t bend on the test, all bets are off. If you care about protecting excellence in the city school system, beware.