enigma.Swizzle(bits, base, shift)
XOR-based address remapping. Apple Silicon threadgroup memory has 32 banks at 4-byte granularity.
| Parameter | Type | Description |
|---|---|---|
bits | int | Number of XOR bits (B). Controls pattern period. Typical: 1-3 |
base | int | Bit position of lowest XOR target bit (M) |
shift | int | Bit position of lowest source bit (S) |
bits bits starting at position shift, XORs them into position base.
enigma.swizzle(layout, bits, base, shift)
Compose a Layout with a Swizzle, returning a SwizzledLayout.
enigma.SwizzledLayout
Behaves like a Layout but applies XOR remapping after coordinate-to-offset computation. Has the same shape, stride, size(), rank() properties as Layout.