@simulatte/webgpu 0.2.1 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/README.md +135 -108
- package/{API_CONTRACT.md → api-contract.md} +63 -3
- package/assets/fawn-icon-main-256.png +0 -0
- package/assets/package-surface-cube-snapshot.svg +14 -14
- package/compat-scope.md +46 -0
- package/headless-webgpu-comparison.md +3 -3
- package/layering-plan.md +259 -0
- package/native/doe_napi.c +110 -17
- package/package.json +28 -8
- package/prebuilds/darwin-arm64/doe_napi.node +0 -0
- package/prebuilds/darwin-arm64/libwebgpu_doe.dylib +0 -0
- package/prebuilds/darwin-arm64/metadata.json +5 -5
- package/prebuilds/linux-x64/doe_napi.node +0 -0
- package/prebuilds/linux-x64/libwebgpu_dawn.so +0 -0
- package/prebuilds/linux-x64/libwebgpu_doe.so +0 -0
- package/prebuilds/linux-x64/metadata.json +26 -0
- package/scripts/generate-readme-assets.js +2 -2
- package/src/bun-ffi.js +3 -2
- package/src/bun.js +2 -2
- package/src/compute.d.ts +161 -0
- package/src/compute.js +277 -0
- package/src/doe.d.ts +84 -0
- package/src/doe.js +275 -0
- package/src/full.d.ts +112 -0
- package/src/full.js +10 -0
- package/src/index.js +114 -15
- package/src/node-runtime.js +2 -2
- package/src/node.js +2 -2
- package/src/runtime_cli.js +3 -1
- package/support-contracts.md +339 -0
- package/zig-source-inventory.md +468 -0
- package/COMPAT_SCOPE.md +0 -32
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
# Proposed zig source inventory for core and full
|
|
2
|
+
|
|
3
|
+
Inventory status: `draft`
|
|
4
|
+
|
|
5
|
+
Scope:
|
|
6
|
+
|
|
7
|
+
- current `zig/src` source inventory for the future `core` / `full` split
|
|
8
|
+
- refactor planning only
|
|
9
|
+
- no runtime behavior changes
|
|
10
|
+
|
|
11
|
+
This document maps the current `zig/src` tree into four buckets:
|
|
12
|
+
|
|
13
|
+
1. `keep_in_core`
|
|
14
|
+
- can move into `core` with little or no semantic surgery
|
|
15
|
+
2. `move_to_full`
|
|
16
|
+
- clearly belongs in `full`
|
|
17
|
+
3. `needs_api_extraction`
|
|
18
|
+
- current file spans both contracts, or imports a mixed API/state layer, so
|
|
19
|
+
it cannot be moved cleanly yet
|
|
20
|
+
4. `ancillary_or_track_a`
|
|
21
|
+
- keep outside the `core` / `full` runtime split for now
|
|
22
|
+
|
|
23
|
+
Use this with:
|
|
24
|
+
|
|
25
|
+
- `support-contracts.md`
|
|
26
|
+
- `layering-plan.md`
|
|
27
|
+
|
|
28
|
+
## Reading rule
|
|
29
|
+
|
|
30
|
+
This is an extraction inventory, not a statement that the current file already
|
|
31
|
+
matches the target layer.
|
|
32
|
+
|
|
33
|
+
Current repo note:
|
|
34
|
+
|
|
35
|
+
- `zig/src/core/` and `zig/src/full/` now contain canonical implementations for the first extraction slices, not just staging directories
|
|
36
|
+
- root-path shims for migrated files are now real `pub usingnamespace` compatibility modules
|
|
37
|
+
- canonical command partition and dispatch now live under `zig/src/core/{command_partition.zig,command_dispatch.zig}` and `zig/src/full/{command_partition.zig,command_dispatch.zig}`
|
|
38
|
+
- canonical texture commands now live under `zig/src/core/resource/wgpu_texture_commands.zig`
|
|
39
|
+
- canonical sampler and surface commands now live under `zig/src/full/render/wgpu_sampler_commands.zig` and `zig/src/full/surface/wgpu_surface_commands.zig`
|
|
40
|
+
- `zig/src/wgpu_commands.zig`, `zig/src/wgpu_resources.zig`, and `zig/src/wgpu_extended_commands.zig` now remain at the root only as compatibility façades while callers continue to retarget
|
|
41
|
+
- `zig/src/webgpu_ffi.zig` still owns `WebGPUBackend` and remains the public runtime façade
|
|
42
|
+
|
|
43
|
+
Examples:
|
|
44
|
+
|
|
45
|
+
1. a file may eventually live in `core`, but still be marked
|
|
46
|
+
`needs_api_extraction` because it imports the current mixed `webgpu_ffi.zig`
|
|
47
|
+
state
|
|
48
|
+
2. a file may be `full` because it is clearly render/surface/lifecycle-only
|
|
49
|
+
3. a file may be `ancillary_or_track_a` because it serves drop-in ABI or Dawn
|
|
50
|
+
delegate lanes rather than the future package/runtime split
|
|
51
|
+
|
|
52
|
+
## Immediate extraction hotspots
|
|
53
|
+
|
|
54
|
+
These are the files that now carry the strongest remaining `core` / `full` bleed:
|
|
55
|
+
|
|
56
|
+
1. `zig/src/model.zig`
|
|
57
|
+
2. `zig/src/webgpu_ffi.zig`
|
|
58
|
+
3. `zig/src/main.zig`
|
|
59
|
+
4. `zig/src/execution.zig`
|
|
60
|
+
5. `zig/src/backend/metal/mod.zig`
|
|
61
|
+
6. `zig/src/backend/metal/metal_native_runtime.zig`
|
|
62
|
+
7. `zig/src/backend/vulkan/mod.zig`
|
|
63
|
+
8. `zig/src/backend/vulkan/native_runtime.zig`
|
|
64
|
+
9. `zig/src/backend/vulkan/vulkan_runtime_state.zig`
|
|
65
|
+
10. `zig/src/backend/d3d12/mod.zig`
|
|
66
|
+
|
|
67
|
+
The root command and resource files are no longer primary hotspots; they are compatibility façades over canonical `core` and `full` modules. The remaining extraction pressure is now on the public type/backend boundary and the backend roots.
|
|
68
|
+
|
|
69
|
+
## keep_in_core
|
|
70
|
+
|
|
71
|
+
### Parsing, trace, replay, quirk dispatch
|
|
72
|
+
|
|
73
|
+
Paths:
|
|
74
|
+
|
|
75
|
+
- `zig/src/command_json.zig`
|
|
76
|
+
- `zig/src/command_json_extra.zig`
|
|
77
|
+
- `zig/src/command_json_raw.zig`
|
|
78
|
+
- `zig/src/command_parse_helpers.zig`
|
|
79
|
+
- `zig/src/trace.zig`
|
|
80
|
+
- `zig/src/replay.zig`
|
|
81
|
+
- `zig/src/runtime.zig`
|
|
82
|
+
- `zig/src/quirk/mod.zig`
|
|
83
|
+
- `zig/src/quirk/quirk_actions.zig`
|
|
84
|
+
- `zig/src/quirk/quirk_json.zig`
|
|
85
|
+
- `zig/src/quirk/runtime.zig`
|
|
86
|
+
- `zig/src/quirk/toggle_registry.zig`
|
|
87
|
+
- `zig/src/quirk_json.zig`
|
|
88
|
+
|
|
89
|
+
Why:
|
|
90
|
+
|
|
91
|
+
- deterministic parsing, trace/replay, and quirk selection are shared runtime
|
|
92
|
+
foundations
|
|
93
|
+
- these files do not define render/surface ownership
|
|
94
|
+
|
|
95
|
+
### WGSL frontend, IR, and proof plumbing
|
|
96
|
+
|
|
97
|
+
Paths:
|
|
98
|
+
|
|
99
|
+
- `zig/src/doe_wgsl/ast.zig`
|
|
100
|
+
- `zig/src/doe_wgsl/emit_dxil.zig`
|
|
101
|
+
- `zig/src/doe_wgsl/emit_hlsl.zig`
|
|
102
|
+
- `zig/src/doe_wgsl/emit_msl.zig`
|
|
103
|
+
- `zig/src/doe_wgsl/emit_msl_ir.zig`
|
|
104
|
+
- `zig/src/doe_wgsl/emit_spirv.zig`
|
|
105
|
+
- `zig/src/doe_wgsl/ir.zig`
|
|
106
|
+
- `zig/src/doe_wgsl/ir_builder.zig`
|
|
107
|
+
- `zig/src/doe_wgsl/ir_validate.zig`
|
|
108
|
+
- `zig/src/doe_wgsl/lexer.zig`
|
|
109
|
+
- `zig/src/doe_wgsl/mod.zig`
|
|
110
|
+
- `zig/src/doe_wgsl/parser.zig`
|
|
111
|
+
- `zig/src/doe_wgsl/sema.zig`
|
|
112
|
+
- `zig/src/doe_wgsl/sema_attrs.zig`
|
|
113
|
+
- `zig/src/doe_wgsl/sema_body.zig`
|
|
114
|
+
- `zig/src/doe_wgsl/sema_helpers.zig`
|
|
115
|
+
- `zig/src/doe_wgsl/sema_types.zig`
|
|
116
|
+
- `zig/src/doe_wgsl/spirv_builder.zig`
|
|
117
|
+
- `zig/src/doe_wgsl/token.zig`
|
|
118
|
+
- `zig/src/doe_wgsl_msl.zig`
|
|
119
|
+
- `zig/src/lean_proof.zig`
|
|
120
|
+
- `zig/src/env_flags.zig`
|
|
121
|
+
- `zig/src/main_print.zig`
|
|
122
|
+
|
|
123
|
+
Why:
|
|
124
|
+
|
|
125
|
+
- the compiler frontend and proof-elimination hooks are shared foundations for
|
|
126
|
+
both compute-only and full headless surfaces
|
|
127
|
+
- stage-aware lowering can stay in `core`; `full` depends on it
|
|
128
|
+
|
|
129
|
+
### Shared backend policy and neutral helpers
|
|
130
|
+
|
|
131
|
+
Paths:
|
|
132
|
+
|
|
133
|
+
- `zig/src/backend/backend_errors.zig`
|
|
134
|
+
- `zig/src/backend/backend_ids.zig`
|
|
135
|
+
- `zig/src/backend/backend_policy.zig`
|
|
136
|
+
- `zig/src/backend/backend_selection.zig`
|
|
137
|
+
- `zig/src/backend/backend_telemetry.zig`
|
|
138
|
+
- `zig/src/backend/common/artifact_meta.zig`
|
|
139
|
+
- `zig/src/backend/common/errors.zig`
|
|
140
|
+
- `zig/src/backend/common/timing.zig`
|
|
141
|
+
|
|
142
|
+
Why:
|
|
143
|
+
|
|
144
|
+
- these files describe generic backend identity, timing, and error contracts
|
|
145
|
+
- they do not by themselves force render/surface ownership
|
|
146
|
+
|
|
147
|
+
### Compute-focused runtime shards
|
|
148
|
+
|
|
149
|
+
Paths:
|
|
150
|
+
|
|
151
|
+
- `zig/src/core/abi/wgpu_types.zig`
|
|
152
|
+
- `zig/src/core/abi/wgpu_loader.zig`
|
|
153
|
+
- `zig/src/core/compute/wgpu_commands_compute.zig`
|
|
154
|
+
- `zig/src/core/resource/wgpu_commands_copy.zig`
|
|
155
|
+
- `zig/src/core/resource/wgpu_resources.zig`
|
|
156
|
+
- `zig/src/core/resource/wgpu_texture_commands.zig`
|
|
157
|
+
- `zig/src/core/queue/wgpu_ffi_sync.zig`
|
|
158
|
+
- `zig/src/core/command_partition.zig`
|
|
159
|
+
- `zig/src/core/command_dispatch.zig`
|
|
160
|
+
- `zig/src/wgpu_p1_capability_procs.zig`
|
|
161
|
+
- `zig/src/wgpu_sandbox_guard.zig`
|
|
162
|
+
|
|
163
|
+
Why:
|
|
164
|
+
|
|
165
|
+
- these files are now the canonical compute, copy, texture, and queue slices for the extraction
|
|
166
|
+
- the command split is explicit instead of being hidden in one mixed top-level dispatcher
|
|
167
|
+
- ABI ownership now lives in `zig/src/core/abi/`; the legacy root `zig/src/wgpu_types.zig` and `zig/src/wgpu_loader.zig` compatibility façades have been retired. Root `zig/src/wgpu_commands.zig`, `zig/src/wgpu_resources.zig`, and `zig/src/wgpu_extended_commands.zig` remain temporary compatibility façades while callers finish retargeting.
|
|
168
|
+
|
|
169
|
+
### Full render / surface / lifecycle namespaces now physicalized
|
|
170
|
+
|
|
171
|
+
Paths:
|
|
172
|
+
|
|
173
|
+
- `zig/src/full/render/wgpu_render_assets.zig`
|
|
174
|
+
- `zig/src/full/render/wgpu_render_api.zig`
|
|
175
|
+
- `zig/src/full/render/wgpu_render_commands.zig`
|
|
176
|
+
- `zig/src/full/render/wgpu_render_draw_loops.zig`
|
|
177
|
+
- `zig/src/full/render/wgpu_render_indexing.zig`
|
|
178
|
+
- `zig/src/full/render/wgpu_render_p0.zig`
|
|
179
|
+
- `zig/src/full/render/wgpu_render_resources.zig`
|
|
180
|
+
- `zig/src/full/render/wgpu_render_types.zig`
|
|
181
|
+
- `zig/src/full/render/wgpu_sampler_commands.zig`
|
|
182
|
+
- `zig/src/full/render/wgpu_pipeline_layout_pls.zig`
|
|
183
|
+
- `zig/src/full/surface/wgpu_ffi_surface.zig`
|
|
184
|
+
- `zig/src/full/surface/wgpu_surface_procs.zig`
|
|
185
|
+
- `zig/src/full/surface/wgpu_surface_commands.zig`
|
|
186
|
+
- `zig/src/full/lifecycle/wgpu_async_diagnostics_command.zig`
|
|
187
|
+
- `zig/src/full/command_partition.zig`
|
|
188
|
+
- `zig/src/full/command_dispatch.zig`
|
|
189
|
+
|
|
190
|
+
Why:
|
|
191
|
+
|
|
192
|
+
- these files are now the canonical render, surface, and fuller lifecycle slices built on top of the shared runtime
|
|
193
|
+
- the top-level root files that still mention render or surface behavior are compatibility façades or the remaining public backend façade, not the canonical implementation homes
|
|
194
|
+
|
|
195
|
+
### D3D12 compute runtime candidates
|
|
196
|
+
|
|
197
|
+
Paths:
|
|
198
|
+
|
|
199
|
+
- `zig/src/backend/d3d12/d3d12_bridge.c`
|
|
200
|
+
- `zig/src/backend/d3d12/d3d12_bridge.h`
|
|
201
|
+
- `zig/src/backend/d3d12/d3d12_errors.zig`
|
|
202
|
+
- `zig/src/backend/d3d12/d3d12_native_runtime.zig`
|
|
203
|
+
- `zig/src/backend/d3d12/d3d12_native_runtime_stub.zig`
|
|
204
|
+
- `zig/src/backend/d3d12/d3d12_timing.zig`
|
|
205
|
+
|
|
206
|
+
Why:
|
|
207
|
+
|
|
208
|
+
- current D3D12 native runtime is still compute-first
|
|
209
|
+
- this is the cleanest backend candidate for an early `core` carve-out
|
|
210
|
+
|
|
211
|
+
### Backend adapter/device/queue and pure compute/copy/upload shards
|
|
212
|
+
|
|
213
|
+
Paths:
|
|
214
|
+
|
|
215
|
+
- `zig/src/backend/metal/metal_adapter.zig`
|
|
216
|
+
- `zig/src/backend/metal/metal_device.zig`
|
|
217
|
+
- `zig/src/backend/metal/metal_errors.zig`
|
|
218
|
+
- `zig/src/backend/metal/metal_instance.zig`
|
|
219
|
+
- `zig/src/backend/metal/metal_queue.zig`
|
|
220
|
+
- `zig/src/backend/metal/metal_sync.zig`
|
|
221
|
+
- `zig/src/backend/metal/metal_timing.zig`
|
|
222
|
+
- `zig/src/backend/metal/commands/compute_encode.zig`
|
|
223
|
+
- `zig/src/backend/metal/commands/copy_encode.zig`
|
|
224
|
+
- `zig/src/backend/metal/pipeline/msl_compile_runner.zig`
|
|
225
|
+
- `zig/src/backend/metal/pipeline/shader_artifact_manifest.zig`
|
|
226
|
+
- `zig/src/backend/metal/pipeline/wgsl_ingest.zig`
|
|
227
|
+
- `zig/src/backend/metal/pipeline/wgsl_to_msl_runner.zig`
|
|
228
|
+
- `zig/src/backend/metal/upload/staging_ring.zig`
|
|
229
|
+
- `zig/src/backend/metal/upload/upload_path.zig`
|
|
230
|
+
- `zig/src/backend/vulkan/vulkan_adapter.zig`
|
|
231
|
+
- `zig/src/backend/vulkan/vulkan_device.zig`
|
|
232
|
+
- `zig/src/backend/vulkan/vulkan_errors.zig`
|
|
233
|
+
- `zig/src/backend/vulkan/vulkan_instance.zig`
|
|
234
|
+
- `zig/src/backend/vulkan/vulkan_queue.zig`
|
|
235
|
+
- `zig/src/backend/vulkan/vulkan_sync.zig`
|
|
236
|
+
- `zig/src/backend/vulkan/vulkan_timing.zig`
|
|
237
|
+
- `zig/src/backend/vulkan/commands/compute_encode.zig`
|
|
238
|
+
- `zig/src/backend/vulkan/commands/copy_encode.zig`
|
|
239
|
+
- `zig/src/backend/vulkan/pipeline/shader_artifact_manifest.zig`
|
|
240
|
+
- `zig/src/backend/vulkan/pipeline/spirv_opt_runner.zig`
|
|
241
|
+
- `zig/src/backend/vulkan/pipeline/wgsl_ingest.zig`
|
|
242
|
+
- `zig/src/backend/vulkan/pipeline/wgsl_to_spirv_runner.zig`
|
|
243
|
+
- `zig/src/backend/vulkan/upload/staging_ring.zig`
|
|
244
|
+
- `zig/src/backend/vulkan/upload/upload_path.zig`
|
|
245
|
+
|
|
246
|
+
Why:
|
|
247
|
+
|
|
248
|
+
- these files are already biased toward adapter/device discovery, compute/copy,
|
|
249
|
+
shader ingestion, and upload path control
|
|
250
|
+
- they are better starting points for `core` than the monolithic backend roots
|
|
251
|
+
|
|
252
|
+
## move_to_full
|
|
253
|
+
|
|
254
|
+
### Render command/model surface
|
|
255
|
+
|
|
256
|
+
Paths:
|
|
257
|
+
|
|
258
|
+
- `zig/src/doe_render_native.zig`
|
|
259
|
+
- `zig/src/wgpu_render_api.zig`
|
|
260
|
+
- `zig/src/wgpu_render_assets.zig`
|
|
261
|
+
- `zig/src/wgpu_render_commands.zig`
|
|
262
|
+
- `zig/src/wgpu_render_draw_loops.zig`
|
|
263
|
+
- `zig/src/wgpu_render_indexing.zig`
|
|
264
|
+
- `zig/src/wgpu_render_p0.zig`
|
|
265
|
+
- `zig/src/wgpu_render_resources.zig`
|
|
266
|
+
- `zig/src/wgpu_render_types.zig`
|
|
267
|
+
- `zig/src/backend/metal/commands/render_encode.zig`
|
|
268
|
+
- `zig/src/backend/vulkan/commands/render_encode.zig`
|
|
269
|
+
|
|
270
|
+
Why:
|
|
271
|
+
|
|
272
|
+
- these files are explicitly render-pipeline, render-pass, draw, or render
|
|
273
|
+
resource modules
|
|
274
|
+
- they should leave the shared layer first
|
|
275
|
+
|
|
276
|
+
### Surface and presentation surface
|
|
277
|
+
|
|
278
|
+
Paths:
|
|
279
|
+
|
|
280
|
+
- `zig/src/wgpu_ffi_surface.zig`
|
|
281
|
+
- `zig/src/wgpu_surface_procs.zig`
|
|
282
|
+
- `zig/src/backend/metal/surface/present.zig`
|
|
283
|
+
- `zig/src/backend/metal/surface/surface_configure.zig`
|
|
284
|
+
- `zig/src/backend/metal/surface/surface_create.zig`
|
|
285
|
+
- `zig/src/backend/vulkan/surface/present.zig`
|
|
286
|
+
- `zig/src/backend/vulkan/surface/surface_configure.zig`
|
|
287
|
+
- `zig/src/backend/vulkan/surface/surface_create.zig`
|
|
288
|
+
|
|
289
|
+
Why:
|
|
290
|
+
|
|
291
|
+
- these are full-only or browser-adjacent headless presentation concerns
|
|
292
|
+
- `core` should not own surface lifecycle or present semantics
|
|
293
|
+
|
|
294
|
+
### Lifecycle and async render diagnostics
|
|
295
|
+
|
|
296
|
+
Paths:
|
|
297
|
+
|
|
298
|
+
- `zig/src/wgpu_async_diagnostics_command.zig`
|
|
299
|
+
- `zig/src/wgpu_async_pixel_local_storage.zig`
|
|
300
|
+
- `zig/src/wgpu_async_procs.zig`
|
|
301
|
+
- `zig/src/wgpu_p2_lifecycle_procs.zig`
|
|
302
|
+
|
|
303
|
+
Why:
|
|
304
|
+
|
|
305
|
+
- these files are tied to async render pipeline creation, shader compilation
|
|
306
|
+
info, error scopes, lifecycle add-ref paths, or pixel-local-storage
|
|
307
|
+
- they belong with `full` object-model and render/lifecycle semantics
|
|
308
|
+
|
|
309
|
+
## needs_api_extraction
|
|
310
|
+
|
|
311
|
+
### Top-level command/type/runtime boundary
|
|
312
|
+
|
|
313
|
+
Paths:
|
|
314
|
+
|
|
315
|
+
- `zig/src/model.zig`
|
|
316
|
+
- `zig/src/main.zig`
|
|
317
|
+
- `zig/src/execution.zig`
|
|
318
|
+
- `zig/src/webgpu_ffi.zig`
|
|
319
|
+
- `zig/src/wgpu_types_procs.zig`
|
|
320
|
+
- `zig/src/wgpu_texture_procs.zig`
|
|
321
|
+
- `zig/src/wgpu_capability_runtime.zig`
|
|
322
|
+
- `zig/src/wgpu_p0_procs.zig`
|
|
323
|
+
- `zig/src/wgpu_p1_resource_table_procs.zig`
|
|
324
|
+
- `zig/src/doe_device_caps.zig`
|
|
325
|
+
|
|
326
|
+
Why:
|
|
327
|
+
|
|
328
|
+
- the root command and resource files no longer contain the canonical behavior; they now serve as compatibility façades over the canonical `core` and `full` modules
|
|
329
|
+
- the remaining mixed state is now concentrated in the combined command model, the public `WebGPUBackend` façade, and the proc/capability ledger around it
|
|
330
|
+
- `webgpu_ffi.zig` still owns `WebGPUBackend`, so this is the load-bearing public boundary that still needs deeper extraction
|
|
331
|
+
|
|
332
|
+
### Legacy monolithic native ABI path
|
|
333
|
+
|
|
334
|
+
Paths:
|
|
335
|
+
|
|
336
|
+
- `zig/src/doe_wgpu_native.zig`
|
|
337
|
+
- `zig/src/doe_compute_ext_native.zig`
|
|
338
|
+
- `zig/src/doe_compute_fast.zig`
|
|
339
|
+
- `zig/src/doe_shader_native.zig`
|
|
340
|
+
|
|
341
|
+
Why:
|
|
342
|
+
|
|
343
|
+
- these files are sharded out of the old monolithic Doe native ABI, but they
|
|
344
|
+
still import or extend `doe_wgpu_native.zig`
|
|
345
|
+
- they cannot become a clean `core` layer until the legacy ABI itself is split
|
|
346
|
+
or retired
|
|
347
|
+
|
|
348
|
+
### Shared backend interface and capability model
|
|
349
|
+
|
|
350
|
+
Paths:
|
|
351
|
+
|
|
352
|
+
- `zig/src/backend/backend_iface.zig`
|
|
353
|
+
- `zig/src/backend/backend_registry.zig`
|
|
354
|
+
- `zig/src/backend/backend_runtime.zig`
|
|
355
|
+
- `zig/src/backend/common/capabilities.zig`
|
|
356
|
+
- `zig/src/backend/common/command_info.zig`
|
|
357
|
+
- `zig/src/backend/common/command_requirements.zig`
|
|
358
|
+
|
|
359
|
+
Why:
|
|
360
|
+
|
|
361
|
+
- these files currently assume a single mixed command set spanning both compute
|
|
362
|
+
and full-only operations
|
|
363
|
+
- they need separate `core` and `full` command/capability views
|
|
364
|
+
|
|
365
|
+
### Backend roots still owning mixed state
|
|
366
|
+
|
|
367
|
+
Paths:
|
|
368
|
+
|
|
369
|
+
- `zig/src/backend/d3d12/mod.zig`
|
|
370
|
+
- `zig/src/backend/metal/metal_bridge.h`
|
|
371
|
+
- `zig/src/backend/metal/metal_bridge.m`
|
|
372
|
+
- `zig/src/backend/metal/metal_native_runtime.zig`
|
|
373
|
+
- `zig/src/backend/metal/metal_native_runtime_stub.zig`
|
|
374
|
+
- `zig/src/backend/metal/metal_runtime_state.zig`
|
|
375
|
+
- `zig/src/backend/metal/mod.zig`
|
|
376
|
+
- `zig/src/backend/metal/pipeline/pipeline_cache.zig`
|
|
377
|
+
- `zig/src/backend/metal/procs/proc_export.zig`
|
|
378
|
+
- `zig/src/backend/metal/procs/proc_table.zig`
|
|
379
|
+
- `zig/src/backend/metal/resources/bind_group.zig`
|
|
380
|
+
- `zig/src/backend/metal/resources/buffer.zig`
|
|
381
|
+
- `zig/src/backend/metal/resources/resource_table.zig`
|
|
382
|
+
- `zig/src/backend/metal/resources/sampler.zig`
|
|
383
|
+
- `zig/src/backend/metal/resources/texture.zig`
|
|
384
|
+
- `zig/src/backend/vulkan/mod.zig`
|
|
385
|
+
- `zig/src/backend/vulkan/native_runtime.zig`
|
|
386
|
+
- `zig/src/backend/vulkan/native_runtime_stub.zig`
|
|
387
|
+
- `zig/src/backend/vulkan/vulkan_runtime_state.zig`
|
|
388
|
+
- `zig/src/backend/vulkan/pipeline/pipeline_cache.zig`
|
|
389
|
+
- `zig/src/backend/vulkan/procs/proc_export.zig`
|
|
390
|
+
- `zig/src/backend/vulkan/procs/proc_table.zig`
|
|
391
|
+
- `zig/src/backend/vulkan/resources/bind_group.zig`
|
|
392
|
+
- `zig/src/backend/vulkan/resources/buffer.zig`
|
|
393
|
+
- `zig/src/backend/vulkan/resources/resource_table.zig`
|
|
394
|
+
- `zig/src/backend/vulkan/resources/sampler.zig`
|
|
395
|
+
- `zig/src/backend/vulkan/resources/texture.zig`
|
|
396
|
+
|
|
397
|
+
Why:
|
|
398
|
+
|
|
399
|
+
- these files either:
|
|
400
|
+
- directly own mixed compute/render/surface runtime state, or
|
|
401
|
+
- are thin wrappers over a mixed runtime-state module, or
|
|
402
|
+
- export one combined backend proc surface
|
|
403
|
+
- they are the main files that require composition-based API extraction
|
|
404
|
+
|
|
405
|
+
## ancillary_or_track_a
|
|
406
|
+
|
|
407
|
+
### Drop-in ABI and browser-lane surfaces
|
|
408
|
+
|
|
409
|
+
Paths:
|
|
410
|
+
|
|
411
|
+
- `zig/src/dropin/dropin_abi_procs.zig`
|
|
412
|
+
- `zig/src/dropin/dropin_behavior_policy.zig`
|
|
413
|
+
- `zig/src/dropin/dropin_build_info.zig`
|
|
414
|
+
- `zig/src/dropin/dropin_diagnostics.zig`
|
|
415
|
+
- `zig/src/dropin/dropin_router.zig`
|
|
416
|
+
- `zig/src/dropin/dropin_symbol_ownership.zig`
|
|
417
|
+
- `zig/src/wgpu_dropin_ext_a.zig`
|
|
418
|
+
- `zig/src/wgpu_dropin_ext_b.zig`
|
|
419
|
+
- `zig/src/wgpu_dropin_ext_c.zig`
|
|
420
|
+
- `zig/src/wgpu_dropin_lib.zig`
|
|
421
|
+
- `zig/src/backend/dawn_delegate_backend.zig`
|
|
422
|
+
|
|
423
|
+
Why:
|
|
424
|
+
|
|
425
|
+
- these files serve drop-in ABI, Dawn delegate, and browser-lane compatibility
|
|
426
|
+
concerns
|
|
427
|
+
- they are not the right place to define the `core` / `full` package boundary
|
|
428
|
+
|
|
429
|
+
### Generated artifacts and maintenance scripts
|
|
430
|
+
|
|
431
|
+
Paths:
|
|
432
|
+
|
|
433
|
+
- `zig/src/bench/out/shader-artifacts/vulkan-manifest-1.json`
|
|
434
|
+
- `zig/src/bench/out/shader-artifacts/vulkan-manifest-2.json`
|
|
435
|
+
- `zig/src/fix_usingnamespace.py`
|
|
436
|
+
- `zig/src/update_webgpu_ffi.py`
|
|
437
|
+
|
|
438
|
+
Why:
|
|
439
|
+
|
|
440
|
+
- these are generated artifacts or maintenance helpers, not runtime-layer
|
|
441
|
+
modules
|
|
442
|
+
- the manifest JSON files should not stay under `zig/src` long-term
|
|
443
|
+
|
|
444
|
+
## Recommended first extraction sequence
|
|
445
|
+
|
|
446
|
+
1. shrink the remaining public façade boundary:
|
|
447
|
+
- `model.zig`
|
|
448
|
+
- `webgpu_ffi.zig`
|
|
449
|
+
- `main.zig`
|
|
450
|
+
- `execution.zig`
|
|
451
|
+
2. retire root compatibility façades after callers stop importing them:
|
|
452
|
+
- `wgpu_commands.zig`
|
|
453
|
+
- `wgpu_resources.zig`
|
|
454
|
+
- `wgpu_extended_commands.zig`
|
|
455
|
+
3. split backend roots from backend shards:
|
|
456
|
+
- `backend/metal/mod.zig`
|
|
457
|
+
- `backend/metal/metal_native_runtime.zig`
|
|
458
|
+
- `backend/vulkan/mod.zig`
|
|
459
|
+
- `backend/vulkan/native_runtime.zig`
|
|
460
|
+
- `backend/vulkan/vulkan_runtime_state.zig`
|
|
461
|
+
- `backend/d3d12/mod.zig`
|
|
462
|
+
4. split tests, Lean proofs, and coverage ledgers to mirror the runtime boundary
|
|
463
|
+
|
|
464
|
+
## Sanity rule for future edits
|
|
465
|
+
|
|
466
|
+
If a patch adds new render/surface/lifecycle state to any file listed above
|
|
467
|
+
under `keep_in_core`, the patch should be treated as boundary regression unless
|
|
468
|
+
the inventory and support contracts are updated in the same change.
|
package/COMPAT_SCOPE.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Compatibility Scope: what we actually need
|
|
2
|
-
|
|
3
|
-
This note narrows optional parity work to concrete integration value.
|
|
4
|
-
|
|
5
|
-
## Required now
|
|
6
|
-
|
|
7
|
-
1. Stable command/trace orchestration for benchmark and CI pipelines.
|
|
8
|
-
2. Reliable wrappers for:
|
|
9
|
-
- Doe native bench runs
|
|
10
|
-
- Dawn-vs-Doe compare runs
|
|
11
|
-
3. Deterministic artifact paths and non-zero exit-code propagation.
|
|
12
|
-
4. Minimal in-process provider surface for Node consumers:
|
|
13
|
-
- `create(args?)`
|
|
14
|
-
- `globals`
|
|
15
|
-
- `requestAdapter`/`requestDevice` convenience helpers
|
|
16
|
-
- `setupGlobals` for `navigator.gpu` + enum bootstrap
|
|
17
|
-
|
|
18
|
-
## Optional later (only when demanded by integrations)
|
|
19
|
-
|
|
20
|
-
1. Minimal constants compatibility:
|
|
21
|
-
- only constants required by real integrations, not full WebGPU enum surface.
|
|
22
|
-
2. Provider-module swap support for non-default backends beyond `webgpu`.
|
|
23
|
-
|
|
24
|
-
## Not planned by default
|
|
25
|
-
|
|
26
|
-
1. Full `navigator.gpu` browser-parity behavior in Node.
|
|
27
|
-
2. Full object lifetime/event parity (`device lost`, full error scopes, full mapping semantics).
|
|
28
|
-
3. Broad drop-in support for arbitrary npm packages expecting complete `webgpu` behavior.
|
|
29
|
-
|
|
30
|
-
Decision rule:
|
|
31
|
-
|
|
32
|
-
- Add parity features only after a concrete integration requirement is blocked by a missing capability and cannot be addressed by the existing bridge/CLI contract.
|