Options 与条件
行为与约束
option 的 id/type/default/impact 是权威定义;name/description 只用于展示。类型为 boolean、integer、number、string,default 与 override 必须同类型并满足 min/max 或 allowed。JSON boolean 不是整数;字符串枚举值区分大小写。范围和 allowed 的支持组合见完整 Schema,不把省略的 min/max 推断成零。
impact 为 uniform、program、pipeline、resources,声明改动会影响哪一层重建。它不是“永远免重编译”的承诺:数据、defines、资源及活动分支依赖仍需验证。UI 不能再次定义类型、硬范围、默认值或 impact。
Pass 的 enabled 是显式开关;enabledWhen、资源 binding/semantic/service 条件等使用 option 加 equals 或 oneOf。每个条件值先通过被引用 option 的类型及范围校验,条件数组共同约束活动性。设置 UI 使用不同的 equals/notEquals/in 条件合同,不应混写。
离线图需要指定与目标运行一致的 options/capabilities。关闭 Pass 后检查活动的 Program、Resource、Service 与前后依赖闭包,不能只看声明节点仍在图中就断言它仍分配。未满足依赖或非法条件在加载/解析阶段失败;不会靠执行时跳过来掩盖错误。
自动生成的 v5 结构
必需性只针对所展示的对象/分支。Schema 没写 default 不表示运行时没有默认值。完整定义保留条件规则;Loader 另行解析 ID、所有权、预算及设备约束。
option · v5
| 字段 / 分支 | 本对象必需性 | 结构约束 |
|---|---|---|
allowed | optional here | type="array"; minItems=1; uniqueItems=true; items=#/$defs/optionScalar |
default | required | $ref="#/$defs/optionScalar" |
description | optional here | type="string" |
id | required | $ref="#/$defs/identifier" |
impact | required | type="array"; uniqueItems=true |
max | optional here | type="number" |
min | optional here | type="number" |
name | optional here | type="string" |
type | required | enum=["boolean","integer","number","string"] |
完整结构规则: #/$defs/option
{
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "boolean"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"allowed": {
"items": {
"type": "boolean"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"default": {
"type": "boolean"
},
"max": {
"not": {}
},
"min": {
"not": {}
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "integer"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"allowed": {
"items": {
"type": "integer"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"default": {
"type": "integer"
},
"max": {
"type": "integer"
},
"min": {
"type": "integer"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "number"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"allowed": {
"items": {
"type": "number"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"default": {
"type": "number"
},
"max": {
"type": "number"
},
"min": {
"type": "number"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "string"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"allowed": {
"items": {
"type": "string"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"default": {
"type": "string"
},
"max": {
"not": {}
},
"min": {
"not": {}
}
}
}
},
{
"not": {
"required": [
"allowed",
"min"
]
}
},
{
"not": {
"required": [
"allowed",
"max"
]
}
},
{
"oneOf": [
{
"required": [
"min",
"max"
]
},
{
"not": {
"anyOf": [
{
"required": [
"min"
]
},
{
"required": [
"max"
]
}
]
}
}
]
}
],
"properties": {
"allowed": {
"items": {
"$ref": "#/$defs/optionScalar"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"default": {
"$ref": "#/$defs/optionScalar"
},
"description": {
"type": "string"
},
"id": {
"$ref": "#/$defs/identifier"
},
"impact": {
"items": {
"enum": [
"uniform",
"program",
"pipeline",
"resources"
]
},
"type": "array",
"uniqueItems": true
},
"max": {
"type": "number"
},
"min": {
"type": "number"
},
"name": {
"type": "string"
},
"type": {
"enum": [
"boolean",
"integer",
"number",
"string"
]
}
},
"required": [
"id",
"type",
"default",
"impact"
],
"type": "object"
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
optionScalar · v5
type=["boolean","integer","number","string"]
完整结构规则: #/$defs/optionScalar
{
"type": [
"boolean",
"integer",
"number",
"string"
]
}2
3
4
5
6
7
8
condition · v5
| 字段 / 分支 | 本对象必需性 | 结构约束 |
|---|---|---|
equals | optional here | $ref="#/$defs/optionScalar" |
oneOf | optional here | type="array"; minItems=1; uniqueItems=true; items=#/$defs/optionScalar |
option | required | $ref="#/$defs/identifier" |
完整结构规则: #/$defs/condition
{
"additionalProperties": false,
"allOf": [
{
"oneOf": [
{
"required": [
"equals"
]
},
{
"required": [
"oneOf"
]
}
]
}
],
"properties": {
"equals": {
"$ref": "#/$defs/optionScalar"
},
"oneOf": {
"items": {
"$ref": "#/$defs/optionScalar"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"option": {
"$ref": "#/$defs/identifier"
}
},
"required": [
"option"
],
"type": "object"
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
完整示例
来源与机器记录
字段归属清单 · Schema v5 · Catalog v2 · Completion v2
schema-v3 · schema-v4 · schema-v5 · completion-v1 · completion-v2 · temporal · settings-guide ·