GPU shader optimization
You're optimizing a hot rendering path in a game engine (C++ / a HLSL compute shader) that's missing the 16.6ms frame budget on mid-range GPUs. A junior suggests asking an AI agent to 'make this shader faster'. Explain why this is a weak use of the tool as framed, what failure modes apply to GPU performance work, and how you'd actually involve AI if at all.
Implement
evaluate_optimization_candidate(baseline_us: list[int], candidate_us: list[int], noise_margin_pct: int, budget_us: int) → list[str]Examples
in
[[17200,17000,17400],[15100,15000,14900],3,16600]out["verdict=faster","baseline_p50_us=17200","candidate_p50_us=15000","meets_budget=true"]in
[[17000,17100],[16950,17150],5,16600]out["verdict=noise","baseline_p50_us=17050","candidate_p50_us=17050","meets_budget=false"]in
[[],[15000,15000],3,16600]out["verdict=unmeasured"]What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 18 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.