Skip to content

feat(gpu): typed texture, sampler and shader-interface prevalidation (#811) - #1405

Merged
godofecht merged 1 commit into
mainfrom
feat/811-gpu-resource-descriptor-contract
Oct 8, 2026
Merged

godofecht merged 1 commit into
mainfrom
feat/811-gpu-resource-descriptor-contract

Conversation

@godofecht

@godofecht godofecht commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Part of #811. Does not close it.

Change

  • lib/stdlib/gpu_resource_types.flow: typed texture, sampler, vertex-attribute and varying descriptors with checks for cube, MSAA, depth, format, usage and dimensions.
  • lib/stdlib/gpu_stage_codegen.flow: draw descriptors (indexed and instanced, index-buffer capacity), render targets, and WGSL and Metal emission of a vertex position fetch and fragment texture sample from a validated descriptor.
  • gpu-sampled-draw.mjs and renderFlowSampledDraw: a WebGPU host that uploads the texture, sampler, vertex and index buffers, submits indexed and instanced draws with 1x or 4x MSAA and optional depth32f, and reads back RGBA8. sampled-quad.html is a browser demo; tools/gpu_graph/export_sampled.mjs exports the Flow-emitted shaders for it.
  • Tests: tests/lang/test_gpu_resource_types.flow, tests/lang/test_gpu_stage_codegen.flow, tests/webgpu/sampled-draw.test.mjs.

Changed in this rebase:

Evidence

Rebased onto main e2205a7.

  • Real device: the WGSL that examples/gpu/vgpu/sampled_quad.flow emits, drawn through renderFlowSampledDraw in Deno 2.7 (--unstable-webgpu, Metal backend on Apple silicon), 64x36 target, 2 instances, depth on: center pixel 13,113,211,255 equals the reference texel at 1x and at 4x MSAA. The script is a one-off and is not committed, since CI has no GPU.
  • ./flow test-lang 276/0, including both new tests.
  • node --test tests/webgpu/sampled-draw.test.mjs: 6/6 (mocked device; feat(webgpu): execute chained Flow kernels over persistent device resources (#814) #1408's webgpu_hosts.flow runs it once both land).
  • gen_stdlib_docs --check, doc_coverage, wiki_nav, doc_links: clean. ./flow tool tests/tools/run.flow: all pass, LSP 9/9.
  • ./flow test-runtime 34/0. ./flow tool tests/cli/run.flow 152 passed, 2 failed (jit_hello, test_mlir: golden drift on main).

Not covered: compiling the Metal source on a device, importing arbitrary Flow render-stage declarations, and the vgpu instanced, geometry, environment and material scenes.

Merge notes

…811)

Rebuilt on main as one commit. Conflicts resolved per hunk: both
webgpu-host.js copies keep the kernel-chain, graph-host and sampled-draw
exports; appendix-d's GPU row lists the graph and the #811 modules;
string.flow keeps main's comment wording. stdlib-api.md and the LSP
completion golden were regenerated. The gpu crossing goldens ship
gpu-sampled-draw.mjs, which webgpu-host.js now re-exports. Two doc
sentences and the sampled-quad page title were reworded for the prose
hook.
@godofecht
godofecht force-pushed the feat/811-gpu-resource-descriptor-contract branch from c7625a0 to 96cf75b Compare October 7, 2026 23:14
@godofecht
godofecht enabled auto-merge October 7, 2026 23:14
@godofecht
godofecht added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 55dc81b Oct 8, 2026
28 checks passed
@godofecht
godofecht deleted the feat/811-gpu-resource-descriptor-contract branch October 12, 2026 23:02
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.

1 participant