vyre_runtime/megakernel/workspace_adapter.rs
1//! Consumer-neutral resident workspace adapter for megakernel programs.
2//!
3//! Runtime owns the buffer/IR composition seam. Frontends, analyzers, parsers,
4//! and dataflow engines own their domain-specific manifests and phase machines.
5
6use vyre_foundation::ir::{BufferDecl, Node};
7
8/// Adapter implemented by any domain that wants a GPU-resident megakernel
9/// workspace without baking that domain into `vyre-runtime`.
10pub trait MegakernelWorkspaceAdapter {
11 /// Buffer declaration inserted after the core megakernel buffers.
12 fn buffer_decl(&self) -> BufferDecl;
13
14 /// IR nodes that initialize resident workspace state.
15 fn bootstrap_nodes(&self) -> Vec<Node>;
16
17 /// IR nodes that validate resident control-plane state before dispatch.
18 fn guard_nodes(&self) -> Vec<Node> {
19 Vec::new()
20 }
21
22 /// IR nodes that run domain-owned phase/control handlers.
23 fn dispatch_nodes(&self) -> Vec<Node> {
24 Vec::new()
25 }
26}