There are huge risks to the North Korea summit. A vainglorious president wants a win at nearly any cost, and a small-time dictator may not abide by his promises. There are nuclear missiles, trigger-point armies and an encroaching China to add to the mix.

It’s still an opportunity to muzzle North Korea and shave down the chances of conflict that can spill far beyond, even to California within eventual missile range of the North. The tiny nation has survived to pose a threat that can’t be ignored.

That’s the stage set that the North’s ruler, Kim Jong Un, has created. The dictator who once called Trump “a dotard” has just dispatched a top lieutenant to the United Nations and the White House lawn. Trump has his own whipsaw behavior, switching from welcoming the Tuesday summit in Singapore to a curt cancellation since retrieved.

It’s hard to trust either leader. But a combustible situation requires attention from the pair, whose actions must be analyzed closely as the showpiece summit plays out. Trump is saying he doesn’t “have to prepare much” for the meeting since “it’s about attitude.”

Kim is expected to ask for a formal end to the Korean War that sputtered into a truce in 1953. If that request doesn’t sound like much, it’s still prized by the North and shouldn’t be given away lightly. Trump has already suggested he’s open to “signing a document,” widely read as a peace treaty.

But with that concession being dangled, there is much else to consider. The most pressing is ridding the North of nuclear weapons, including production facilities, launch sites and warheads. Any agreement must be verifiable, meaning unfettered outsider inspectors. Last month the North invited journalists to watch the demolition of one such site, but there was no independent examination.

Left off the table for now are a string of important issues. The North has an estimated 100,000 political prisoners caged in a string of gulags. Their sins include smuggling goods into a starved economy and aiding relatives who’ve fled. Trump should bring up their treatment, which is universally condemned, but he waved off the issue last week.

Another topic left off the list is Pyongyang’s wholesale cyberwarfare, blamed for the Sony hack that cost millions, bank break-ins and other shutdowns and online thefts. The country has not only the skills but also the willingness to deploy them to costly effect. Kim must be warned to curb the brewing issue — or face consequences.

As Trump heads to Singapore, he must be wondering about China, a third party without a seat at the summit table. Kim has met twice with Chinese leaders in the past several months, including on his first-ever foreign trip. The broad effect of any U.S. deal with the North would be a boon to China, especially if Trump reduces the 30,000 troop level or antimissile batteries on China’s doorstep.

Peace, it turns out, may be just as complicated and unpredictable as war. That’s especially true given the two leaders about to meet. Their words will be worth hearing, but their deliberate actions will be the true test.

This commentary is from The Chronicle’s editorial board. We invite you to express your views in a letter to the editor. Please submit your letter via our online form: SFChronicle.com/letters.