🦀 Rust 2024 · #![no_std] ARM64 NEON asm! · Nushell 0.117 Plugin

Bare-Metal ARM64 NEON
Speed for Nushell.

Hand-written 128-byte Apple Silicon cache-line assembly kernels delivered as a zero-dependency #![no_std] crate, standalone CLI, and native Nushell plugin.

47.8 GB/s
8× FMA dot product (10.7× Rust std)
50.0×
128B NEON newline scan (44.2 GB/s)
35.0 GB/s
64B UTF-8-safe ASCII lowercase
8.3×
nuresh wc vs macOS /usr/bin/wc -l
curl -fsSL https://raw.githubusercontent.com/8b-is/nuresh/main/install.sh | sh

Apple M1 Max Live Benchmarks (64 MiB)

Measured on Apple M1 Max (8 Firestorm P-cores, 64 GB LPDDR5) with nuresh bench --size-mb 64 and hyperfine. Zero callee-saved register spills.

dot_f64_neon (8× fmla.2d, 128B ldp) 47.80 GB/s · 2.81 ms · 10.72× vs Rust std
count_byte_par (\n, 8 Apple Silicon P-cores) 46.30 GB/s · 1.45 ms · 52× vs scalar
count_byte_neon (\n, 1-core 128B + nested uadalp) 44.18 GB/s · 1.52 ms · 49.99× vs Rust std
sum_i64_neon (8× add.2d, 128B ldp) 39.26 GB/s · 1.71 ms · 7.0× vs v0.1.0
ascii_lower_neon (64B 4-way ldp/stp, UTF-8 safe) 35.00 GB/s · 1.92 ms · 9.5× vs v0.1.0
sum_f64_neon (8× fadd.2d, 128B ldp) 30.48 GB/s · 2.20 ms · 5.42× vs Rust std

Engineered for Apple Silicon Microarchitecture

Every kernel respects AAPCS64 ABI register conventions so the compiler emits zero prologue/epilogue stack spills.

128B CACHE LINES

Nested uadalp Widening

count_byte_neon processes 128B per cycle via 4× ldp and accumulates 2 MiB in-register before a single uaddlv + umov.

ZERO HEAP ALLOC

Stack-Chunked nuresh sum

Processes Nushell lists in a single pass using 4 KiB stack buffers with lazy i64 → f64 promotion and 8 parallel NEON accumulators.

JJ + GIT NATIVE

Sub-30µs nuresh prompt

Single-syscall readlink Kitty palette detection + direct bounded .git/HEAD and .jj walking with zero subprocess forks.

AAPCS64 NEON Register Budget — Caller-Saved Only (Zero Stack Spills)

Drop-In Nushell Experience

Works alongside every Nushell 0.117 pipeline and Jujutsu (jj) repo.

╭─ ♥全 dev@apple-silicon ~/workspace/nuresh jj:(main)
╰─⊕ ❯ nuresh wc dataset_64mb.jsonl
╭─────────────────┬────────────────────╮
│ lines │ 1260000 │
│ bytes │ 66.7 MB │
│ elapsed_us │ 9282.0 │
│ throughput_gbps │ 7.19 │
╰─────────────────┴────────────────────╯

╰─⊕ ❯ "HELLO NUSHELL ♥全 APPLE SILICON!" | nuresh lower
hello nushell ♥全 apple silicon!

Audited Safety & Zero-Panic Guarantees

Hardened by CaveCrew's security audit before open-source release.

O_NONBLOCK + Regular-File Guard

Refuses FIFOs, device nodes, and directories before touching read or mmap — never hangs your shell.

Bounded 4 KiB Metadata Reads

nuresh prompt caps .git and HEAD reads at 4 KiB with UTF-8-safe chars().take(7) truncation.

Strict Provenance & Safety Proofs

Zero from_raw_parts on asm!-mutated pointers, validated u8::try_from flags, and zero .expect() panics.