Use or modify cuda-rust-wasm and cuda-wasm source translation with a trusted cuda2rust executable, bounded processes, parser tests, and Rust/WGSL validation. Use for CUDA-subset parsing, generated-source correctness, compiler-wrapper integration, or safe memory APIs.
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Read cuda-wasm/README.md and docs/review-cuda-cv.md in the selected checkout. The Rust package is cuda-rust-wasm; its compiler is cuda2rust. The npm package is cuda-wasm. It returns Rust or WGSL source text through a separate trusted compiler. Translation does not execute a kernel, produce compiled WASM, or establish GPU acceleration.
rust or wgsl, not the removed wasm/webgpu npm targets. Successful parsing can recover from unsupported constructs; inspect generated code and diagnostics.Run from the repository root:
cargo build --locked --manifest-path cuda-wasm/Cargo.toml --bin cuda2rustThen select its actual executable path, which may differ if CARGO_TARGET_DIR is set:
node cuda-wasm/cli/index.js transpile "/path/to/vector_add.cu" --target wgsl --binary "/path/to/cuda2rust" --output "/path/to/new-output.wgsl"An existing CLI output file requires explicit --force to overwrite. Use a fresh task-owned output path for tests. On Windows use the real .exe path, preserving it as one literal argument.
For an installed consumer with a trusted compiler already configured:
import { transpileCuda } from 'cuda-wasm';
const result = await transpileCuda(
'__global__ void copy(float* a, float* b) { b[0] = a[0]; }',
{ target: 'wgsl', binary: '/path/to/cuda2rust', timeoutMs: 30000 }
);
console.log(result.target, result.compilerVersion);
console.log(result.code);CommonJS uses require('cuda-wasm'). transpileFile(path, options) reads a bounded file; both translation methods return promises of {code,target,compilerVersion}. Read the current declarations for option types.
timeoutMs from 1 to 120,000 ms, default 30,000. Version checking is a separate process with a 4,096-byte output cap.maxOutputBytes defaults to 4 MiB per stream and allows at most 16 MiB. Input file growth must not bypass the cap.compilerStderr/exitCode without exposing credentials or unrelated files.E_INPUT_LIMIT, E_COMPILER_NOT_FOUND, E_COMPILER_VERSION, E_TIMEOUT and E_OUTPUT_LIMIT. Test these against the actual public API.Compile generated Rust using its required runtime/dependency context. Parse and validate generated WGSL, then compare actual executed outputs to a trusted CPU/original-kernel reference when an appropriate device/runtime exists. Include tail threads, zero/rejected shapes, indexing overflow and synchronization requirements. Shader validity alone does not prove equivalent behavior.
HostBuffer and DeviceBuffer in this project are initialized aligned host allocations, not pinned CUDA memory or device storage. Raw copies and kernel launches require unsafe live-pointer, ABI and synchronization contracts. The tiled attention routine is a CPU online-softmax reference; nonzero dropout rejects. Do not describe it as fused FlashAttention-2/3.
From the repository root:
cargo test --manifest-path cuda-wasm/Cargo.toml --all-targets --locked
cargo check --manifest-path cuda-wasm/Cargo.toml --all-targets --no-default-features --lockedFrom cuda-wasm/, with dependencies and the real compiler already available:
npm test
npm run build
npm run test:integration
npm audit --audit-level=moderateSet CUDA2RUST_BINARY to the trusted compiler for integration testing or use the supported API/CLI option. Unit executable fixtures are explicitly synthetic; the integration gate must invoke the actual built compiler. Build validates Node entry points and does not emit a WASM binary.
Accept parser/wrapper changes after valid and invalid syntax fixtures, bounded execution/cleanup, CJS/ESM/CLI consumers and real-compiler integration pass. For kernel equivalence or performance claims, additionally retain actual compiled execution and measurements. A missing compiler is a prerequisite failure; do not fabricate translated output. Native CUDA/OpenCL, optional GPU discovery and Nutanix operations require separate opt-in environments and do not follow from a CPU pass.
Read translation verification details for backend and research boundaries.
ruvnet/ruv-FANN
2fce9b7
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.