At the start of the presidential campaign, Ted Cruz told voters he would be the only “consistent conservative” in a crowded Republican field.

Then he confronted the modern GOP — a fractured party, in which each faction has a different definition of what “conservative” means.

To consistently please all of them, Cruz has had to be inconsistent with himself.

Time and again he has shifted, shaded or obfuscated his policy positions — piling on new ideas, which sometimes didn’t fit with the old.

Cruz, for instance, promised libertarians that he would show a strict respect for the Constitution’s checks and balances.

Then, the senator from Texas promised social conservatives that he would scrap one of those checks and balances, stripping lifetime tenure from Supreme Court justices.

He criticized Donald Trump’s plan for mass deportation of undocumented immigrants. Then he seemed to support it. He appeared skeptical of military intervention in Syria. Then he vowed to find out whether “sand can glow in the dark” there.

Cruz’s maneuvering has helped him build and maintain a base of support among the party’s activist class: If Trump fails to win the GOP nomination outright, Cruz could have enough backing among Republican delegates to win it after the first ballot at the party’s convention in Cleveland in July.

But while Cruz’s rightward shifts might have been politically smart during the primary season, they probably would create major challenges during the general election, putting Cruz far to the right of most voters.

“Now, he’s in this wonderful position where he’s both the last anti-establishment candidate acceptable who is not named Donald Trump, and he’s also the last establishment candidate,” said Matt Welch of the libertarian magazine Reason, applauding Cruz’s policy shifts. “That’s just a genius level of maneuvering.”

“The question is: What might he believe, in the middle of all of that?” Welch said. “And I think people have a right to be very skeptical as to whether there is a real core belief system.”

Cruz’s campaign did not respond Friday to a detailed list of questions about his policy positions.

It’s clear that, on a number of issues, Cruz has been very consistent in his beliefs.

He has opposed giving undocumented immigrants a path to U.S. citizenship. He says that climate change is not a significant problem, defying considerable scientific evidence for climate change.

Cruz has consistently opposed abortion, including in cases in which the pregnancy was caused by rape. He opposes same-sex marriage. But Cruz says that — despite those personal feelings — he would leave decisions on abortion and marriage to the states.

That was of a piece with Cruz’s politics during his early years in the Senate: He adhered to tea party originalism, which believed Washington could be corrected by a return to the limited vision of its Founding Fathers.

“We need to restore the Constitution as our standard,” Cruz says on his campaign website.

Then, after the Supreme Court decision last year that made same-sex marriage a right nationwide, Cruz said the Constitution needed a change.

“I am proposing an amendment to the United States Constitution that would subject the justices of the Supreme Court to periodic judicial-retention elections,” Cruz wrote in an op-ed in National Review. Now, Cruz said, the public would periodically get a chance to throw out “judicial tyrants” with whom they disagreed.

He didn’t actually file that proposed amendment, but a point was made. This was a different kind of conservatism, one in which some policies were so important that the Constitution should adapt to them.

“If Ted Cruz is a ‘constitutionalist,’ he is a sore-loser, fair-weather constitutionalist,” David Vladeck, a professor at Georgetown University Law Center, wrote in an email. “The Constitution’s framers would be aghast at Cruz’s proposal to undermine the Constitution’s main protection against a tyrannical majority.”

On the subject of immigration, Cruz once championed policies from his party’s business wing — including big increases in legal immigration. He called for doubling the caps on the number of green cards granted each year and supported a fivefold increase in the number of visas granted to high-skilled guest workers, known as H-1B visas. He demurred when asked what he’d do with the millions of illegal immigrants already living in the United States.

But then came Trump.

After the billionaire used promises of a sweeping immigration crackdown to rocket to the top of the GOP race, Cruz’s own policies grew sharply tougher. He was against any increase in legal immigration. He called for the high-skilled visa program to be halted for 180 days so that reported abuses in the system could be investigated.

Rick Tyler, Cruz’s former communications director, said he believes Cruz is “to the right of everyone who’s running” in the race.

“If he changed his position on H-1B — and it’s fair to say he did, but you have to look underneath it and say, ‘Did he change his principle on it?’ No, and I think that’s the important thing,” Tyler said.

On the question of what to do with illegal immigrants, Cruz’s answers grew tougher and tougher.

First, Cruz said, he wouldn’t offer them legal status. But he wouldn’t follow Trump’s lead and deport immigrants en masse.

Then, maybe, he would.

“Yes, we should deport them,” Cruz said on Fox News. When asked by host Bill O’Reilly if he would “look for them,” Cruz said yes.

“Of course you would. That’s what ICE exists for,” Cruz said, referring to U.S. Immigration and Customs Enforcement. “We have law enforcement that looks for people who are violating the laws that apprehends them and deports them.”

If Trump had redefined what the most conservative position on immigration was, Cruz was going to keep up. At rallies now, Cruz makes this explicit without saying Trump’s name: He says he wants to build a border wall and that he already “has someone in mind to build it.”

Another noticeable shift was in Cruz’s approach to the federal budget.

At the beginning of his campaign, his ideas seemed drawn to please anti-tax conservatives, whose biggest concern was to reduce what Washington raises and spends. Cruz proposed instituting a single flat income tax, set at 10 percent. That would be a massive boon to the rich, who pay much higher rates now: The nonpartisan Tax Policy Center found that the top 0.1 percent of earners would get a tax cut equivalent to 29 percent of their after-tax income.

It would also take a massive slice out of overall federal revenue: The Tax Policy Center estimated the loss at $8.6 trillion over a decade. That was a major departure from past GOP orthodoxy: 2012 nominee Mitt Romney didn’t want to reduce revenue at all.

That was still not as big as Trump’s proposed tax cut, which the center saidwould eliminate $9.5 trillion in future revenue.

Cruz had specific suggestions for what he would cut to partially offset the loss. He would eliminate four Cabinet agencies — the departments of Commerce, Energy, Education, and Housing and Urban Development — and the Internal Revenue Service (Cruz would shift the tax-collecting function to a new office with less power and fewer employees). In fact, Cruz wanted a new constitutional amendment to require that the federal budget eventually balance.

But then, while campaigning in hawkish South Carolina, Cruz added another piece to the plan.

Even as he slashed funding for the rest of the government, he promised a spending spree at the Pentagon: dozens more warships, hundreds more planes, thousands more troops. Analysts have estimated that the cost could exceed $1 trillion — and that it could reach $2.4 trillion — over a decade.

“All these promises can’t add up. It’s not possible,” said Marc Goldwein of the Committee for a Responsible Federal Budget. He estimated that if Cruz tried to make good on all of these promises — plus another pledge to fully fund Social Security benefits for the near future — he might have to cut all other spending by 85 or 90 percent. “It’s not realistically possible to cut taxes by $8 trillion and increase defense spending by $2.5 billion and balance the budget.”

That shift was connected to another, in Cruz’s policies toward the military.

In the Senate, Cruz had voted repeatedly against the bill that sets policy and authorizes funding for the Pentagon, often objecting that it did not have enough civil-liberties protections for Americans accused of terrorism. Late last year, Cruz was deeply skeptical of U.S. military interventions overseas — even in Syria. “We have no dog in the fight of the Syrian civil war,” he said.

Cruz has said he remains skeptical of unnecessary foreign interventions, but in February he called for an extensive Pentagon buildup. He also began to call for aggressive tactics against the Islamic State in Syria: The United States would carpet-bomb the militants, Cruz said, and find out “if sand can glow in the dark.”

That has left even proponents of a larger U.S. military wondering about the sincerity of Cruz’s positions.

“I don’t buy that he understands what he’s trying to do,” said Chris Harmer, a retired Navy commander and national security consultant. He said he agreed with Cruz that the Navy was too small, but he wondered why he hadn’t said so before. “Ted Cruz should have spent the last four years making a case for: This is why the end state of the Navy ought to be bigger ... He hasn’t done any of that,” Harmer said.