Whenever the 49ers played musical chairs along the offensive line over the past few seasons, it hasn’t been for the best of reasons.

Sliding Marcus Martin inside to center or shuffling Erik Pears between tackle and guard aren’t strategic improvements so much as they are last-ditch survival efforts — efforts that failed miserably in 2015.

After the unexpected return of Anthony Davis this offseason there seemed to be two polarizing schools of though:

1. This guy’s been out for a year and smack-talked the organization. He’s done.

2. We have our starting right tackle back!

Nobody could’ve foreseen Davis’ voluntary move to right guard, and one that improved the overall quality of the 49ers’ line rather than patching up a deficiency, no less. For that, thank 23-year-old Trent Brown, whose emergence as a starting-caliber tackle is perhaps the most important improvement to the 49ers roster that has arisen during training camp.

“I think some of what’s going on with Trent is I think Trent is realizing his abilities and understanding how successful he can be at this game,” said 49ers coach Chip Kelly.

“From a coach standpoint, it’s awesome to see. It’s watching him kind of mature and grow and get better and better. It’s pretty cool to see from that standpoint, but a lot of it, the credit goes to Trent because of what he’s invested in himself.”

Davis’ move inside to accommodate Brown’s rising talent will displace Andrew Tiller, Zane Beadles or Joshua Garnett along the starter five. By transitive property, that implies San Francisco’s coaching staff finds Brown more valuable as a starter at tackle than any of the three guards, since they simply could’ve left Davis at tackle and let those guards compete to start while Brown provided depth as a ‘swing’ tackle.

That’s an impressive jump for a 2015 seventh rounder that wasn’t even a lock to make the roster over Pears a month ago.

Brown started the final two games for the 49ers in 2015 and looked promising while doing it. What he’s accomplished over the offseason though, is a cut above what his play projected.

His attention to conditioning and managing his weight during the summer gave him the tenacity to shoulder the workload of Chip Kelly’s up-tempo offense. Add that to the largest frame on the 49ers roster (6-foot-8, 355 pounds), and you can wave goodbye to the team’s most glaring hole from last year in the right tackle position.

“He’s been doing a tremendous job,” said quarterback Blaine Gabbert. “The way he’s approached the summer program, coming into training camp, the first two preseason games has been tremendous. He’s been playing his tail off and he’s such a young player, he’s only going to continue to get better. He’s been doing a heck-of-a job.”

What was once a scramble to hide poor play or bandage injuries along the offensive line is now luxuriously considered versatility in San Francisco. It all starts with Brown’s ascension, and the 49ers offensive line could jump from the bottom of the NFL to one that catalyzes a surprising offense in Kelly’s first season.