Makers of history are at the mercy of their contemporary chroniclers. The “Dog Shogun” — his name proclaims it — was unfortunate in his.

Less hostile witnesses might have dubbed him the “compassionate shogun.” Even that would have been barbed praise — no praise at all. Compassion was no virtue in 17th-century Japan. It was unmanly, unwarlike. Peace was bad enough. Its first decades had at least left the lordly samurai their strutting, bullying martial swagger. Would the new shogun, with his “Laws of Compassion,” strip them even of that?

Tokugawa Tsunayoshi (1646-1709; ruled 1680-1709), broke the warrior mold. His commoner heritage via his low-born mother, his inherited sympathy for the suffering of the poor, his nonmilitary background, and his suppression of wanton killing and bullying as sportive assertions of class prerogative aroused resentment. The satire and invective it bred, accepted by later generations of historians as fact (argues at least one modern scholar), became the enduring classroom image of Tsunayoshi, the Dog Shogun, born in the Year of the Dog, whose compassion for dogs turned the beasts into masters and humans into their cringing servants.

The schoolbook story is this: Tsunayoshi, as a child and then later in life, was unnaturally close to his mother. The daughter of a Kyoto grocer, she became a serving woman in the shogunal palace, and won the affection of Shogun Iemitsu (1604-51; ruled 1623-51). The child she bore him, gifted beyond his station, rose to power beyond his station, putty in the hands of his ignorant and superstitious mother (a malicious mischaracterization, maintains the modern historian soon to be introduced). When the mother fell under the sway of an ignorant and superstitious monk, Japan’s fate — so the story goes — was sealed.

The new shogun’s failure to beget a surviving heir, the monk was said to have said, was punishment for crimes committed in a past life. Atone, he allegedly counseled, by showing compassion in this life — to dogs in particular, given the year of the shogun’s birth.

Spiteful, baseless gossip, scoffs Beatrice Bodart-Bailey in “The Dog Shogun: The Personality and Policies of Tokugawa Tsunayoshi” (2006).

The Laws of Compassion Tsunayoshi issued at frequent intervals from 1687 on did, it is true, lay remarkable stress on dogs. Edo (present-day Tokyo) swarmed with abused, starved, feral dogs; with their stinking rotting corpses, too. A reforming ruler could hardly ignore them.

But Bodart-Bailey cites numerous other beneficiaries as well: commoners, who could no longer be cut down at random by their social betters; pregnant women, who if indigent became eligible for a degree of unprecedented social welfare; the unborn, with the strengthened enforcement of existing laws against infanticide; abandoned children, with the creation of the first foster homes; the sick, whom local authorities and populace were exhorted to nurse; prisoners, with the humanization of appalling prison conditions; and so on, down to horses, for whom humane treatment was urged.

The main influence here, in Bodart-Bailey’s view, was not monkish superstition but Confucianism, which — most exceptionally, given his rank — dominated the child Tsunayoshi’s education. Ordinarily his early training would have been military. That it wasn’t was his father’s decision. Tsunayoshi was a younger son. He should never have become shogun. Cleverer and more robust than his feeble and feeble-minded older brother, he posed a threat. A military education might have fed ambitions to which he was not entitled.

His mother — very far from a fool and in fact remarkably learned, Bodart-Bailey finds — was charged with his upbringing. Born poor herself, she knew how the poor suffered. She knew Confucius too, and the value he placed on benevolence. She raised her son to be the first shogun steeped in nonmilitary virtues; the first, it seems, who even knew what compassion was.

The Tokugawa Shogunate was born in 1603. Peace, after centuries of unbridled civil war, was nearly eight decades old when Tsunayoshi, the fifth Tokugawa shogun, came to power upon his childless brother’s death. Becalmed warriors, armed, dangerous, proud and rancorous, are peace’s bitterest foes. Their idleness was spiritual death. It was a murderous culture. Murder had literally become one of the manly arts.

The key text here is the military treatise “Hagakure” (1709-16), a record of the somewhat blood-thirsty musings of the samurai-turned-monk Yamamoto Tsunetomo (1659-1719). His most famous saying is, “The way of the warrior is death.”

“This means,” he elaborates, “choosing death whenever there is a choice between life and death.” In short: “Every day without fail one should consider oneself as dead.”

Ah, the good old days! sighs Yamamoto. “Yamamoto Kichizaemon (otherwise unknown) was ordered by his father Jin-emon to cut down a dog at the age of 5, and at the age of 15 he was made to execute a criminal. Everyone, by the time they were 14 or 15, was ordered to do a beheading without fail. A long time ago the practice was followed especially in the upper classes, but today even the children of the lower classes perform no executions, and this is extreme negligence.”

One might forgive an idled and restless old warrior his wistful nostalgia. From a philosopher, we expect loftier thoughts — which the times either breed or do not. Ogyu Sorai (1666-1728), a leading Confucian scholar of his time, seems to betray the spirit of the master in deploring a growing tendency toward leniency in the punishment of minor crimes. “Beheading,” he wrote, “in accordance with early customary law, is the proper thing. However, for some time it has become fashionable to quibble that killing people is inhumane.”

The modern mind is shocked; to us it seems more than a quibble. It did to Tsunayoshi too. He would model himself on two legendary Chinese sage-kings of the third millennium B.C., who ruled so benevolently that all in the realm prospered and were happy. Kings Yao and Shun were likened to the sun, that shone no less brightly on the lowly than on the mighty. Tsunayoshi, too, would radiate benevolence on all.

He tried. Small thanks he got for it.

Michael Hoffman’s new book, “Cipangu, Golden Cipangu,” is a collection of the best The Living Past stories.