Skip to content

gpu: add typed render/compute graph - #1385

Closed
godofecht wants to merge 21 commits into
mainfrom
gpu-graph-fix-6476792437696004110
Closed

godofecht wants to merge 21 commits into
mainfrom
gpu-graph-fix-6476792437696004110

Conversation

@godofecht

@godofecht godofecht commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Acceptance status (2026-10-06): partial. Implemented a real f32 GPU copy operation, dual shader emission, WebGPU host adapter, browser demo and actual-source mock tests (6/6 checks). The library does not yet execute the fluid/ocean numerical algorithms on Metal/WebGPU. Browser mock tests do not demonstrate live hardware parity; compiler test suite and real device runs remain pending, as does the old branch's merge-conflict resolution. This draft must not automatically close #812.


This PR adds a backend-independent intermediate representation for multi-pass GPU programs, which validates resource hazards before codegen. Specifically:

  • Added compute dispatch dimensions, storage textures/buffers, ping-pong resources, workgroup memory/barriers, transient resources, and explicit read/write access modeling in stdlib/gpu_graph.flow.
  • Validation is implemented to explicitly track and safely mitigate R/W aliasing bounds errors across resources. Dependency graph edge bindings are deterministically computed on validation.
  • Emits an actual f32 copy kernel and correct corresponding reflection for Metal/WGSL. Fluid and FFT-ocean graph builders still lack numerical executable shaders, and their conformance cases now report UNSUPPORTED.
  • Includes thorough runtime tests for graph API semantics in tests/lang/test_gpu_graph.flow.

Part of #812
Supersedes #1362


PR created automatically by Jules for task 6476792437696004110 started by @godofecht

Closes #812

Builds on and supersedes #1362.

Co-authored-by: godofecht <[email protected]>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Closes #812

Builds on and supersedes #1362.

Co-authored-by: godofecht <[email protected]>
@godofecht
godofecht marked this pull request as draft October 6, 2026 18:31
@godofecht

Copy link
Copy Markdown
Contributor Author

Closing in favour of #1407, which rebuilt this branch's GPU graph work on current main: the typed resource and pass graph, hazard validation, dependency derivation, and fluid and ocean kernels emitted for both Metal and WGSL, with tests/lang/test_gpu_graph.flow and a mocked WebGPU host test.

The other half of this branch, the FFI boundary audit (registry/packages/ffi/src/boundary_audit.flow, docs/language/ffi-boundary-audit.md, tests/lang/test_ffi_boundary_audit.flow, benchmarks/micro/ffi_breakeven.flow), is already on main through #1352.

Not carried: the single f32 copy-graph demo (examples/gpu/vgpu/copy_graph.flow, site/wasm-crossings/gpu/copy-graph.html, gpu-graph-copy.mjs and its mock test) and this branch's rewrite of webgpu-host.js. #1407's gpu-graph-host.mjs runs exported graphs in general, so the copy case is a subset of it. The branch also conflicts with main.

@godofecht godofecht closed this Oct 7, 2026
@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing in favour of #1407, which rebuilt this branch's GPU graph work on current main: the typed resource and pass graph, hazard validation, dependency derivation, and fluid and ocean kernels emitted for both Metal and WGSL, with tests/lang/test_gpu_graph.flow and a mocked WebGPU host test.

The other half of this branch, the FFI boundary audit (registry/packages/ffi/src/boundary_audit.flow, docs/language/ffi-boundary-audit.md, tests/lang/test_ffi_boundary_audit.flow, benchmarks/micro/ffi_breakeven.flow), is already on main through #1352.

Not carried: the single f32 copy-graph demo (examples/gpu/vgpu/copy_graph.flow, site/wasm-crossings/gpu/copy-graph.html, gpu-graph-copy.mjs and its mock test) and this branch's rewrite of webgpu-host.js. #1407's gpu-graph-host.mjs runs exported graphs in general, so the copy case is a subset of it. The branch also conflicts with main.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

@godofecht
godofecht deleted the gpu-graph-fix-6476792437696004110 branch October 12, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[gpu] Add typed render/compute graph with storage textures and hazard checks

1 participant