Files
metal2vulkan/docs
Anees Iqbal 4892518700 Translator: a half the lowering moves through a containment select or a candidate switch keeps its bits
A half moved without arithmetic must keep its 16 bits, a NaN's payload included: a move is not
the device's arithmetic, so no precision note covers it. bb44847705 fixed the contained load of
device memory. Four more moves the lowering makes itself lost the bits:
- the contained loads of the arenas (lower/access/local.rs) and of the constant blob (blob.rs)
  selected the decoded f32 with no bits note;
- the switch-at-use over a pointer's candidate buffers (emit.rs: the device buffers' switch and
  the blob-or-buffer switch) merged the arms' decoded f32 by a phi with no note.
A store of the moved half then re-encoded it by the device's narrowing. On the CPU interpreter
2045 of the 2048 all-ones-exponent patterns came back 0x7e00 (0x7c01 to 0x7e00, for example) at
each of the four, on every committed profile under the resident-table domains (job m3-max-66591,
the new test without this change).

One form for every move the lowering makes: the bits move beside the value and are noted for the
result, so a later narrow::to_bits returns them.
- A containment select is leaf::contained (bb44847705's narrow::select_zero) at every
  containment select of a leaf: device views and addresses as before, the arenas, the constant
  blob, and the pulled fetch's source read. The pulled fetch reads raw integer components and
  decodes a half after the select, so its output does not change.
- A switch merge: each arm carries its value's parts and their bits (leaf::carried, the bits
  from narrow::moved_bits: the bits noted for the value, else its to_bits), the merge's phis
  carry both, and leaf::merged notes each part's bits phi for its value phi
  (narrow::note_moved), chunk by chunk for a chunked vector.
Where the moved value is stored unchanged, the f32 select or phi and the decodes are dead and
leave the module; where it is computed with, the bits ones are.

Not changed: a leaf that is no narrow float (carried and merged pass its value alone); the
program's own select and phi of a half, which stay the device's moves under
PrecisionNote::NativeNanEncoding; typed objects, which hold a half widened.

SEMANTICS_VERSION 2272 to 2273 (2272 is lane irisvsimd's, landed first): a module that
stores a half moved through one of these paths changes.

Verification:
- tests::engine_half_moves::our_own_moves_keep_every_half_patterns_bits, new: four kernels move
  the patterns through a contained private-arena load, a contained constant-blob load, the switch
  over two device buffers (an eight-lane half vector, so chunked) and the switch over a constant
  buffer or the blob, each module's path asserted (its census key, or its switch-at-use), on every
  committed profile under the resident tables. Without this change it fails at all four (job
  m3-max-66591: 2045 of 2048 changed, 5 distinct modules each); with it every pattern keeps its
  bits (job m3-max-66584, 2 distinct modules each).
- Compile job m3-max-66584 at this tree: fmt, signatures, refusal surface, clippy plain,
  --cfg m2v_gpu and --cfg m2v_cpu_icd, workspace rustdoc -D warnings, api-docs.
- The 252-row hash probe over the two app libraries on validation's runtime description: 252 ok,
  0 of 252 module hashes move (job m3-max-66587 against m3-max-66590 at fd18d75085).
2026-11-22 02:05:42 -08:00
..