THREE.JS / FOUNDATIONS 172

Sort the swap.

A bitonic network turns a shuffled power-of-two buffer into an ordered field. Watch each local and global compare stage become a renderer-visible contract.

Initializing sort paths0 / 2 ready

Preparing the storage buffer, display materials, and deterministic input...

WEBGPU LOCAL SORTstarting
GLOBAL SORT / FALLBACKstarting

sort pipeline

Advance the network.

Awaiting a validation readback.

The native lane follows the official 16,384-element stepwise BitonicSort helper beside the official global-storage swap shape. A forced-WebGL2 run keeps an explicit CPU proxy; Three.js does not claim compute shader parity on that backend.

WebGPU localWebGPU global / CPU
execution
——
step
——
elements
——
draw calls
——
checked
——
01power-of-two input
02local/global swaps
03storage readback

Green-to-violet values are ordered from low to high · the native lane follows the pinned official 16,384-value dual-WebGPU shape.

Pinned official bitonic-sort source

LAB 172 / BITONIC SORT