Hazard-free Boolean circuits can be exponentially more expensive — and NP-hard to build

thomasahle · x · 2026-11-10

Engineer thomasahle posted a thread on hazards in Boolean circuits: using three-valued Kleene logic (bits are 0, 1, or u for unknown/unstable), a circuit is "hazard-free" only if it outputs the same value for bi=u as for bi=0 and bi=1.

The catch: standard constructions have hazards — MUX(x,y,s)=(x&s)|(y&¬s) outputs u at MUX(1,1,u) instead of 1, so "u" stops acting as "unknown". Fixing this takes extra gates (e.g. (x&y)|((x&s)|(y&¬s))), and hazard-free circuits can be exponentially more expensive: the cited theorem shows that if circuits deciding jn-CLIQUE require n^Ω(jn) size, then some poly-size function has hazard-free circuits requiring 2^Ω(kn) gates; constructing hazard-free Boolean circuits is NP-hard.

Related event: Building Hazard-Free Boolean Circuits Proved NP-Hard(2 posts)→

Original post →

More from Research

Research channel →