Is it Turing complete? Yes, for modern HLSL. @SleeplessByte was right about Shader Model 1.0/2.0, but those limits went away in SM 3.0 back in 2004. Shader Model 6.x has unbounded loops, user-defined functions, and read-write memory through RWByteAddressBuffer/RWStructuredBuffer. It’s an imperative language with an unusual execution model, not a fixed-function pipeline description.
I’ve already built it:
GitHub - lheintzmann1/exercism-hlsl · GitHub
- 40 practice exercises, 409 test cases
- Working Dockerised test runner
configlet lintpasses- CI proves every exercise’s example solution passes and every stub fails rather than erroring
activeisfalse, awaiting your call
How the tests actually run
This was the part I expected to be blocking, and it isn’t. Solutions compile with Microsoft’s DXC targeting SPIR-V, then execute as a Vulkan compute shader on Mesa’s lavapipe, a CPU implementation of Vulkan.
No GPU is needed anywhere, in CI or on Exercism’s infrastructure. A full exercise runs in about 0.15s against the 20s budget.
The design decision I’d most like feedback on
Everything runs as a compute shader, including the graphics exercises.
That sounds like a dodge, but a fullscreen pixel shader genuinely is a compute kernel mapped over a 2D domain, that’s what Shadertoy is. So an exercise can ask for float CircleDistance(float2 p, ...), sample it over a grid from a compute shader, and compare the results numerically with a tolerance.
That means real graphics content graded deterministically, with a failure message naming the exact input, instead of image diffing and its flakiness. Students write shader maths; they never fight a screenshot comparison.
Curriculum
Two halves, roughly “the language” then “the graphics”:
19 language exercises from problem-specifications: leap, luhn, matching-brackets, atbash-cipher and so on. HLSL has no string type, so text is character codes in fixed-size buffers, much the same shape of solution the WebAssembly track uses.
21 graphics exercises specific to the track: signed distance fields and their boolean ops, sRGB/linear and ACES tone mapping, Lambert and Schlick’s Fresnel, normal-map unpacking and TBN, an integer hash into value noise into fBm, ray-sphere and ray-box, and sphere tracing. These are modelled on functions that actually appear in engine source, so what a student writes resembles what they’d read in a renderer.
Things I already know are weak
I’d rather raise these than have you find them:
- Local setup is the worst part. Students need a Vulkan loader and a small host binary that dispatches the shader. There’s a one-command setup script, prebuilt-binary plans and a Docker fallback, but it isn’t “install one package”. This is genuinely worse than most tracks and I’d welcome advice.
- No concept exercises yet, and no representer or analyzer.
- A single maintainer. I’d want a second before launch.
- HLSL has no official logo, so an icon needs designing from scratch rather than adapting one.
What I’m asking
Mainly: does the team want this track at all? I’m aware of the “no tools, libraries, frameworks or technologies” rule, and that a shading language sits near that line, though MIPS Assembly, WebAssembly and Vim script suggest the line is about whether you can actually learn programming in it, which I think HLSL clears.
If yes, I’d like a repo under exercism/ and I’ll keep going. If there are blockers I haven’t spotted, I’d much rather hear them now than after another 40 exercises.
Happy to walk through any of the tooling decisions, they’re all documented in the repo README.