Skip to content

6.12: the GPU process draws images - #197

Draft
atiernan wants to merge 5 commits into
phase6/6.10-image-itemsfrom
phase6/6.12-gpu-images
Draft

atiernan wants to merge 5 commits into
phase6/6.10-image-itemsfrom
phase6/6.12-gpu-images

Conversation

@atiernan

Copy link
Copy Markdown
Member

Item 6.12 (GPU process: images), draft. Based on #189 (6.10).

Built

  • Image upload, draw and free (tags 7 to 9) in the batching, fake backend, exact software reference, Vulkan backend and Metal backend. crates/clazel-gpu/src/images.rs is a new image store with the atlas's design.
  • Departure from the plan's wording: there is no texture or sampler. Images live in a storage buffer and the fragment shader filters (nearest or bilinear, clamped to the source rectangle) in 32-bit arithmetic, in the same single pipeline. Reason: a real texture needs new clazel-sys calls on three OSes, each needing an audit. clazel-sys is untouched, so there is no audit step. If real textures are wanted, that is a larger change.
  • LIST_MAX is now spec::MAX_LIST_BYTES (384 MiB) and a test pins it. The GPU_LIMIT comment in hostile_graphics.rs states that images are outside the 1 GiB figure, with a worst case of about 1.4 GiB that is not measured.
  • tests/upload_measure.rs prints the cost of a 4096 x 4096 upload through the list socket on each OS (see CI's log). The second channel is not built; deciding it is yours. A local Windows optimised run took about 23 to 29 ms over loopback TCP, which is more than one 16.7 ms frame.
  • Tests: hand-worked pixels, three new scenes against the exact reference, reference pixels stored in tests/pixels-reference/, and a Vulkan hand-value test.

Not done or unverified

  • Never run on lavapipe, Metal or any GPU by the author: the GLSL compiles to SPIR-V through naga and the Linux and macOS targets pass cargo check and clippy only. Expect possible failures on the 1-level tolerance for linear filtering.
  • No lavapipe or Metal stored pixels exist for the image scenes (those comparisons skip). Bless them with CLAZEL_GPU_BLESS=1.
  • Direct3D 12 refuses images: the HLSL and its DXBC are unchanged because only vkd3d-compiler 1.19 makes the DXBC.
  • The Linux sandbox has not run with an image store. New buffers are allocated after the seccomp filter, as the atlas's are. No new pipeline is created. This work does not reveal the cause of the intermittent openat kill.
  • A store above 64 MiB is unmeasured. A driver may refuse a buffer that large.
  • Proofs and Kani were not run (CI's job). clazel-gpu stays at tier 0.

🤖 Generated with Claude Code

atiernan and others added 3 commits November 19, 2026 23:37
…e (6.12)

Image store with the atlas's design, image draws as quads, an exact
integer filter in the fake backend and the reference, new scenes and
hand-worked tests. Direct3D 12 refuses images.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… backends (6.12)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
….12)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-crate Miri and changed-crate CI)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/phases/phase-6.md
…-crate Miri and changed-crate CI)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch is waiting to be deployed

1 waiting deployment
full-verification — c3f0ac70 Waiting Nov 20, 2026 by atiernan via Approve the proofs #601
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