feat(vm): add typed array and struct guest operations
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good
Add seven Registry-backed collection opcodes with bounded verification, complete value groups, transactional publication and exact attempt costs. Publish ISA, memory and cycle contracts, producer handoff and the completed lesson. Validate with 925 workspace tests, optimized collection suites and all eight coverage domain gates. Make headless fixture directory names unique for parallel tests.
This commit is contained in:
@@ -178,6 +178,8 @@ pub struct OwnedField {
|
||||
}
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub struct StructLayout {
|
||||
/// Sum of execution-slot widths, resolved once for deterministic NEW charging.
|
||||
pub initialization_slots: u64,
|
||||
pub size: usize,
|
||||
pub alignment: usize,
|
||||
pub fields: Vec<FieldLayout>,
|
||||
@@ -277,9 +279,13 @@ impl Registry {
|
||||
.count();
|
||||
let mut owned = b.vector(owned_count, Q::RegistryBytes)?;
|
||||
let (mut size, mut alignment) = (0, 1);
|
||||
let mut initialization_slots = 0u64;
|
||||
for field in fields {
|
||||
b.work(1)?;
|
||||
let layout = layouts[field.type_id.0 as usize].storage;
|
||||
initialization_slots = initialization_slots
|
||||
.checked_add(u64::from(layout.slots))
|
||||
.ok_or_else(overflow)?;
|
||||
size = align(size, layout.alignment)?;
|
||||
offsets.push(FieldLayout { type_id: field.type_id, offset: size });
|
||||
if layout.ownership != Ownership::Plain {
|
||||
@@ -289,6 +295,7 @@ impl Registry {
|
||||
alignment = alignment.max(layout.alignment);
|
||||
}
|
||||
layouts[i].instance = Some(StructLayout {
|
||||
initialization_slots,
|
||||
size: align(size, alignment)?,
|
||||
alignment,
|
||||
fields: offsets,
|
||||
|
||||
Reference in New Issue
Block a user