Repository navigation
feat(gpu): typed dependency graph and nonempty fluid/ocean Metal+WGSL kernels (#812) - #1407
Merged
Merged
Conversation
This was referenced Oct 6, 2026
godofecht
force-pushed
the
feat/812-typed-graph-rebased
branch
from
October 7, 2026 13:38
1aeec4e to
9b3c4c3
Compare
godofecht
marked this pull request as ready for review
October 7, 2026 13:39
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
…odules gpu_stage_codegen reassigned immutable lets (components, uv_type, tex_type, uv_expr), so the strict check failed and ./flow test-lang had never run test_gpu_stage_codegen. They are now let mut, and the struct fields carry commas like the rest of the stdlib. Added coverage, nav and stdlib-map entries for gpu_resource_types and gpu_stage_codegen, regenerated stdlib-api.md and the LSP completion golden. Two comments reworded for the prose hook (string.flow matches #1401, #1406, #1407).
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 7, 2026
godofecht
force-pushed
the
feat/812-typed-graph-rebased
branch
from
October 7, 2026 22:45
9b3c4c3 to
12881de
Compare
godofecht
enabled auto-merge
October 7, 2026 22:45
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #812. Does not close it. Rebuilds the GPU graph work of the closed #1385 on current main, without its FFI changes (those landed in #1352).
Change
lib/stdlib/gpu_graph.flow: a typed resource and pass graph with storage buffers and textures, explicit access, transient lifetimes, ping-pong resources, compute and render passes. Validation covers conflicting slots, same-pass read/write hazards, transient-before-write, ping-pong aliasing, overflowing launch sizes, workgroup memory and barrier prerequisites, and formats and byte sizes. Dependency derivation fails at its 32-edge capacity instead of truncating.lib/stdlib/gpu_graph_kernels.flow: WGSL and Metal bodies for the fluid passes (advect, curl, vorticity, divergence, pressure, projection, dye, display) and the ocean passes (synthetic spectrum, 64-point inverse DFT on rows and columns, displacement, normals, foam, present). Unknown kernels emit nothing.lib/stdlib/gpu_graph_export.flowandgpu-graph-host.mjs: a JSON export and a WebGPU host,runFlowWebGpuGraph, that submits the passes in dependency order.docs/library/gpu-graph.md, examplesfluid.flow,fft_ocean.flowand the two export programs.Changed in this rebase:
tests/lang/test_gpu_graph.flowdeclaredp0twice in one scope, so the strict check failed and./flow test-langhad never run it. Renamed; the missing diagnostic is filed as flowc: duplicate let in one scope fails the strict check with no diagnostic #1434.gpu_graphandgpu_tensor(feat(gpu): real Metal tensor model kernels on current main (#814) #1406) both exportedGPU_ACCESS_READ,_WRITEand_READ_WRITE. A program cannot import two modules that export the same const, so the graph's are nowGPU_GRAPH_ACCESS_*.stdlib-api.mdand the LSP completion golden, added the matching class totests/tools/lsp/ACCEPTED.md, and rewrote the Backends section ofgpu-graph.mdplainly.These are generated kernels and a host. Nothing here compiles them on Metal or compares rendered output with vgpu references.
Evidence
Rebased onto main e2205a7.
./flow test-lang275/0, includingtest_gpu_graph../flow runoffluid.flow,fft_ocean.flowandexport_fluid_graph.flow: exit 0.node --test tests/webgpu/graph-host.test.mjs: 4/4 (mocked device; feat(webgpu): execute chained Flow kernels over persistent device resources (#814) #1408'swebgpu_hosts.flowruns it once both land).gen_stdlib_docs --check,doc_coverage,wiki_nav,doc_links: clean../flow tool tests/tools/lsp/run.flow: 9/9../flow test-runtime34/0../flow tool tests/cli/run.flow152 passed, 2 failed (jit_hello,test_mlir: golden drift on main).A real-device run was tried in Deno (Metal backend). The host requires the
readonly_and_readwrite_storage_texturesWGSL feature, and Deno 2.7 does not exposewgslLanguageFeatures, so the graph host could not run there. It needs a browser with that feature.Merge notes
stdlib-api.mdand the LSP completion golden are generated: after any other stdlib PR lands, rerun./flow tool gen_stdlib_docsand./flow tool tests/tools/lsp/run.flow --update.webgpu-host.jsexport line conflicts trivially with feat(gpu): typed texture, sampler and shader-interface prevalidation (#811) #1405 and feat(webgpu): execute chained Flow kernels over persistent device resources (#814) #1408: keep all lines.ACCEPTED.mdclass 9 text is identical in feat(gpu): typed texture, sampler and shader-interface prevalidation (#811) #1405, feat(gpu): real Metal tensor model kernels on current main (#814) #1406 and feat(gpu): typed dependency graph and nonempty fluid/ocean Metal+WGSL kernels (#812) #1407, so it merges cleanly.