SANTA CLARA, Calif. (AP) Coach Kyle Shanahan's tenure in San Francisco began with a lopsided loss to the Carolina Panthers.
The rematch on Sunday between the 49ers (6-0) and Panthers (4-2) will show how far San Francisco has come in two-plus years under Shanahan.
The Niners are off to their best start since 1990 and are one of two remaining undefeated teams in the league thanks to a dominant defense that has shut down nearly every opponent and a diverse offense that takes advantage of Shanahan's play-calling to create mismatches all over the field.
''I see every week as a measuring stick,'' Shanahan said. ''Carolina is always a tough team.''
Now the 49ers are equipped to match up with them after being in a different class back in the 2017 opener. Only five players who started that 23-3 loss for San Francisco are projected to Sunday as Shanahan and general manager John Lynch have remade nearly the entire roster that started 0-9 that season.
Jimmy Garoppolo was brought in midway through 2017 and has been a steady presence at quarterback. The defense has undergone a major overhaul the past couple of years with cornerback Richard Sherman joining the team last year and edge rushers Dee Ford and Nick Bosa coming in this season.
San Francisco added another big piece this week with the addition of receiver Emmanuel Sanders, a message from management to the players that this team is in position to contend for a title.
''It was a guy they valued, a guy Kyle respects a ton, who fits our system very well,'' Sherman said. ''They were doing whatever they could to make our team better. That's the only message that it sends. Regardless of the circumstances, they're working to get us better.''
Panthers coach Ron Rivera said it's easy to see the improvement in the 49ers in the past couple of years.
''They've done well in the draft the last three years,'' he said. ''They've put themselves in position to be successful because of the players and because of the way they approach the game.''
ALLEN BACK UNDER CENTER
Rivera said Kyle Allen will continue to start while Cam Newton rehabs from a mid-foot sprain. Allen is 4-0 this season as the team's starter and his 106.6 QB rating is fourth-best in the NFL. But Rivera said the 49ers will be Allen's stiffest challenge yet. San Francisco ranks first in the NFL in pass defense and is allowing just 10.7 points per game.
''The more he plays, the more comfortable he gets and the more his confidence builds,'' Rivera said of Allen. ''You see quick decisions, you see quick feet. And that's been huge. And probably the one thing I appreciate is that he's learning to protect the ball better.''
The Niners ranked last in the NFL with just 49 catches from wide receivers this season and second worst with 679 yards receiving. That led to the move to acquire Sanders from Denver this week. He had 30 catches for 367 yards and two TDs in seven games with the Broncos and has the versatility to play both outside and inside in San Francisco's offense.
''When you get a guy that talented, it's just about getting the ball in his hands, letting him make plays, the yards after catch, obviously he's tremendous at that,'' Garoppolo said. ''It's just you want to give him opportunities. As the quarterback, it's your job to do that.''
The Panthers have 23 sacks and forced 14 turnovers in the past four games and will look to carry that momentum over following a bye week. Safety Tre Boston said the Panthers can be better, pointing the Patriots defense as the measuring stick in the NFL.
''When we know our assignments it's hard to beat us,'' Boston said. ''Early on it was getting the feel of who you want to be, your identity. We're getting in a rhythm and we're still hungry.''
The Niners have relied on their defense for this fast start. San Francisco has allowed 64 points this season, the second fewest through six games in franchise history to the 63 in 1976. The 49ers have been even more stingy of late, allowing just 10 points the past three weeks against Cleveland, the Rams and Washington, and not allowing any of those teams to reach 200 yards. San Francisco is the first team since Minnesota in 1988 to allow 50 or fewer net yards passing in consecutive games.
DEFENDING THE RUN
Panthers defensive lineman Gerald McCoy said it doesn't matter who is at running back for the 49ers - Tevin Coleman, Matt Breida or Raheem Mostert - they will defend the 49ers the same way.
''They don't base what they do off who is in the game,'' McCoy said. ''They run their offense. They have different guys who can do different stuff. We know we have to deal with four guys, but we are playing against a scheme, not a player.''
Robbie Gould missed his seventh field goal of the season last week, joining Sebastian Janikowski (2000) as the only players in the past 25 years to miss seven field goals in the first six games. Making matters worse is the fact that Gould was given a four-year, $19 million contract with $10.5 million guaranteed this summer after skipping the offseason program in a contract dispute. Gould could get some help this week with another change at long snapper after the Niners have gone through three already this season. Kyle Nelson returns from a 10-game suspension this week.
AP Sports Writer Steve Reed in Charlotte, North Carolina, contributed to this report
More AP NFL: https://apnews.com/NFL and https://twitter.com/AP-NFL