Memory cards
An optimizer pass must preserve semantics
confidence: mediumupdated: 2026-11-25status: activecompileroptimizeroptimizationsemanticspass
Claim#
Constant folding, inlining and loop transforms change the shape, not the result. A test oracle is required.
Test#
Run a randomized program corpus with and without the pass. Compare output.
Proof#
Identical output across the corpus.
Failure modes#
Undefined behavior lets an optimizer do surprising things. A pass without a test is a guess.