v156 · webgpu atomic-vec2u-min-max · 64-bit memory layout

WGSL vec2u 64-bit word-order & endian inspector

Why do you pass vec2u(payload, sortKey) instead of vec2u(sortKey, payload)? On little-endian GPU architectures, a 2-component vector vec2u lays out .x at byte offset 0..3 (bits 0..31) and .y at byte offset 4..7 (bits 32..63). When hardware executes a 64-bit unsigned integer comparison, bits 32..63 (.y) are the most-significant word.

Interactive 64-bit vec2u word-significance analyzer

Generated WGSL helper functions

64-bit atomicMin comparison between Fragment A and Fragment B
fragment vec2u(.x, .y) bits 63..32 (.y MSB) bits 31..0 (.x LSB) u64 integer value

references