pub struct InlinePass;Expand description
Subgraph 内联优化 pass。
自动识别 SubgraphNode,评估是否值得内联, 如果值得则展开 Subgraph,合并到外层 Graph。
§设计理念
- 像 LLVM 的 function inlining
- 用户不应该手动调用
builder.merge() - 应该由
compile()自动决定
§评估标准
- 图大小 < 阈值
- 没有外部依赖
- StateLens 是纯投影
§当前状态
⚠️ 骨架实现 — 目前仅识别 Subgraph 节点并收集统计信息,
不执行实际的内联展开。run() 始终返回 false。
完整的内联逻辑需要处理:
- StateLens 的类型擦除与节点重映射
- 边重定向(外层 → 内层入口 / 内层出口 → 外层)
- NodeId 命名空间隔离
Implementations§
Source§impl InlinePass
impl InlinePass
Trait Implementations§
Source§impl<S: WorkflowState, M: MergeStrategy<S>> CompilerPass<S, M> for InlinePass
impl<S: WorkflowState, M: MergeStrategy<S>> CompilerPass<S, M> for InlinePass
Auto Trait Implementations§
impl Freeze for InlinePass
impl RefUnwindSafe for InlinePass
impl Send for InlinePass
impl Sync for InlinePass
impl Unpin for InlinePass
impl UnsafeUnpin for InlinePass
impl UnwindSafe for InlinePass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more