Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plafer mast library compilation (#1401)
* Introduce `ExternalNode` * Replace `Assembler.node_id_by_digest` map * add TODOP * Add `Host::get_mast_forest` * Move kernel and entrypoint out of `MastForest` * Remove ProgramError * docs * cleanup Program constructors * fix docs * Make `Program.kernel` an `Arc` * fix executable * invoke_mast_root: fix external node creation logic * add failing test * don't make root in `combine_mast_node_ids` and `compile_body` * fix External docs * fmt * fix `entrypoint` doc * Rename `Program::new_with_kernel()` * Document `MastForestStore` and `MemMastForestStore` * fix syscall * execute_* functions: use `MastForest` * `Program`: Remove `Arc` around kernel * remove `Arc` around `MastForest` in `Program` * Return error on malformed host * Simplify `DefaultHost` * `MastForest::add_node()`: add docs * fmt * add failing `duplicate_procedure()` test * Introduce `MastForestBuilder` * Rename `mod tests` -> `testing` * add `duplicate_node()` test * changelog * Program: use `assert!()` instead of `debug_assert!()` * `MastForest::make_root()`: add assert * fmt * Serialization for `MastNodeId` * serialization for MastNode variants except basic block * MastForest serialization scaffolding * define `MastNodeType` constructor from `MastNode` * test join serialization of MastNodeType * `MastNodeType` serialization of split * Revert "serialization for MastNode variants except basic block" This reverts commit efc24fd. * add TODOP * impl Deserializable for `MastForest` (scaffold) * mast_node_to_info() scaffold * try_info_to_mast_node scaffold * Rename `EncodedMastNodeType` * add info module * encode operations into `data` field * decode operations * implement `BasicBlockNode::num_operations_and_decorators()` * OperationOrDecoratorIterator * basic block node: move tests in new file * operation_or_decorator_iterator test * Implement `Operation::with_opcode_and_data()` * encode decorators * implement `decode_decorator()` * fix exec invocation * no else blk special case * add procedure roots comment * implement forgotten `todo!()` * `serialize_deserialize_all_nodes` test * `decode_operations_and_decorators`: fix bit check * confirm_assumptions test scaffold * minor adjustments * Introduce `StringTableBuilder` * naming * test confirm_operation_and_decorator_structure * remove TODOP * remove unused `MastNode::new_dyncall()` * Remove `Error` type * add TODOP * complete test `serialize_deserialize_all_nodes` * check digest on deserialization * remove TODOP * safely decode mast node ids * use method syntax in `MastNodeType` decoding * TODOPs * rewrite <= expression * new `MastNodeType` * implement `Deserializable` for `MastNodeType` * migrate tests to new * Use new MastNodeType * rename string_table_builder_ module * implement `BasicBlockDataBuilder` * add TODOP * BasicBlockDataDecoder * use `BasicBlockDataDecoder` * add headers * add `MastNodeInfo` method * return `Result` instead of `Option` * Remove TODOP * docs * chore: add section separators and fix typos * refactor: change type of the error code of u32assert2 from Felt to u32 (#1382) * impl `Serializable` for `Operation` * impl Deserializable for `Operation` * `StringTableBuilder`: switch to using blake 3 * `EncodedDecoratorVariant`: moved discriminant bit logic to `discriminant()` method * Remove basic block offset * Cargo: don't specify patch versions * make deserialization more efficient * num-traits and num-derive: set default-features false * Remove `OperationData` * `StringRef`: move string length to data buffer * store offset in block * Use `source.read_u32/u64()` * Update `MastNodeInfo` docstring * rename arguments in `encode_u32_pair` * Use basic block offset in deserialization * `BasicBlockDataDecoder`: use `ByteReader::read_u16/32()` methods * `StringTableBuilder`: fix comment * Remove `StringRef` in favor of `DataOffset` * cleanup `MastNodeType` serialization * derive `Copy` for `MastNodeType` * `MastNodeType` tests * add `MastNodeType` tests * use assert * fix asserts * `ModuleGraph::recompute()` reverse edge caller/callee * Implement `Assembler::assemble_library()` * changelog * fix docs * Introduce `CompiledFQDN` * Introduce `WrapperModule` to module graph * split `ModuleGraph::add_module()` * fix compile errors from API changes * fix debug structs * fix `Assembler::get_module_exports()` * fix `process_graph_worklist` * fix procedure * fix `NameResolver` * move `CompiledModule` * `CompiledLibrary::into_compiled_modules` * `Assembler::add_compiled_library()` * changelog * fix `assemble_library()` signature * test `compiled_library()` * nits * register mast roots in `Assembler::add_compiled_library()` * fix resolve * `ModuleGraph::topological_sort_from_root`: only include AST procedures * `Assembler::resolve_target()`: look for digest in module graph first * remove `AssemblyContext::allow_phantom_calls` flag * remove TODOP * `ResolvedProcedure` is no longer `Spanned` * improve test * remove TODOP * `CompiledProcedure` -> `ProcedureInfo` * Document `CompiledLibrary` * Rename `CompiledModule` -> `ModuleInfo` * Refactor `ModuleInfo` * `ModuleWrapper` -> `WrappedModule` * Document `PendingModuleWrapper` * document `Assembler::assemble_library()` * fix TODOP * rename * fix test * cleanup `ModuleGraph::topological_sort_from_root` * fix CI * re-implement `Spanned` for `ResolvedProcedure` * reintroduce proper error message * remove unused methods * Remove all `allow(unused)` methods * Document `unwrap_ast()` call * `NameResolver`: remove use of `unwrap_ast()` * Document or remove all calls to `WrappedModule.unwrap_ast()` * rename `PendingWrappedModule` * Add `ModuleGraph::add_compiled_modules()` * Remove `ModuleGraph::add_module_info()` * refactor: remove Assembler::compile_program() internal method * refactor: remove Assembler::assemble_with_options() internal method --------- Co-authored-by: Bobbin Threadbare <[email protected]> Co-authored-by: Andrey Khmuro <[email protected]>
- Loading branch information