After enduring weeks of barnstorming, television ads, and rallies, Pennsylvania voters head to the primary polls Tuesday to make choices in the lively presidential contest, a U.S. Senate race going down to the wire, and other campaigns that could reshape the political and government landscapes.

Also at stake are Democratic and Republican nominations for Pennsylvania attorney general, contested primaries in three Philadelphia-area congressional districts - including the one where indicted 11-term U.S. Rep. Chaka Fattah is fighting for his political life - and a handful of contested primaries for state legislative seats.

Atop the ticket, the presidential front-runners are aiming to expand their leads. Hillary Clinton was favored to top Sen. Bernie Sanders among Democrats, while Republican Donald Trump was seeking to build on his delegate count over Sen. Ted Cruz and Gov. John Kasich.

Republicans can also choose as many as three GOP convention delegates per congressional district. Those 54 delegates will help pick the GOP nominee but are free to support whomever they choose at the Republican National Convention.

(An additional 17 GOP delegates must support whoever wins the state's popular vote, though only for the convention's first ballot. Democrats, meanwhile, vote for delegates already pledged to a candidate.)

In the hotly contested Democratic primary for U.S. Senate, Katie McGinty, Gov. Wolf's former chief of staff, and Joe Sestak, a retired admiral and former congressman, arrived at primary election day running neck and neck, according to polls, with Braddock Mayor John Fetterman and Western Pennsylvania manufacturer Joseph Vodvarka far behind.

The winner will challenge U.S. Sen. Pat Toomey (R., Pa.) in the fall.

But the most decisive vote may come in Pennsylvania's Second Congressional District, where Fattah is trying to fend off three challengers: State Rep. Dwight Evans, ward leader Dan Muroff, and Lower Merion Township Commissioner Brian Gordon.

The winner will almost certainly go to Congress in the fall, given the district's heavily Democratic tilt.

Both parties have primaries in the race to replace embattled Attorney General Kathleen G. Kane, who decided not to seek a second term.

Among Democrats, an increasingly nasty fight pits Montgomery County Commissioners Chairman Josh Shapiro against Allegheny County District Attorney Stephen Zappala Jr. and Northampton County District Attorney John Morganelli. For Republicans, State Sen. John Rafferty of Montgomery County is competing against Joe Peters, a former organized-crime prosecutor.

Two suburban congressional districts have contested primaries.

In the Bucks County-based Eighth, three Republicans are vying to replace U.S. Rep. Mike Fitzpatrick, a Republican who is retiring. They include his brother, former FBI agent Brian Fitzpatrick; neuropsychologist Marc Duome; and former Bucks County Commissioner Andy Warren.

On the Democratic side, State Rep. Steve Santarsiero faces businesswoman Shaughnessy Naughton, who also ran in 2014.

In the Delaware County-based Seventh District, developer Stanley Casacio is seeking to upset incumbent U.S. Rep. Patrick Meehan in the Republican primary. Democrats Mary Ellen Balchunis and Bill Golderer are competing for their party's nomination.

Though all 203 state House seats and half of the 50 Senate seats are up for grabs this year, few involve contested primaries Tuesday.

Just 15 Democratic incumbents - including 11 from Philadelphia and its suburbs - face primary challengers. They include Rep. Margo Davidson of Delaware County; Reps. Brian Sims and Mark Cohen of Philadelphia, the longest-serving legislator in the Capitol; and Rep. Vanessa Lowery Brown, the Philadelphia representative facing trial on charges she accepted money from an undercover informant in a sting investigation.

In Delaware County, voters have a special election for the seat formerly occupied by onetime Senate Majority Leader Dominic Pileggi. There, Democrat Marty Malloy is running unopposed against Republican Thomas Killion, who also has no challenger.

One of the most closely watched state races is the Republican primary in central Pennsylvania for retiring Republican Sen. Pat Vance's seat.

The forecast calls for rain - and some man-made issues could threaten to cloud some voting.

In Montgomery County, Voter Services officials were scrambling to fill dozens of poll-worker vacancies, though officials said the shortfall would not mean longer lines. On Monday morning, the county was short 128 poll workers out of nearly 2,300 slots, though by afternoon county spokesman Frank Custer said the shortfall was dropping.

Election officials were also trying to smooth out a few eleventh-hour ballot snags. In the U.S. Senate primary, ballots had to be updated to restore Vodvarka's name after he won a court challenge last week to get back in the race.

Another late ruling by a Pennsylvania judge postponed until November the decision of whether the retirement ages for state judges should be extended to 75 from 70. But the question to voters will still appear on Tuesday's ballots.

Officials in multiple counties, including Chester, Bucks, and Montgomery, said they would post signs at polls explaining that votes on that question Tuesday will not count.

jtamari@phillynews.com

@JonathanTamari

www.philly.com/capitolinq

Staff writer Caitlin McCabe contributed to this article.