refactor(vm)!: remove publication and logical guard opcodes
Intrepid/Prometeu/Runtime/pipeline/head This commit looks good
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:
@@ -150,59 +150,11 @@ impl DecodedInstr<'_> {
|
||||
}
|
||||
(pops, 1)
|
||||
}
|
||||
Op::FieldsPublish => {
|
||||
let schema = self.imm_u32().map_err(|_| malformed())?;
|
||||
let (decl, _) = type_info(schema)?;
|
||||
let TypeKind::Struct(entries) = &decl.kind else {
|
||||
return Err(bad_category(schema));
|
||||
};
|
||||
let mut slots = 0u32;
|
||||
for entry in entries {
|
||||
let (owner, layout) = type_info(entry.type_id.0)?;
|
||||
if !matches!(owner.kind, TypeKind::Struct(_)) {
|
||||
return Err(bad_category(entry.type_id.0));
|
||||
}
|
||||
let fields =
|
||||
u32::try_from(layout.instance.as_ref().unwrap().initialization_slots)
|
||||
.map_err(|_| malformed())?;
|
||||
slots = slots
|
||||
.checked_add(1)
|
||||
.and_then(|n| n.checked_add(fields))
|
||||
.ok_or_else(malformed)?;
|
||||
}
|
||||
(slots, 0)
|
||||
}
|
||||
Op::ArrayCheckLength | Op::ArrayCopy | Op::StoragePublish => {
|
||||
let (array, owner, first, second) = if self.opcode == Op::StoragePublish {
|
||||
let [a, o, f, s] = self.imm_u32x4().map_err(|_| malformed())?;
|
||||
(a, o, f, s)
|
||||
} else {
|
||||
(self.imm_u32().map_err(|_| malformed())?, 0, 0, 0)
|
||||
};
|
||||
Op::ArrayCopy => {
|
||||
let array = self.imm_u32().map_err(|_| malformed())?;
|
||||
let (_, layout) = type_info(array)?;
|
||||
let element = layout.array.ok_or_else(|| bad_category(array))?.element_type_id;
|
||||
let width = registry.type_layout(element).unwrap().storage.slots;
|
||||
match self.opcode {
|
||||
Op::ArrayCheckLength => (1, 0),
|
||||
Op::ArrayCopy => (5, 0),
|
||||
_ => {
|
||||
let (_, layout) = type_info(owner)?;
|
||||
let instance =
|
||||
layout.instance.as_ref().ok_or_else(|| bad_category(owner))?;
|
||||
if first == second {
|
||||
return Err(bad_category(owner).member(second));
|
||||
}
|
||||
let mut slots = 8 + width;
|
||||
for field in [first, second] {
|
||||
let f = instance
|
||||
.fields
|
||||
.get(field as usize)
|
||||
.ok_or_else(|| bad_category(owner).member(field))?;
|
||||
slots += registry.type_layout(f.type_id).unwrap().storage.slots;
|
||||
}
|
||||
(slots, 0)
|
||||
}
|
||||
}
|
||||
layout.array.ok_or_else(|| bad_category(array))?;
|
||||
(5, 0)
|
||||
}
|
||||
Op::StructNew
|
||||
| Op::StructGet
|
||||
|
||||
Reference in New Issue
Block a user