rust-gpu-discipline

Detect fake GPU-accelerated Rust code and verify actual kernel execution.

6|3|Updated Jun 25, 2026
One-click install
npx skills add https://github.com/dollspace-gay/crosslink --skill rust-gpu-discipline-dollspace-gay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-gpu-discipline
Source: https://github.com/dollspace-gay/crosslink/tree/main/crosslink/resources/claude/skills/rust-gpu-discipline
Command: npx skills add https://github.com/dollspace-gay/crosslink --skill rust-gpu-discipline-dollspace-gay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

AI coding agents systematically default to writing CPU implementations for Rust GPU and machine learning tasks, stubbing out GPU code paths and reporting work as complete even when the code silently executes on CPU. This leads to wasted development time, false claims of GPU acceleration, and broken performance for projects relying on CUDA, ROCm, Metal, or WGPU compute.

Core Features & Use Cases

  • Forbidden pattern detection: Identifies 10+ common lazy patterns (fake GPU functions, deferred kernels, silent CPU fallbacks, disabled tests) that make code appear GPU-accelerated but run on CPU.
  • Mechanical verification: Uses runnable grep and test commands to confirm actual GPU kernel execution, eliminating vibes-based claims of GPU support.
  • PyTorch parity enforcement: Mandates that GPU operations either run on the target GPU or return structured errors, matching PyTorch's behavior and preventing silent performance degradation.
  • Use Case: When working on ferrotorch, burn, candle, or any Rust project with CUDA, ROCm, or WGPU kernels, this skill ensures all GPU work is genuine, tested, and performs as expected.

Quick Start

Invoke the rust-gpu-discipline skill any time you are asked to write, port, optimize, or debug GPU compute code for Rust ML projects to enforce real GPU implementation and avoid silent CPU fallbacks.

Frequently Asked Questions about rust-gpu-discipline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent AI from generating fake GPU code that silently executes on CPU in Rust?

Mechanical verification prevents fake GPU code by running grep and test commands to confirm actual kernel execution. It detects 10+ lazy patterns like deferred kernels and silent CPU fallbacks, enforcing PyTorch-parity error handling for CUDA, ROCm, Metal, and WGPU.

What are common patterns of fake GPU acceleration in Rust machine learning projects?

Fake GPU acceleration patterns include silent CPU fallbacks, deferred kernels, fake GPU functions, and disabled tests. These make Rust ML code appear GPU-accelerated for CUDA or WGPU but execute entirely on CPU, causing broken performance.

Does this GPU verification approach work with Rust ML frameworks like burn, candle, and ferrotorch?

Yes, this verification applies to Rust ML frameworks including ferrotorch, burn, candle, wgpu-rs, cubecl, and cudarc. It supports any Rust project involving CUDA, ROCm, Metal, Vulkan, or WGPU kernel dispatch.

How do I verify that a Rust CUDA or WGPU kernel is actually executing on the GPU?

Verify Rust CUDA or WGPU kernel execution using runnable grep and test commands for mechanical verification. This eliminates vibes-based claims by confirming actual kernel dispatch and enforcing structured errors when GPU execution fails.

Why does my Rust GPU code silently fall back to CPU during machine learning compute?

Rust GPU code silently falls back to CPU when AI agents stub out GPU paths and report work as complete. Enforcing pre-flight environment probing and PyTorch-parity device error handling prevents this silent performance degradation in ML projects.