This project is a low-level, system-tuning suite designed to bridge the gap between a generic Linux/Windows laptop and a tightly integrated, Unix-based Apple Silicon system (like the M2 or M3). By actively tuning the kernel, scheduler, and compiler, this suite treats the Intel Core Ultra 5 125H (Meteor Lake) like a first-class compute engine.
- The Problem: The default Linux scheduler blindly bounces threads between P-Cores and E-Cores to save power, resulting in latency spikes and micro-stutters.
- The Solution: We dynamically map the
/sys/devices/system/cpu/topology and build isolated Rayon thread pools exclusively for the 4 P-Cores (8 threads). - Benchmark: 1.5x Speedup on heavy workloads by bypassing the E-Core penalty and guaranteeing 4.5 GHz execution.
- The Problem: Rust compiles for generic x86 CPUs by default (processing 1 float per instruction).
- The Solution: Compiled with
target-cpu=native, unleashing AVX2 and FMA (Fused Multiply-Add). - Benchmark: AVX2 utilizes 256-bit registers (processing 8 floats per clock cycle), resulting in a 2.65x Speedup in our 10-million element dot-product benchmark compared to scalar math.
- The Problem: Linux defaults to high swappiness (60), kicking idle memory to disk and causing jitter.
- The Solution: Reduced swappiness to 10. Implemented
PinnedBuffer(usingmlockto pin compute arrays to physical RAM) andHugePageBuffer(usingMADV_HUGEPAGEfor 2MB pages to slash TLB misses). - Benchmark: Zero swap latency and highly predictable read/write speeds for large matrices.
- The Problem: AI models run on the CPU, causing high thermal load and lower throughput.
- The Solution: Integrated Intel OpenVINO to dynamically route inference to the Arc Graphics (Xe-Cores) and AI Boost (NPU). This mimics the Apple Neural Engine (ANE) for battery-efficient AI processing.
By implementing this suite, we've matched Apple's architectural advantages on Intel hardware:
| Feature | Apple Silicon (M2/M3) | Intel Core Ultra 5 125H (Tuned) |
|---|---|---|
| Hybrid Routing | macOS Grand Central Dispatch | Rayon pools + explicit core_affinity |
| Unified Memory (UMA) | Native hardware UMA | wgpu MAPPABLE_PRIMARY_BUFFERS + mlock |
| Vector Math (SIMD) | 128-bit ARM NEON (4 floats) | 256-bit AVX2 (8 floats per cycle) |
| AI Inference | Apple Neural Engine (ANE) | OpenVINO -> Arc GPU & AI Boost NPU |
To see the hardware detection and benchmarks in action:
cargo build --release
./target/release/intel-mac-parityBecause Linux resets kernel parameters on reboot (like CPU governor, swappiness, and P-State limits), we've included a script to lock your system into "Performance Mode" automatically on boot.
Run the installation script to create the systemd service:
sudo bash install_startup.shWhat the service does:
- Sets all CPU governors to
performance. - Locks Intel P-State minimum performance to
100%(eliminates frequency ramp-up latency). - Reduces
vm.swappinessto10. - Enables transparent hugepages (
always). - Disables
sched_energy_awareto prevent the kernel from overriding our P-Core pinning. - (Level 2) Automatically overrides the hardware PL1 limits to 45W for sustained performance.
For a deep dive into exactly how much performance we unlocked, read the Final Benchmark Comparison Report. It details the precise latency, thread jitter, and sustained thermal parity achieved against an Apple M2/M3 target.