The dog is steering the boat, and the humans on board are pretty sure he’s leading it astray.

Tucker, a nine-year-old black lab mix, is an improbable character in a high-stakes detective story: the case of the declining orcas. He’s sniffing for a needle in a haystack — a small plastic container filled with the feces of a killer whale, floating somewhere in the vastness of the Strait of Juan de Fuca in northwestern Washington state. With his body language — pacing across the bow, leaning over its edge, the angle of his nose — he tells his handler, Liz Seely, and Deborah Giles, who sits behind the wheel, where to steer.

He seems firm on the scent. He’s directing the boat in the opposite direction of where we floated the sample before motoring away to set up this test of his abilities. “Oh no, this is so embarrassing,” Seely later admitted to thinking.

But suddenly, there it is ahead of us: the pink plastic bowl, bobbing on the surface of the water, just where Tucker knew it would be. The wind and current have moved it far from where we placed it, but Tucker picked up the scent from more than half a mile away. He’s rewarded with applause and his favorite thing in the world: a few minutes of play with a ball. He barks, whips it around, throws it overboard. He’s so overcome he’s practically dancing.

But this isn’t a game. The whales whose poop Tucker pursues across the Salish Sea belong to an endangered population, the Southern Residents — a genetically and behaviorally distinct group of orcas that feeds here each summer and whose population is at its lowest in years. The scientists on board believe that Tucker’s impressive olfactory feats may help them figure out what’s wrong with the whales, and what can be done to help them.