⬆️ Build on metal2vulkan development 38c5f2e96a

Moves the runtime to metal2vulkan development 38c5f2e96a. SEMANTICS stays
2292, ARTIFACT 593 and RUNTIME 2550: no translator change, so no host
translates its guests' shaders again and no stored artifact or pipeline cache
re-keys.

What changes for the guest at this pin:
- A compute kernel that observes its threadgroup partition runs its whole
  grids (dispatchThreads of whole threadgroups), its dispatchThreadgroups and
  its indirect dispatches on its plain module at their own threadgroup size
  again, and only its ragged grids (dispatchThreads of a grid that is not a
  whole number of threadgroups) on its partial-threadgroups variant. Since
  metal2vulkan 6453edbea7 and its series, every such dispatch the variant took
  ran the variant, and each whole grid paid for its predicated walk and
  partial-group answers: on an RTX 3090 a guest's compute workload took
  16.68 s at metal2vulkan 5205d18d12, which holds 6453edbea7, against 2.82 s
  at d7bf09eb05, before it (job m3-max-71167). What a dispatch writes is
  unchanged, and ragged grids run, and are refused, as before.
- The rest of the range is documentation of metal2vulkan's runtime: a
  render pass resolve of a slice above 0 of a multisample array under AMD's
  open Linux driver (AMDVLK) reads slice 0's samples, a known gap of that
  driver, which rt has no form for.

For the host: no API change. Such a kernel's state lowers its plain module
beside its variant again, so rt-translations counts two modules for it, and
its finish makes two main pipelines at its declared size, the plain module's
and the variant's; where the cache directory holds no plain module of such a
kernel, as one written at the old pin may not, its first state lowers it once.
Metrics::partial_variant_whole_grids stays, and with it the counts line's
rt-partial-variant-whole-grids, which reads 0 at this pin: that is what shows
that the whole grids ran the plain module. rt-partial-variant-ragged-grids
counts the ragged grids as before. Our docs of the routing
(rt_platform/device.rs, rt_platform/pipeline.rs) follow.
This commit is contained in:
Anees Iqbal committed 2026-11-23 06:36:23 -08:00
1 parent a0cb00563a
commit 3213151acc
3 files changed
+27 -25

No files matched your search

+2 -2
View File
@@ -33,11 +33,11 @@ reims-vgpu-graphics = { path = "crates/reims-vgpu-graphics" }
reims-vgpu-video = { path = "crates/reims-vgpu-video" }
# metal2vulkan's Metal types, for the Metal enums and descriptor values the runtime's calls take,
# from metal2vulkan's public repository at the commit both name.
metal2vulkan = { git = "https://github.com/steelbrain/metal2vulkan", rev = "06058348cda202e858022fb71890758a23e7aac4" }
metal2vulkan = { git = "https://github.com/steelbrain/metal2vulkan", rev = "38c5f2e96a662f490779bdf8fe59b474f3f6260d" }
# The Vulkan platform's runtime (architecture D1), metal2vulkan-runtime: a Metal-shaped API on
# Vulkan, one path for every device, under reims-vgpu-vulkan's `rt_platform` and `seam` and
# reims-vgpu's `pool::rt_blocks`.
metal2vulkan-runtime = { git = "https://github.com/steelbrain/metal2vulkan", rev = "06058348cda202e858022fb71890758a23e7aac4" }
metal2vulkan-runtime = { git = "https://github.com/steelbrain/metal2vulkan", rev = "38c5f2e96a662f490779bdf8fe59b474f3f6260d" }
# The hashes of the Vulkan platform's metallib sources (reims-vgpu-vulkan/build.rs).
sha2 = "0.10.9"
# A display window's swapchain on Linux (reims-vgpu-vulkan/src/swapchain.rs), at the runtime's
@@ -73,7 +73,7 @@
//! **Its translations.** Beside the cache's bytes the counts line carries, as amounts, the
//! modules rt's translator lowered, [`TRANSLATIONS_CODE`] (`Metrics::translations`: of a compute
//! content, its partial-threadgroups variant, the plain module of a kernel that observes its
//! threadgroup partition where its state keeps one beside the variant, and an emulated-SIMD-group
//! threadgroup partition, which its state keeps beside the variant, and an emulated-SIMD-group
//! variant; of a render content, each function the cache directory did not hold), and the
//! lowered kernels pipeline states took from the cache directory in their stead,
//! [`TRANSLATIONS_LOADED_CODE`] (`Metrics::translations_loaded`), the render contents' records
@@ -192,21 +192,22 @@
//! it is what shows that a boot's resolves ran.
//!
//! **Its partial-threadgroups variant's grids.** A kernel that observes its threadgroup
//! partition runs every dispatch on its partial-threadgroups variant, whole grids
//! (`dispatchThreads` of whole threadgroups, `dispatchThreadgroups`) and indirect dispatches
//! among them, so rt makes one `VkPipeline` of a size for it, where Metal compiles one function.
//! A dispatch runs the plain module instead where the variant does not take its threadgroup, or
//! where the variant's threadgroup memory, its predicated walk's 4-byte vote word included, passes
//! the device's `maxComputeSharedMemorySize`, decided per dispatch from the encoder's lengths. rt
//! counts the dispatches of whole threadgroups, direct and indirect, that ran the variant
//! (`Metrics::partial_variant_whole_grids`), and the counts line carries them as an amount,
//! [`PARTIAL_VARIANT_WHOLE_GRIDS_CODE`], so a boot's line says how often its whole grids took the
//! variant. A ragged grid, `dispatchThreads` of a grid that is not a whole number of
//! partition runs its whole grids (`dispatchThreads` of whole threadgroups,
//! `dispatchThreadgroups`) and its indirect dispatches on its plain module at their own
//! threadgroup size, and its ragged grids on its partial-threadgroups variant, so rt's state
//! lowers both modules for it, where Metal compiles one function. rt counts the dispatches of
//! whole threadgroups, direct and indirect, that ran the variant
//! (`Metrics::partial_variant_whole_grids`), which none does, and the counts line carries them as
//! an amount, [`PARTIAL_VARIANT_WHOLE_GRIDS_CODE`], so a boot's line shows that its whole grids
//! ran the plain module. A ragged grid, `dispatchThreads` of a grid that is not a whole number of
//! threadgroups, runs only on the variant, its regions flagged so that each threadgroup runs only
//! the grid's threads; one the variant cannot take is rt's refusal (`Gap::PartialThreadgroups`).
//! rt counts the ragged grids that ran the variant apart (`Metrics::partial_variant_ragged_grids`;
//! a refused one counts in neither), and the counts line carries them as an amount too,
//! [`PARTIAL_VARIANT_RAGGED_GRIDS_CODE`], so a boot's line says how many of its ragged grids ran.
//! the grid's threads; one the variant cannot take is rt's refusal (`Gap::PartialThreadgroups`),
//! as is one whose threadgroup memory, the variant's predicated walk's 4-byte vote word included,
//! passes the device's `maxComputeSharedMemorySize`, decided per dispatch from the encoder's
//! lengths. rt counts the ragged grids that ran the variant apart
//! (`Metrics::partial_variant_ragged_grids`; a refused one counts in neither), and the counts line
//! carries them as an amount too, [`PARTIAL_VARIANT_RAGGED_GRIDS_CODE`], so a boot's line says how
//! many of its ragged grids ran.
//!
//! **Its views written through an extended usage.** A texture made for shader writes whose own
//! format the device does not store (an 8-bit sRGB format) is made, where the device's image
@@ -49,16 +49,17 @@
//! the state's finish or by an earlier make.
//! - **Its main pipeline.** rt's make of the state makes everything up to the driver's create of
//! the state's main `VkPipeline` (a tiling kernel's tiles', an image-only kernel's square
//! workgroups', or an observing kernel's whole and ragged grids' at its
//! workgroups', or an observing kernel's two, its plain module's for its whole grids and its
//! partial-threadgroups variant's for its ragged grids, at its
//! `requiredThreadsPerThreadgroup`, or at `[N, 1, 1]` for the bound `N` of threads its state
//! declares), and answers. The state's finish ([`ComputePipeline::finish`]) makes that
//! pipeline, rt's `finish_pipeline`, on the thread that made the state: the device's compile
//! thread, after the create's reply and before its store (reims-vgpu's `graphics::compile`,
//! "Order"). rt counts what the finishes made and their time (`Metrics::finished_pipelines`,
//! `finished_pipeline_nanos`). A finish rt fails, the driver's create, keeps nothing: the
//! state's first dispatch, or a make ahead of it, makes the pipeline again, the dispatch
//! waiting for the make (`Metrics::first_use_unfinished_waits`), and fails as a dispatch rt
//! refuses where that make fails too.
//! pipeline, or that kernel's two, rt's `finish_pipeline`, on the thread that made the state:
//! the device's compile thread, after the create's reply and before its store (reims-vgpu's
//! `graphics::compile`, "Order"). rt counts what the finishes made and their time
//! (`Metrics::finished_pipelines`, `finished_pipeline_nanos`). A finish rt fails, the driver's
//! create, keeps nothing: the state's first dispatch, or a make ahead of it, makes the pipeline
//! again, the dispatch waiting for the make (`Metrics::first_use_unfinished_waits`), and fails
//! as a dispatch rt refuses where that make fails too.
use std::collections::{BTreeMap, HashMap};
use std::sync::Arc;