From 0fa1b8f14cd421a58d1b569f616e78e4fa57b8d4 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 19 Nov 2026 07:31:00 -0800 Subject: [PATCH] conformance: case 6's declaration says why rt reads 1024 and that Metal's 0 was measured A reader of "0 or 1024" could take it for a race in rt. The docs/API.md entry and the case's comment now say why 1024 is rt's answer (a writer whose queue has fewer than three submissions in flight is submitted at once, so the later reader reads it on every device and run), and that Metal's 0 there was measured on the M3 Max (jobs m3-max-52432 and, behind three, m3-max-52415), not documented. The entry's lead-in, and so its slug, is unchanged. Verified: in the jobs named in the landing's report. --- .../src/cases/fence_orders.rs | 18 +++++++++------- docs/API.md | 21 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/crates/metal2vulkan-conformance/src/cases/fence_orders.rs b/crates/metal2vulkan-conformance/src/cases/fence_orders.rs index 177a269e6..cd337d05c 100644 --- a/crates/metal2vulkan-conformance/src/cases/fence_orders.rs +++ b/crates/metal2vulkan-conformance/src/cases/fence_orders.rs @@ -16,9 +16,9 @@ //! the updater committed behind none, one or three busy command buffers of its queue: what //! Metal's hazard tracking orders between two queues by itself. Behind one or three, the M3 Max //! ran the waiter without the updater's words: its tracking orders only against work already -//! submitted. Behind one, the new runtime submits the updater at once, as its queue holds nothing -//! back, and the waiter copies every word; [`TRACKED_BEHIND_ONE`] declares that count on its run -//! (docs/API.md section 10). +//! submitted, as measured there, not documented. Behind one, the new runtime submits the updater +//! at once, as its queue has fewer than three submissions in flight, and the waiter copies every +//! word; [`TRACKED_BEHIND_ONE`] declares that count on its run (docs/API.md section 10). //! //! The first three are the answers the probe `probes/cross_queue_fence_held_update.m` measured //! with compute dispatches on an Apple M3 Max under macOS 27.0.1; the recordings hold what Metal @@ -96,11 +96,13 @@ impl Case for FenceOrderCase { // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices // site alone: every word count and status still compares exactly. let mut allowances = vec![crate::replay::shared_memory_notice()]; - // Behind one busy command buffer, Metal's answer is timing: its tracking orders the copy - // only after work already submitted, and it ran the copy first. The new runtime submits - // the fill at once, as its queue holds nothing back, and the copy reads all of it, the - // order Apple describes for a tracked write (docs/API.md section 10). Either count holds; - // the statuses still compare exactly. + // Behind one busy command buffer, the new runtime's 1024 is its structure: a writer whose + // queue has fewer than three submissions in flight is submitted at once, so the later copy + // on another queue reads every word, on every device and run, the order Apple describes + // for a tracked write. Metal's 0 is measured, not documented: on the M3 Max (macOS + // 27.0.1) the copy ran first in 5 runs of 5 (job m3-max-52432), its tracking ordering only + // against work already submitted (docs/API.md section 10). Either count holds on the new + // runtime's run; the statuses still compare exactly. if self.name == TRACKED_BEHIND_ONE { allowances.push(Allowance::new( "case/order/y/words-written", diff --git a/docs/API.md b/docs/API.md index 06798ea47..4394b448f 100644 --- a/docs/API.md +++ b/docs/API.md @@ -6789,13 +6789,14 @@ each item named states the rule in full. **Command queues** - **A write whose queue holds nothing back is seen by another queue's command buffer committed - after it** (`metal2vulkan-rt`). The runtime submits a queue's command buffer at once while fewer - than three of the queue's submissions run, ahead of every command buffer committed after it on - any queue, so a later reader on another queue sees the write, as Apple describes a tracked - resource: the framework prevents subsequent commands from running until write operations finish. - Metal's tracking orders only against work it has already submitted: on an M3 Max with macOS - 27.0.1, a blit fill of a tracked buffer committed behind one long command buffer of its queue ran - after a copy of that buffer on another queue committed after it, which read none of the fill in 5 - runs of 5 (job m3-max-52432; the conformance case `fence-none-tracked-behind-one`). The runtime's - README states what was measured (`crates/metal2vulkan-rt/README.md`, "Queues, command buffers and - events"). + after it** (`metal2vulkan-rt`). A writer whose queue has fewer than three submissions in flight + is submitted at once, ahead of every command buffer committed after it on any queue, so a later + reader on another queue reads the write, on every device and every run: all 1024 words in the + conformance case `fence-none-tracked-behind-one`, whose writer's queue has one busy command + buffer in flight. That is the order Apple describes for a tracked resource: the framework + prevents subsequent commands from running until write operations finish. Metal's 0 words there + is measured, not documented: on an M3 Max with macOS 27.0.1, the copy on the other queue ran + before the fill and read none of it in 5 runs of 5 (job m3-max-52432), and behind three busy + command buffers likewise (job m3-max-52415); Metal's tracking ordered the copy only against work + it had already submitted. The runtime's README states what was measured + (`crates/metal2vulkan-rt/README.md`, "Queues, command buffers and events").