refactor(vm)!: remove publication and logical guard opcodes
Intrepid/Prometeu/Runtime/pipeline/head This commit looks good

Remove INDEX_GUARD, ARRAY_CHECK_LENGTH, STORAGE_PUBLISH and FIELDS_PUBLISH
from decoding, metadata, tooling, verification and execution. Keep ARRAY_LEN
and overlap-safe ARRAY_COPY with complete-group ownership and early charging
of calculable copy work, including refused attempts.

Update specifications, producer handoff, qualification evidence and lessons.
Share collection test support and remove redundant Copy clones for Clippy.

Validation: make ci-domains passed with 1,095 workspace tests, five separately
executed debugger socket tests and all 15 unchanged coverage domain gates.
VM release, resource diagnostics and layer/quality suites also passed.

BREAKING CHANGE: PBX using opcodes 0xA7, 0xA8, 0xAA or 0xAB is rejected,
including unreachable instructions. Consumers must adapt their emission and
collection algorithms or operational guarantees.
This commit is contained in:
2026-10-23 23:37:56 +01:00
parent 69ad1931de
commit dcf6561ea7
27 changed files with 1407 additions and 1013 deletions
@@ -709,64 +709,15 @@ fn check(
base += registry.type_layout(parameter.type_id).unwrap().storage.slots as usize;
}
}
Op::ArrayNew | Op::ArrayCheckLength => require(working[end - 1], I64, 0, registry, budget)?,
Op::IndexGuard => {
require(working[end - 2], I64, 0, registry, budget)?;
require(working[end - 1], I64, 1, registry, budget)?;
}
Op::FieldsPublish => {
let schema = TypeId(instruction.imm_u32().unwrap());
let effect = instruction.registry_stack_effect(registry)?.unwrap();
let mut at = end - effect.pops as usize;
let TypeKind::Struct(entries) = &registry.declarations().types[schema.0 as usize].kind
else {
unreachable!()
};
for entry in entries {
budget.work(1)?;
check_group(&working[at..], entry.type_id, registry, budget)?;
at += 1;
for field in
&registry.type_layout(entry.type_id).unwrap().instance.as_ref().unwrap().fields
{
budget.work(1)?;
check_group(&working[at..], field.type_id, registry, budget)?;
at += registry.type_layout(field.type_id).unwrap().storage.slots as usize;
}
}
}
Op::ArrayCopy | Op::StoragePublish => {
let [a, o, f, s] = if instruction.opcode == Op::StoragePublish {
instruction.imm_u32x4().unwrap()
} else {
[instruction.imm_u32().unwrap(), 0, 0, 0]
};
let effect = instruction.registry_stack_effect_in(registry, FunctionId(id))?.unwrap();
let base = end - effect.pops as usize;
check_group(&working[base..base + 1], TypeId(a), registry, budget)?;
check_group(&working[base + 2..base + 3], TypeId(a), registry, budget)?;
Op::ArrayNew => require(working[end - 1], I64, 0, registry, budget)?,
Op::ArrayCopy => {
let array = TypeId(instruction.imm_u32().unwrap());
let base = end - 5;
check_group(&working[base..base + 1], array, registry, budget)?;
check_group(&working[base + 2..base + 3], array, registry, budget)?;
for i in [1, 3, 4] {
require(working[base + i], I64, i, registry, budget)?;
}
if instruction.opcode == Op::StoragePublish {
for i in [5, 6] {
require(working[base + i], I64, i, registry, budget)?;
}
let element =
registry.type_layout(TypeId(a)).unwrap().array.unwrap().element_type_id;
let mut at = base + 7;
check_group(&working[at..], element, registry, budget)?;
at += registry.type_layout(element).unwrap().storage.slots as usize;
check_group(&working[at..], TypeId(o), registry, budget)?;
at += 1;
let fields =
&registry.type_layout(TypeId(o)).unwrap().instance.as_ref().unwrap().fields;
for field in [f, s] {
let ty = fields[field as usize].type_id;
check_group(&working[at..], ty, registry, budget)?;
at += registry.type_layout(ty).unwrap().storage.slots as usize;
}
}
}
Op::StructGet | Op::StructSet | Op::ArrayLen | Op::ArrayGet | Op::ArraySet => {
budget.work(3)?;