vm(hako): add v1 reader/dispatcher (flagged), commonize mir_call handler, share block scan; smokes: add v1 hakovm canary; docs: 20.37/20.38 plans, OOB policy; runner: v1 hakovm toggle; include SKIP summary

This commit is contained in:
nyash-codex
2025-11-03 23:21:48 +09:00
parent a4f30ae827
commit 06a729ff40
67 changed files with 3340 additions and 1520 deletions

View File

@ -100,9 +100,25 @@ impl MirInterpreter {
block: &BasicBlock,
last_pred: Option<BasicBlockId>,
) -> Result<(), VMError> {
let trace_phi = std::env::var("NYASH_VM_TRACE_PHI").ok().as_deref() == Some("1");
if trace_phi {
eprintln!(
"[vm-trace-phi] enter bb={:?} last_pred={:?} preds={:?}",
block.id,
last_pred,
block.predecessors
);
}
for inst in block.phi_instructions() {
if let MirInstruction::Phi { dst, inputs } = inst {
let dst_id = *dst;
if trace_phi {
let in_preds: Vec<_> = inputs.iter().map(|(bb, _)| *bb).collect();
eprintln!(
"[vm-trace-phi] phi dst={:?} inputs.pred={:?}",
dst_id, in_preds
);
}
if let Some(pred) = last_pred {
if let Some((_, val)) = inputs.iter().find(|(bb, _)| *bb == pred) {
let v = match self.reg_load(*val) {
@ -150,6 +166,15 @@ impl MirInterpreter {
}
};
if strict {
if trace_phi {
eprintln!(
"[vm-trace-phi][strict] mismatch dst={:?} last_pred={:?} inputs={:?} preds_of_bb={:?}",
dst_id,
pred,
inputs,
block.predecessors
);
}
return Err(VMError::InvalidInstruction(format!(
"phi pred mismatch at {:?}: no input for predecessor {:?}",
dst_id, pred