gds.verification¶
Engine¶
Run verification checks against a SystemIR.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
SystemIR
|
The system to verify. |
required |
checks
|
list[Callable[[SystemIR], list[Finding]]] | None
|
Optional subset of checks. Defaults to all generic checks. |
None
|
Source code in packages/gds-framework/gds/verification/engine.py
Findings¶
Bases: BaseModel
A single verification check result — pass or fail with context.
Source code in packages/gds-framework/gds/verification/findings.py
Bases: BaseModel
Aggregated verification results for a system.
Source code in packages/gds-framework/gds/verification/findings.py
Generic Checks¶
Generic verification checks G-001 through G-006.
These checks operate on the domain-neutral SystemIR. They verify type consistency, structural completeness, and graph topology without referencing any domain-specific block types or semantics.
check_g001_domain_codomain_matching(system)
¶
G-001: For every covariant block-to-block wiring, verify the label is consistent with source forward_out or target forward_in.
Source code in packages/gds-framework/gds/verification/generic_checks.py
check_g002_signature_completeness(system)
¶
G-002: Every block must have at least one non-empty input slot and at least one non-empty output slot.
Source code in packages/gds-framework/gds/verification/generic_checks.py
check_g003_direction_consistency(system)
¶
G-003: Validate direction flag consistency and contravariant port-slot matching.
Two validations:
A) Flag consistency — direction, is_feedback, is_temporal must
not contradict:
- COVARIANT + is_feedback → ERROR (feedback implies contravariant)
- CONTRAVARIANT + is_temporal → ERROR (temporal implies covariant)
B) Contravariant port-slot matching — for CONTRAVARIANT wirings, the label must be a token-subset of the source's backward_out (signature[3]) or the target's backward_in (signature[2]). G-001 already covers the covariant side.
Source code in packages/gds-framework/gds/verification/generic_checks.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
check_g004_dangling_wirings(system)
¶
G-004: Flag wirings whose source or target is not in the system.
Source code in packages/gds-framework/gds/verification/generic_checks.py
check_g005_sequential_type_compatibility(system)
¶
G-005: In stack composition, wiring label must be subset of BOTH source forward_out AND target forward_in.
Source code in packages/gds-framework/gds/verification/generic_checks.py
check_g006_covariant_acyclicity(system)
¶
G-006: Covariant flow graph must be a DAG (no cycles within a timestep).
Temporal wirings and contravariant wirings are excluded.
Source code in packages/gds-framework/gds/verification/generic_checks.py
Spec Checks¶
Every entity variable is updated by at least one mechanism.
Detects orphan state variables that can never change — a likely specification error.
Source code in packages/gds-framework/gds/verification/spec_checks.py
Within each wiring, no two mechanisms update the same variable.
Detects write conflicts where multiple mechanisms try to modify the same state variable within the same composition.
Source code in packages/gds-framework/gds/verification/spec_checks.py
Can signals reach from one block to another through wiring?
Maps to GDS attainability correspondence.
Source code in packages/gds-framework/gds/verification/spec_checks.py
Wire spaces match source and target block expectations.
Verifies that space references on wires correspond to registered spaces and that source/target blocks are connected to compatible spaces.
Source code in packages/gds-framework/gds/verification/spec_checks.py
All parameter references in blocks resolve to registered parameters.
Validates that every params_used entry on blocks corresponds to
a parameter definition in the spec's parameter_schema.
Source code in packages/gds-framework/gds/verification/spec_checks.py
Canonical projection structural validity.
Checks: - SC-006: At least one mechanism exists (f is non-empty) - SC-007: State space X is non-empty (entities with variables exist)