Cursor AI Rust Portable SIMD, AVX-512 & Cache-Aligned Rules
Train Cursor IDE to enforce cache-friendly data layouts, explicit loop unrolling, auto-vectorization friendly slices, and branchless algorithms.
Parametric Customizer & Compiler Live Tool
Adjust the variables below. The prompt code and API payload update dynamically in real time.
Core domain application
Hot path function
You are a Principal Low-Latency Systems Architect and Rust Performance Specialist.
Configure Cursor AI (.cursorrules) to enforce zero-allocation, SIMD-vectorized high-throughput systems programming for {Real-time Order Book Matching Engine and Financial Time-Series Technical Indicator Pipeline} on {x86_64 with AVX2 & AVX-512 (target-cpu=native)}.
### MANDATORY PERFORMANCE CODING CONSTRAINTS:
1. **Portable SIMD Vectorization**: Prefer `std::simd::Simd` (nightly) or `wide` crate over raw assembly for cross-platform vectorization (AVX2, AVX-512, ARM Neon).
2. **Cache Line Alignment**: Annotate critical data structures with `#[repr(C, align(64))]` to prevent false sharing across concurrent CPU cores on 64-byte L1 cache lines.
3. **Branchless Arithmetic**: Replace unpredictable branch conditionals inside inner loops with bitwise operations, masking, or `cmov` instructions (`bool as usize`, `select`).
4. **Bounds-Check Elimination**: Structure iteration loops around contiguous slices with compile-time assertions or chunked iterators (`chunks_exact`) to allow LLVM to eliminate slice index bounds checks.
5. **Zero Allocation Hot Paths**: Ban heap allocations (`Vec::push`, `Box::new`, `format!`) inside hot loops. Mandate pre-allocated arenas or scratch buffers passed by mutable reference.
Target Pipeline & Algorithm:
{Vectorized Dot Product, Exponential Moving Average (EMA), and Level-2 Order Book BBO (Best Bid & Offer) scan}
Benchmark & Profiling Target:
{< 50 nanoseconds p99 latency with zero L1 data cache misses} Supercharge your low-latency systems and performance programming with AI context.
Leonardo Phoenix & Flux: Generate photorealistic studio assets with 150 daily free credits. Zero setup required.
πΈ Real Sample Outputs & Verified Results
Visual evidence and benchmark responses generated using this exact prompt formula.
π¬ Prompt Engineering Anatomy
Why this prompt consistently delivers high-tier results: technical parameter breakdown.
as_chunks::<N>() Iteration Guarantees that chunks have a fixed size known to the compiler, enabling LLVM to unroll loops and emit packed SIMD instructions automatically.
#[repr(align(64))] Aligns memory on 64-byte boundaries, ensuring single SIMD registers don't cross cache lines and preventing multi-core false sharing.
π¬ Frequently Asked Questions
Troubleshooting common edge cases, model incompatibilities, and best practices.
Can I paste this directly into my repository's .cursorrules?
Yes, copy the generated instructions into `.cursorrules` to instruct Cursor to generate portable SIMD and zero-allocation code.
Does portable SIMD work on stable Rust?
std::simd is currently on nightly. For stable Rust, Cursor will utilize the `wide` crate or auto-vectorization patterns with `chunks_exact`.
Cursor AI & Claude 3.5 Sonnet Pro Bundle
Supercharge your workflow with instant codebase indexing, multi-file edits, and automated system rules.
Explore Related Coding & Architecture Prompts View all β
Claude 3.5 Sonnet Senior Staff Full-Stack Refactoring Architect
Specialized prompt framework for Claude 3.5 Sonnet and Claude 3.7. Transforms messy legacy codebases into modular, testable, high-performance systems with automated regression tests.
cursorCursor AI (.cursorrules) for Next.js 15, React 19 & Tailwind CSS
Stops Cursor from writing outdated Next.js 13 patterns, Pages Router syntax, or deprecated React hooks. Enforces strict TypeScript, Server Actions, and modular clean architecture.
deepseekDeepSeek-R1 Autonomous Deep Research & Synthesis Engine
DeepSeek-R1 chain-of-thought framework designed to force deep reflection, counterfactual auditing, and hypothesis testing before producing production-ready research reports.