Sen. Chris Murphy called it a rare “bright spot” in the darkness of the highly partisan politics that have come to define Washington in recent years. That bright spot is a piece of legislation, jointly sponsored by Democrats and Republicans, that would stiffen rules to keep guns out of the hands of certifiably dangerous people.

The legislation does not go nearly far enough, as Murphy acknowledged. It leaves in place massive loopholes. And it doesn’t even raise the issue of prohibiting the sale of some guns because of their capabilities to conduct mass shootings.

But it would lead to better enforcement of existing rules intended to keep guns out of the wrong hands. It is so modest in scope and so fundamentally reasonable, even the most ardent of Second Amendment Republican congressmen should be able to back it. Heck, even the National Rifle Association appears OK with the bill.

Yet the gun reform legislation, like any gun reform bill, will face a struggle.

Proposed are penalties and incentives to enforce the requirement that federal agencies report all qualifying infractions to the National Instant Criminal Background Check System. Listing on the NICS blocks an individual from purchasing a gun.

The bill would also reward states that provide records called for under NICS with federal grant preferences, while providing improved public reporting about those states that don’t comply.

The problems with the NICS were revealed after the Nov. 5 shooting in a church in Sutherland Springs, Texas, that left 26 dead. The shooter, who later killed himself, should have been in the system and blocked from buying the weapon he used. He had a 2014 domestic violence conviction. The Air Force, in which the killer served and which prosecuted the case, never reported the conviction to the NICS.

The murderer who walked into a black church in Charleston, S.C., in June 2015 and killed nine congregants had a narcotics arrest that should have blocked his gun purchase as well, but that information also fell through the cracks in the reporting system.

Co-sponsoring the bill with Murphy, who has emerged as the most visible and vocal gun-reform advocate in the Senate, is Sen. John Cornyn, a Texas Republican who is a staunch Second Amendment advocate.

“Why don’t we shock the world and get together and work on something,” Murphy recalled Cornyn suggesting to him on the Senate floor. Murphy spoke to our editorial board Nov. 21.

“For years, agencies and states haven’t complied with the law, failing to upload these critical records without consequences. Just one record that’s not properly reported can lead to tragedy, as we saw … in Sutherland Springs,” Cornyn said in announcing the bill introduced with Murphy.

Another Republican co-sponsor, Sen. Tim Scott of South Carolina, pointed to the Charleston killings at the Mother Emanuel Church as evidence of “the devastation that can manifest if gaps in reporting allow a madman with a criminal history to obtain a weapon.”

Sen. Richard Blumenthal — like Murphy a Connecticut Democrat — is one of several other co-sponsors.

Perhaps some Republicans are recognizing their opposition to any gun reform despite repeated mass shootings is starting to hurt them politically. While it is a long way from closing the loophole that allows private and gun show sales to escape background checks, or restoring the federal ban on semiautomatic assault rifles, the legislation would at least do something to improve things.

Yet it’s hard to be optimistic. Recall that in the wake of the shooting that killed 58 Las Vegas concert goers in October, bipartisan support was noted for a ban on the sale of bump stocks, which allow a semiautomatic weapon to function much like an illegal automatic rifle. Outrageously, no such bill has emerged.

A bump-stock ban should be approved, and so too the Murphy-Cornyn legislation. Stop the obstinacy on gun control.