hydr_structures/structures/controlled_gate/
capabilities.rs1use super::{CONTROLLED_GATE_CONTRACT_VERSION, CONTROLLED_GATE_SNAPSHOT_SCHEMA};
4use hydr_core::capability::{
5 ArithmeticRequirement, ComponentCapabilities, ComponentId, Limit, Precision, RuntimeKind,
6 RuntimeStatus, RuntimeSupport, Summary, Unsupported, UnsupportedReason,
7};
8
9const CONTROLLED_GATE_DOC: &str = "docs/controlled-gates.md";
11
12const fn unsupported(
13 id: &'static str,
14 reason: UnsupportedReason,
15 summary: &'static str,
16 doc: &'static str,
17) -> Unsupported {
18 Unsupported {
19 id,
20 reason,
21 summary,
22 doc,
23 }
24}
25
26static CONTROLLED_GATE: ComponentCapabilities = ComponentCapabilities {
27 component: ComponentId::ControlledGate,
28 contract: Some(CONTROLLED_GATE_CONTRACT_VERSION),
29 snapshot_schema: Some(CONTROLLED_GATE_SNAPSHOT_SCHEMA),
30 precision: &[Precision::F64],
31 arithmetic: &[
32 ArithmeticRequirement::F64Ieee754Basic,
33 ArithmeticRequirement::NearestEvenGradualUnderflow,
34 ArithmeticRequirement::FusedMulAdd,
35 ArithmeticRequirement::CorrectlyRoundedElementary,
36 ],
37 runtimes: &[
38 RuntimeSupport {
39 runtime: RuntimeKind::Cpu,
40 status: RuntimeStatus::Reference,
41 evidence: "dyadic_switches_and_reversal_enclose_frozen_physical_positions_across_layouts",
42 },
43 RuntimeSupport {
44 runtime: RuntimeKind::Cuda,
45 status: RuntimeStatus::Executed,
46 evidence: "selected_cuda_client_executes_controlled_gate_motion_and_complete_restart",
47 },
48 RuntimeSupport {
49 runtime: RuntimeKind::Wgpu,
50 status: RuntimeStatus::RejectedLacksF64,
51 evidence: "selected_wgpu_rejects_controlled_gate_f64_without_fallback",
52 },
53 ],
54 endpoints: &[],
55 regimes: &[],
56 sources: &[],
57 options: &[],
58 nested: &[ComponentId::OperatingControl, ComponentId::GateActuator],
59 attachable_to: &[ComponentId::SurfaceChannels],
60 unsupported: &[
61 unsupported(
62 "advanced-child",
63 UnsupportedReason::RejectedByAdmission,
64 "A control or actuator child with accepted intervals rejects; restore a composite snapshot instead.",
65 CONTROLLED_GATE_DOC,
66 ),
67 unsupported(
68 "foreign-structure-model",
69 UnsupportedReason::RejectedByAdmission,
70 "Children built on differing structure definitions reject.",
71 CONTROLLED_GATE_DOC,
72 ),
73 unsupported(
74 "mismatched-gate-subset",
75 UnsupportedReason::RejectedByAdmission,
76 "Controllers and actuators that do not bind the same ordered gates one to one reject.",
77 CONTROLLED_GATE_DOC,
78 ),
79 unsupported(
80 "calendar-mismatch",
81 UnsupportedReason::RejectedByAdmission,
82 "Initial, decision, target or terminal times that differ by F64 bits reject.",
83 CONTROLLED_GATE_DOC,
84 ),
85 unsupported(
86 "initial-target-mismatch",
87 UnsupportedReason::RejectedByAdmission,
88 "An initial command numerically different from the actuator's initial target rejects.",
89 CONTROLLED_GATE_DOC,
90 ),
91 unsupported(
92 "mechanical-dynamics",
93 UnsupportedReason::OutsideModel,
94 "No mechanical dynamics or native actuator parity.",
95 CONTROLLED_GATE_DOC,
96 ),
97 unsupported(
98 "hydraulic-feedback",
99 UnsupportedReason::OutsideModel,
100 "No continuous trigger completeness or endogenous hydraulic feedback.",
101 CONTROLLED_GATE_DOC,
102 ),
103 unsupported(
104 "pump-response",
105 UnsupportedReason::NotAttached,
106 "Pump response attaches through controlled pumps, not here.",
107 "docs/controlled-pumps.md",
108 ),
109 unsupported(
110 "accepted-hydraulic-transfer",
111 UnsupportedReason::NotAttached,
112 "Opening feeds structure proposals through operating sources; no accepted transfer or discharge enclosure.",
113 CONTROLLED_GATE_DOC,
114 ),
115 unsupported(
116 "gpu-numerical-qualification",
117 UnsupportedReason::Unqualified,
118 "CUDA runs execute, but only the CPU reference qualifies numerical accuracy.",
119 CONTROLLED_GATE_DOC,
120 ),
121 unsupported(
122 "measured-event-accuracy",
123 UnsupportedReason::Unqualified,
124 "No measured-event assessment establishes field accuracy.",
125 "docs/acceptance.md",
126 ),
127 ],
128 limits: &[
129 Limit {
130 id: "atomic-acceptance",
131 summary: "Both children accept together; a rejected or dropped candidate changes neither.",
132 doc: CONTROLLED_GATE_DOC,
133 },
134 Limit {
135 id: "target-separate-from-opening",
136 summary: "Requested targets and actual openings stay separate; flow proposals read actual opening only.",
137 doc: CONTROLLED_GATE_DOC,
138 },
139 Limit {
140 id: "binding-child-policies",
141 summary: "Child qualification timing, opening uncertainty and arrival windows stay binding.",
142 doc: CONTROLLED_GATE_DOC,
143 },
144 ],
145 summary: Summary {
146 equations: "sampled hysteresis targets driving ideal rate-limited gate opening",
147 method: "one common calendar, old target through the decision's left state, new command on its right, atomic child acceptance",
148 assessment: "selected analytical switching, reversal and restart cases; field accuracy remains unestablished",
149 },
150};
151
152pub fn controlled_gate_capabilities() -> &'static ComponentCapabilities {
156 &CONTROLLED_GATE
157}