Validation, Sanitizers, And Miscompilation Defense
Compiler-memory validation is the bounded release input for aggressive
optimization. It proves that high-risk rewrites have translation validation,
sanitizer-backed coverage, differential behavior, complete optimization
remarks, and rollback controls before optimized builds can ship.
Run:
make compiler-memory-validation-check
make native-optimizer-security-check
make native-miscompilation-check
make native-optimizer-security-check and make native-miscompilation-check
run make compiler-memory-validation-check first. The gate is bounded and does
not run self-hosting or broad release matrices.
Evidence Files
compiler-memory-validation/translation-validation.tsvrecords high-risk
IR-to-IR and LIR-to-LIR rewrites that require proof.
compiler-memory-validation/sanitizer-lanes.tsvrecords bounds,
use-after-free, leak, uninitialized-read, data-race, undefined behavior, and
alias-assumption sanitizer lanes.
compiler-memory-validation/differential-matrix.tsvrecords interpreter,
VM, direct ELF, native, object/linker, JIT, post-link, and WASM-shaped
differential lanes where applicable.
compiler-memory-validation/optimization-remarks.tsvrecords source spans,
hotness, reason, expected cost impact, and validation linkage.
compiler-memory-validation/rollback-controls.tsvrecords correctness,
compile-time, RSS, binary-size, runtime, and release-risk controls.
compiler-memory-validation/diagnostics.tsvdefines stable diagnostics.compiler-memory-validation/verification-cases.tsvrecords positive and
negative fixtures.
release/compiler-memory-validation-translation-report.tsvrecords
translation-validation proof results.
release/compiler-memory-validation-sanitizer-report.tsvrecords sanitizer
lane results.
release/compiler-memory-validation-differential-report.tsvrecords
differential behavior.
release/compiler-memory-validation-miscompilation-report.tsvrecords
minimized input, pass, IR level, target, validation result, and rollback
artifact for miscompilation triage.
release/compiler-memory-validation-remarks-report.tsvrecords optimization
remark metadata.
release/compiler-memory-validation-rollback-report.tsvand
release/compiler-memory-validation-risk-exceptions.tsv record rollback and
exception evidence.
release/compiler-memory-validation-diagnostics-report.tsvrecords negative
diagnostics.
perf/compiler-memory-validation-benchmarks.tsvrecords gate budgets.compat/compiler-memory-validation-contract.tsvrecords release ownership
and gate wiring.
tools/compiler_memory_validation_check.pyvalidates the evidence and
fixtures.
Validation Policy
High-risk rewrites are disabled unless they have accepted translation
validation or an explicit release-risk exception. Current high-risk rewrites
include bounds-check elimination, strictness-driven evaluation, tail-call
conversion, dead-store elimination, retain/release elision, post-link block
reorder, and copy-and-patch stencils.
Sanitizers
Optimized builds require sanitizer evidence where the target supports it:
- bounds;
- use-after-free;
- leaks;
- uninitialized reads;
- data races;
- undefined behavior;
- alias assumptions.
Unsupported sanitizer targets must record fallback or no-op evidence instead
of silently passing.
Differential Lanes
Differential rows compare optimized behavior with interpreter, VM, direct ELF,
native, object/linker, copy-and-patch JIT, post-link, and WASM-shaped paths
where applicable. Output hashes and exit status must match.
Diagnostics
The compiler-memory validation gate uses stable diagnostics:
CMV_TRANSLATION_VALIDATION
CMV_SANITIZER_BOUNDS
CMV_SANITIZER_UAF
CMV_SANITIZER_LEAK
CMV_SANITIZER_UNINIT
CMV_SANITIZER_RACE
CMV_SANITIZER_UB
CMV_SANITIZER_ALIAS
CMV_DIFFERENTIAL_MISMATCH
CMV_OPT_REMARK
CMV_ROLLBACK_REQUIRED
CMV_RISK_EXCEPTION
CMV_UNSUPPORTED_SANITIZER_TARGET
Documentation Impact
Translation-validation, sanitizer, differential, optimization remark, rollback,
release-risk exception, optimized-build safety, or miscompilation diagnostic
changes must update this page, the source-owned compiler-memory validation
evidence, release notes, and the public reference index in the same change.