The first test of the Walker Buehler experiment was not great.

How long it lasts will be a question every time he pitches or until he is much better than in his Padres debut.

As for Monday night, though, he would have had to be really good for the Padres to prevent the San Francisco Giants from getting their first victory of the season.

Because Giants’ starter Landen Roupp was excellent — or the Padres helped him appear so — in the opener of a three-game series won 3-2 by the visitors.

And only at the last possible moment did the Padres become competitive, as Jackson Merrill hit a two-run home run with two outs in the ninth inning off Giants closer Ryan Walker.

The Padres’ pitching was bad enough and good enough, and the Detroit Tigers’ pitchers were excellent enough that attention was diverted from an anemic Padres offense in the season’s first series.

But four games into the season, they have scored a total of nine runs, are batting .185 and are 5–for-26 (.192) with runners in scoring position.

Roupp, who in four previous starts against the Padres had either shut them out for at least five innings or been pummeled, allowed two hits, walked two and struck out seven over six innings on Monday.

The right-hander allowed singles to Xander Bogaerts in the second inning and Fernando Tatis Jr. in the sixth and threw 88 pitches while turning in the third quality start of the season against the Padres.

Buehler surrendered all the Giants’ runs in his four innings, the first two as good as possible but the second two not good enough to prevent a relative offensive uprising by the Giants.

The 31-year-old right-hander, who signed a minor-league deal in February, made the season-opening rotation by committing during the spring to a different approach. No longer able to throw in the high 90s, he struggled the past two seasons since returning from his second Tommy John surgery. He turned this spring to more often mixing in his five other offerings.

That worked well for a time. Buehler began the game by retiring the first six batters in 20 pitches, just three of them fastballs.

A curveball Buehler left up over the plate was sent by Harrison Bader to the ribbon board beyond left field to give the Giants their first lead of the season on their first home run of the season.

They had scored one run in a three-game sweep by the Yankees to start the season.

They were not finished battering Buehler.

The first hits of the season by Patrick Bailey and Casey Schmitt, both two-out singles, gave the Giants a 2-0 lead in the fourth after Buehler had surrendered a single and walked a batter with one out.

Tatis’ single with one out in the sixth was followed by Manny Machado grounding into a double play and six more outs in succession against Giants relievers Matt Gage and Keaton Winn before Jake Cronenworth led off the bottom of the ninth with a walk against Ryan Walker.

Tatis followed with a strikeout, and Machado grounded out softly to first base before Merrill’s homer. Bogaerts’ groundout to shortstop ended the game.