pub struct SemanticGraph { /* private fields */ }Expand description
Canonical semantic graph, deliberately independent of Vulkan objects.
Implementations§
Source§impl SemanticGraph
impl SemanticGraph
Sourcepub fn add_value(&mut self, value: SemanticValueDesc) -> Result<SemanticValueId>
pub fn add_value(&mut self, value: SemanticValueDesc) -> Result<SemanticValueId>
Add a handle-free value and assign its canonical identity.
Sourcepub fn add_view(
&mut self,
source: SemanticValueId,
view: SemanticValueId,
byte_offset: i64,
) -> Result<()>
pub fn add_view( &mut self, source: SemanticValueId, view: SemanticValueId, byte_offset: i64, ) -> Result<()>
Record a metadata-only value derived from an earlier value.
Sourcepub fn add_operation(
&mut self,
contract: OperationContract,
inputs: &[Option<SemanticValueId>],
outputs: &[SemanticValueId],
control_dependencies: &[SemanticOpId],
attributes: &[OpAttribute],
) -> Result<SemanticOpId>
pub fn add_operation( &mut self, contract: OperationContract, inputs: &[Option<SemanticValueId>], outputs: &[SemanticValueId], control_dependencies: &[SemanticOpId], attributes: &[OpAttribute], ) -> Result<SemanticOpId>
Add one schema-owned semantic operation transactionally.
Sourcepub fn attach_autograd(
&mut self,
forward_op: SemanticOpId,
output_index: usize,
sequence: u64,
) -> Result<()>
pub fn attach_autograd( &mut self, forward_op: SemanticOpId, output_index: usize, sequence: u64, ) -> Result<()>
Attach a reverse-differentiable forward output to a tape sequence.
Sourcepub fn complete_autograd(
&mut self,
forward_op: SemanticOpId,
sequence: u64,
backward_first_op: SemanticOpId,
backward_op_count: usize,
) -> Result<()>
pub fn complete_autograd( &mut self, forward_op: SemanticOpId, sequence: u64, backward_first_op: SemanticOpId, backward_op_count: usize, ) -> Result<()>
Complete one tape attachment with its contiguous backward operation range.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate canonical identities and every graph-local provenance edge.
Sourcepub fn copy_from(&mut self, source: &Self) -> Result<()>
pub fn copy_from(&mut self, source: &Self) -> Result<()>
Replace this empty graph with a validated clone of source.
Sourcepub fn find_value(&self, id: SemanticValueId) -> Option<&SemanticValueDesc>
pub fn find_value(&self, id: SemanticValueId) -> Option<&SemanticValueDesc>
Return a value by graph-local identity.
Sourcepub fn values(&self) -> &[SemanticValueDesc]
pub fn values(&self) -> &[SemanticValueDesc]
Return all semantic values in canonical order.
Sourcepub fn operations(&self) -> &[SemanticOpDesc]
pub fn operations(&self) -> &[SemanticOpDesc]
Return all semantic operations in canonical order.
Sourcepub fn autograd(&self) -> &[SemanticAutogradDesc]
pub fn autograd(&self) -> &[SemanticAutogradDesc]
Return all autograd attachments in capture order.
Sourcepub fn debug_report_json(&self, name: &str) -> String
pub fn debug_report_json(&self, name: &str) -> String
Return the deterministic donor-compatible semantic graph report as JSON.
The report is backend-independent and contains no storage handles, descriptors, addresses, kernels, or device policy.
Sourcepub fn view_count(&self) -> usize
pub fn view_count(&self) -> usize
Return the number of metadata-only views.
Sourcepub const fn generation(&self) -> u64
pub const fn generation(&self) -> u64
Return the generation incremented by each reset.