Files
metal2vulkan/docs
Anees Iqbal 661b97c6e8 rt: a buffer longer than 4 GiB is refused
A shader reaches a buffer argument's bytes by 32-bit offsets from its bind
address: every access form adds the u32 Metal offset to the slot's 64-bit
address, so an access 4 GiB or more past the bind offset lands 4 GiB
below, inside the buffer, with no fault. Device::new_buffer now refuses a
length past MAX_BUFFER_LENGTH (4 GiB, one constant) with
Refusal::BufferTooLong, before the block's range is looked at; heap
buffers and a consumer's no-copy placements go through the same call.
Metal answers nil past a device's maxBufferLength, which the consumer
states no larger than this (the README's contract line).

Tests: rt's every-device memory test refuses 4 GiB and a byte and
u64::MAX on a pooled block, typed; a test of its own makes a buffer of
exactly 4 GiB in a Private block of that length where the device has one
(skipping visibly where its largest block or memory is smaller), refuses
one a byte longer, and ends with every gauge at zero. The translator's
interpreter test loads and stores up to the last word below 4 GiB through
a Whole window under the identity domains, each landing at its own word.

REFUSALS.md and api_signatures.tsv regenerated.
2026-11-17 16:50:10 -08:00
..