Parent: #469; follows #1088; related: #466, #491.
Extend verification from SSA recovery graphs to native lowering output. Program already owns deoptimization values/handlers, precise stack maps, OSR imports, runtime-operation descriptors, and control/safepoint targets. Their common contract needs an independent callable verifier and test-build phase hooks before code emission.
Scope:
- Validate frame/scratch dimensions, slot and slice bounds, recovery sources/constants, handler and exceptional-target shape, and aligned map/deopt identities.
- Validate runtime input spans, descriptor/deopt references, output/operand slot ranges, and optional side-table lengths.
- Check root coverage for recovery frame slots, non-primitive scratch values, and callback inputs; omitted roots require a primitive proof.
- Validate OSR imports and control/safepoint references before any emitter dereference.
- Invoke validation after lowering in test builds and before test-build emission. Production compilation remains excluded at compile time.
- Preserve current valid numeric/boxed/runtime/loop plans and allocator-failure cleanup; reject deterministic metadata mutations with stable errors.
Definition of done:
- Existing straight-line, branch, catch/finally, runtime-effect, OSR, loop-region, and moving-map programs pass validation.
- Corrupt dimensions/slices/slots, missing roots, malformed callback/control/OSR references, and unsafe embedded constants fail closed.
- Test phase hooks, OOM cleanup, Debug/ReleaseSafe/unsuppressed TSan and native GC/semantic gates pass.
- Saved-parent/current corpus outcomes and docs/build audits pass with scoped evidence.
This completes the native-metadata side of verification; it does not claim completion of #469 optimization passes or performance acceptance.