---
title: "Odin's #soa Compared With ISPC"
authors:
  - "Ginger Bill"
year: 2026
venue: "Odin News (odin-lang.org), 28 Nov 2026"
arxiv: null
doi: null
source: "https://odin-lang.org/news/soa-and-ispc/"
version_reviewed: "web 2026-11-28"
topics:
  - "structure-of-arrays"
  - "simd"
  - "spmd"
  - "auto-vectorization"
  - "masking"
  - "stream-compaction"
  - "floating-point-determinism"
  - "data-layout"
seed_rank: 2751
seed_batch: "craft-2026-11-29"
reviewed: "2026-11-29"
pool: "languages"
relevance_score: 7
lineage: ecs-data-oriented
cites:
  - title: "Odin's #soa Compared With ISPC"
    url: "https://odin-lang.org/news/soa-and-ispc/"
    year: 2026
    arxiv: null
    doi: null
  - title: "ispc: A SPMD Compiler for High-Performance CPU Programming"
    url: "https://doi.org/10.1109/InPar.2012.6339601"
    year: 2012
    arxiv: null
    doi: "10.1109/InPar.2012.6339601"
see:
  - "341-ispc-a-spmd-compiler-for-high-performance-cpu-programming"
  - "345-structure-of-arrays-and-data-layout-for-simd"
  - "2377-exploiting-superword-level-parallelism-with-multimedia-instruction-sets"
---

# Odin's #soa Compared With ISPC

## One-sentence takeaway

A side-by-side of ISPC's implicit SPMD model (varying/uniform, automatic masking, gang size chosen by `--target`) with Odin's explicit one (`#soa` is only a layout, a loop is a loop that LLVM may vectorize, and `#simd[8]f32` packets give a fixed width on every target). Each comparison comes with Zen 4 timings. The useful findings are the sharp edges: AVX2 masked stores made a branchy loop slower than scalar (92 ms against 60 ms), AVX-512 `vpcompressd` to memory made packet compaction 3× slower than the plain loop (128 ms against 58 ms), and ISPC's float sum gives a different answer at gang sizes 4, 8 and 16.

## Why it matters here

ano is a columnar language with masked array effects, and Anoptic is a C23 SoA engine. This post is a compact field guide to the decisions both have to make. What should the language do for you implicitly (mask every branch, choose a width per build) and what should it make explicit (packets, tails, compress-stores)? It argues for explicit control with concrete evidence. Implicit masking is not free, and the best form changes per microarchitecture. A reduction whose result depends on the compile target breaks lockstep determinism, a hard requirement for GRID COMMAND replays and netcode. Odin refuses to vectorize a float sum unless you write the partial sums yourself (50 ms down to 7 ms), so results never change behind your back. Two smaller layout tricks are worth copying: power-of-two SoA columns staggered by a cache line (4224-byte rather than 4096-byte strides) to avoid L1 set conflicts, and `#soa_split` to keep vector-typed fields usable as values while storing them as columns. The ano and lockstep reading is mine; the post compares two languages.

## Key ideas

- **Layout vs. execution model.** `pts: #soa[1024]Point` keeps `pts[10]` a `Point` and `pts.x` a `[]f32` column. `#soa[]`, `#soa[dynamic]` and `#soa[dynamic; N]` exist, `copy` transposes AoS↔SoA in blocks, and `soa_zip` wraps existing arrays. ISPC's `soa<8>` ties block size to gang size and falls back to gathers when they disagree; whole-column `#soa` works at any width.
- **Masking costs differ by ISA.** A branchy update on Zen 4 ran 60 ms scalar with the default target, 92 ms with AVX2 masked stores and 20 ms with AVX-512 masking. A branch-free select ran 30/19/20 ms. In Odin you choose: branch-free code, or explicit 8-wide packets with `simd.select`.
- **Reductions and scans.** Write explicit partial sums with a tail. ISPC needs no tail, but its gang-dependent result for 1e8 plus 1,002 ones is 100,000,752 at gang 4, 100,000,880 at 8 and 100,000,944 at 16. A blocked `simd.scan_add` plus a shuffled carry takes 18 ms against 56 ms for the plain running total.
- **Early exit and compaction.** `simd.extract_msbs` turns a lane mask into a `bit_set` you can iterate, so a packetized first-match scan takes 7.4 ms against 23 ms. `simd.masked_compress_store` mirrors ISPC's `packed_store_active` and wins at SSE/AVX2 (44/42 ms against 58 ms), but loses badly with AVX-512 on Zen 4 (128 ms).
- **Aliasing and width control.** Gathers vectorize only with `#no_alias` (pointer parameters only for now) and on microarchitectures with fast gathers. Width can be set per program (`-microarch`), per value (`#simd[N]T`) or per procedure (`@(enable_target_feature)` plus your own dispatch).

## Caveats

This is a vendor post by the language's creator, so it presents Odin favourably. It is benchmarked on one Zen 4 (Ryzen 9 7950X, Windows 11, LLVM 22, ISPC 1.32.0), mostly 20,000 passes over 4,096 elements that fit in L2. At 196 MB every variant is memory-bound (about 58–63 ms). There is no Intel or ARM data, and the Zen 4 compress-store penalty is microarchitecture-specific. ISPC's advantages (`launch` tasking, multi-target builds, Intel GPU output) are acknowledged but not benchmarked, and Odin does not target GPUs at all. I read the full post. The determinism and ano conclusions are mine.

## Links

- Post: https://odin-lang.org/news/soa-and-ispc/
- ISPC paper (InPar 2012): https://doi.org/10.1109/InPar.2012.6339601
- lobste.rs discussion: https://lobste.rs/s/k0bkyg
