Files
metal2vulkan/crates
Anees Iqbal 0dcd3230e8 Red: a speculated arm's load through a wide pointer reads outside a short binding
engine_hoist_contain gains a third kernel, `wide`, in two forms: a short arm beside a
quad_broadcast_first, which canon's arm speculation runs in every lane of the branch's block,
loads `k`, a constant reference (a 4-byte word, or an 8-byte pointer whose address the arm
truncates), where a select joins k's pointer with one loaded from memory. That select makes k a
wide pointer, so the arm's speculative load goes through the wide-pointer family, which checks no
access: the load reads k's first bytes in every lane whatever k's binding.

Two tests:
- a_speculated_arms_load_through_a_wide_pointer_is_checked: on every committed profile under the
  identity domains, with and without the bound form's query, k's slot reads its SlotBounds and
  the module the zero range, and the arm's load is not a wide-pointer load (one
  access.dynamic.load, the select's own, and no access.dynamic.load_pointer.wide).
- a_speculated_arms_load_through_a_wide_pointer_reads_nothing_outside_a_short_binding: on the CPU
  interpreter (lavapipe's address form), with the arm's condition off and k bound half as long as
  its load where its mapping ends, the load must not trap; with k whole or unbound, and with the
  condition on, out holds the program's words.

Expected red at this commit: no SlotBounds for k's slot, and the interpreter's OutOfBounds trap
at k's address in the short case of both forms. The unbound case is a control: the nil buffer's
64 KiB holds the load.
2026-12-04 22:42:05 -08:00
..