Files
metal2vulkan/crates
Anees Iqbal 85aa6c8dee rt: an exported block's BlockInfo states no device address, so its make hands none out
API change for the consumer: BlockInfo::gpu_address becomes Option<u64>. It is Some for every
taken, imported and sparse block, as before, and None for an exported block
(Device::new_exported_block). BlockInfo stays Clone + Copy. The only way to an address of an
exported block's memory is now Buffer::gpu_address of a buffer in it, which marks the block and
counts it in Metrics::exported_blocks_addressed as be1b2cfe46 built it. The consumer's reads of
the field fail to build until each one is reviewed. At reims-vgpu 095001ddc6,
`git grep -n -F '.gpu_address' 095001ddc6 -- 'crates/reims-vgpu-vulkan/src/rt_platform/*.rs'
'crates/reims-vgpu/src/pool/rt_blocks.rs' 'crates/reims-vgpu/src/platform/rt.rs' | grep -v
'gpu_address('` gives 39 lines. Some of them are the consumer's own structs; their types were not
checked one by one. The rt BlockInfo reads among them include:
- rt_platform/buffer.rs:793, the known-block map's key;
- pool/rt_blocks.rs:118 and :170;
- rt_platform/diag.rs:716;
- rt_platform/fault.rs:1405;
- platform/rt.rs:149.

Why: be1b2cfe46 counted the public make itself as handing the address out, because the Block
handle derefs to BlockInfo and BlockInfo's pub field stated the address. The consumer calls
new_exported_block for every buffer-form video cache (rt_platform/export.rs:208 at 095001ddc6). So
every such cache's textures stayed in the over-copy class from their make on. With no address in
the info there is nothing to read by accident. A bookkeeping read (a map keyed by address, a
diagnostics line) now fails to build instead of silently turning the bound off. The Option says
"this block has none", as contents: Option<NonNull<u8>> already does.

How:
- Memory::info() gives None where the memory is exported.
- new_exported_block no longer marks its block at the make. Its body was the crate's
  exported_block(), which only the copy form of new_exported_surface called, and the two are now
  the same; the wrapper is gone and the surface calls new_exported_block.
- No product code read the field. The runtime's tests and the validation crate's replay player
  read it only for taken and imported blocks, and now read the Option.

Docs: the field's doc and new_exported_block's doc, the exported_blocks_addressed doc, the
ExportedOvers doc, and the runtime README (Exported blocks, the address contract in Known gaps,
the exported block's rule in Textures over a buffer). The signatures table and docs/REFUSALS.md
(whose site column named exported_block) are regenerated.

Test: an_exported_blocks_texture_is_copied_in_once_a_change. The block's handle states no address
and the make counts 0. Then a new row on the block's own texture: three submissions that each read
it and then write through an address into another buffer copy it in [0, 0, 0], with 0 blocks
addressed. After Buffer::gpu_address on the buffer the texture is over, the count is 1, and three
more such submissions copy [0, 1, 1]. The surface row follows, with the store_through kernel's
state and buffers now made once for both rows.

Verified:
- Without the change: the base 015ece4929 product with this row printing instead of asserting, on
  lavapipe, job m3-max-66854. It printed "addressed at the make 1, rows [0, 1, 1] (addressed 1),
  then after the buffer's address [1, 1, 1] (addressed 1)". So the row fails without the change.
- Compile job m3-max-66851 (tree a9636bbcf8, the same tree as this commit): signatures and
  refusal-surface checks, fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), workspace Rustdoc
  -D warnings and scripts/api-docs all exit 0. The runtime suite on lavapipe: 642 tests run, 642
  passed, 3 skipped.
- The m2v_gpu archive is from job m3-max-66852. Each card ran the test, then the runtime suite:
  - RX 550, job m3-max-66873: 644 passed, 3 skipped, peak 0.96 GiB.
  - Iris Xe, job m3-max-66874: 644 passed, 3 skipped, peak 3.72 GiB.
  - RTX 3090, job m3-max-66875: 644 passed (1 slow), 3 skipped, peak 2.44 GiB.
  Each card printed "OpaqueFd block: copies in a submission that writes through an address, the
  block's address not out: [0, 0, 0], then out: [0, 1, 1]; blocks addressed 0, then 1". Lavapipe
  printed the same line in m3-max-66851.
2026-11-22 02:29:05 -08:00
..