---
title: "SIMD for Collision"
description: "Box3D uses wide SIMD to speed up the edge-edge phase of the Separating Axis Test, testing one edge of hull A against four edges of hull B at once using structure-of-arrays data."
url: "https://swe.quest/articles/simd-for-collision-0a426a9583188633"
canonical: "https://box2d.org/posts/2026/07/simd-for-collision/"
source: "Box2D"
published: "2026-07-18"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 5
tags: ["performance","gaming","algorithms","c-cpp"]
---

# SIMD for Collision

A post on [Box2D](https://swe.quest/sources/box2d.md), published 2026-07-18, 5 min read, Deep dive. Original: [https://box2d.org/posts/2026/07/simd-for-collision/](https://box2d.org/posts/2026/07/simd-for-collision/)

## Summary

Box3D uses wide SIMD to speed up the edge-edge phase of the Separating Axis Test, testing one edge of hull A against four edges of hull B at once using structure-of-arrays data. For 32-point convex hulls with 89 edges (7921 edge-edge pairs), SSE2 makes the whole simulation more than twice as fast as scalar code in a 5120-hull pile benchmark, and simply compiling with AVX2 enabled adds roughly another 10%. SAT is preferred over GJK/EPA because it needs no collision margin and avoids EPA's numerical brittleness. Its quadratic cost is bounded by Box3D's 128-edge hull limit, and the optimization does almost nothing for box-box collisions.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Games](https://swe.quest/tags/gaming.md) (Domains)
- [Algorithms](https://swe.quest/tags/algorithms.md) (Architecture & design)
- [C & C++](https://swe.quest/tags/c-cpp.md) (Languages)

## Prerequisites

- SIMD intrinsics
- convex hull collision detection
- structure of arrays layout

## Keywords

Box3D, Box2D, Separating Axis Test, SSE2, AVX2, GJK, EPA

## Related posts

- [Inscribed Spheres](https://swe.quest/articles/inscribed-spheres-119dd641a396418e.md): Box2D · 2026-09-29 · Hard · 14 min read · Games, Algorithms, Performance engineering, C & C++
  Inscribed spheres give a cheap upper bound on the separation achievable along any axis in the separating axis test (SAT): n·d − (rA + rB), where d joins the sphere centers.
- [Box2D 3.2](https://swe.quest/articles/box2d-3-2-6bf0b6359f7de39c.md): Box2D · 2026-10-18 · Easy · 2 min read · Games, Performance engineering, C & C++
  Box2D 3.2 runs roughly three times faster than 3.1, with the speedup broken down by source: contact recycling (~40%), solver algorithm refinement (~20%), AVX2 runtime dispatch (~15%), solver optimization (~10%) and broad-phase optimization (~10%), which compound multiplicatively.
- [Platform-independent SIMD in Go](https://swe.quest/articles/platform-independent-simd-in-go-f8d408cca35d2358.md): The Go Blog · 2026-09-24 · Hard · 18 min read · Go, Performance engineering, Hardware, Compilers, API design
  Go 1.27 adds an experimental, size-agnostic \`simd\` package, loosely modeled on Highway for C++.
- [Arch-specific SIMD in Go](https://swe.quest/articles/arch-specific-simd-in-go-2992a831c4663686.md): The Go Blog · 2026-10-02 · Hard · 11 min read · Go, Performance engineering, Compilers, Hardware, WebAssembly
  Go 1.27 extends the experimental architecture-specific SIMD API (simd/archsimd, enabled with GOEXPERIMENT=simd) from amd64 to arm64 NEON and wasm 128-bit SIMD.
- [Enum of Arrays](https://swe.quest/articles/enum-of-arrays-39cf1c2fe738e424.md): TigerBeetle · 2024-12-19 · Medium · 3 min read · Performance engineering, Data structures, Zig, Hardware
  Struct-of-Arrays has a dual for tagged unions: an Enum of Arrays, where one tag covers a whole batch of homogeneous payloads instead of each element carrying its own tag.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
