diff --git a/crates/metal2vulkan-validation/src/bin/command-replay.rs b/crates/metal2vulkan-validation/src/bin/command-replay.rs index a23ae47e8..86b0f2409 100644 --- a/crates/metal2vulkan-validation/src/bin/command-replay.rs +++ b/crates/metal2vulkan-validation/src/bin/command-replay.rs @@ -44,7 +44,9 @@ //! short, `skipped ...` where the backend skipped what its runtime does not build (such a play is //! no gate result), `gaps ...` where it met a typed gap, on the runtime where the play //! finished its range and skipped nothing the matrix's judged metrics (`M2V-MATRIX metric -//! replay-rt/STEM/RANGE/NAME N`, `docs/REPLAY-STREAM.md`, section 10), then `ok`, `ids: ...` or +//! replay-rt/STEM/RANGE/NAME N`, `docs/REPLAY-STREAM.md`, section 10), where it ended frame 200 +//! and skipped nothing by then its gauge records at frames 100 and 200 (`M2V-MATRIX gauge +//! replay-rt/STEM/GAUGE@F N`), then `ok`, `ids: ...` or //! `error WHAT`, the skipped line and this one ending `; not a verdict past frame F, call C` where //! the backend skipped anything (`F` and `C` the first skip's frame and stream position); a play //! that ends where an object's ID differs, the compute pipeline states' typed gap aside, ends @@ -119,10 +121,10 @@ use metal2vulkan_validation::gpu::wait::{parse_wait_timeout, set_wait_timeout, WAIT_TIMEOUT_FLAG}; use metal2vulkan_validation::gpu::DeviceType; use metal2vulkan_validation::replay::{ - compare_dumps, compare_plays, display_library, judged_records, recording_range, segments, - shown_differences, Backend, CommandBufferList, ManagedCopies, NewRuntime, PlayError, Player, - RangeSource, RecordingRange, StreamError, StreamReader, StreamWriter, Value, VideoHandle, - FLAG_COMPLETION_BYTES_RECORDED, RECORDED_RANGES, + compare_dumps, compare_plays, display_library, gauge_records, judged_records, recording_range, + segments, shown_differences, Backend, CommandBufferList, ManagedCopies, NewRuntime, PlayError, + Player, RangeSource, RecordingRange, StreamError, StreamReader, StreamWriter, Value, + VideoHandle, FLAG_COMPLETION_BYTES_RECORDED, RECORDED_RANGES, }; use std::collections::{BTreeMap, HashSet}; use std::io::Write as _; @@ -802,7 +804,8 @@ type Presents = (Vec, PathBuf); /// keeping its bytes in the directory given, and on the runtime, /// where `judged` /// names the stream's first segment, writing the matrix's judged metrics of a play that finished -/// its range (`judged_records`): the exit status. +/// its range (`judged_records`) and its gauge records at frames 100 and 200 (`gauge_records`): the +/// exit status. fn run( backend: &mut B, reader: &mut StreamReader, @@ -892,6 +895,9 @@ fn run( for line in judged_records(first, &played, &ended, until) { report.line(&line); } + for line in gauge_records(first, &played) { + report.line(&line); + } } match ended { // Played to the end, the IDs a shader reads differing from the program's: no fault, hang diff --git a/crates/metal2vulkan-validation/src/replay/mod.rs b/crates/metal2vulkan-validation/src/replay/mod.rs index 0fa410a0c..3d441ef82 100644 --- a/crates/metal2vulkan-validation/src/replay/mod.rs +++ b/crates/metal2vulkan-validation/src/replay/mod.rs @@ -24,13 +24,15 @@ mod value; pub use compare::{compare_plays, shown_differences}; pub use covers::SlotStage; pub use dumps::{compare_dumps, CommandBufferList, Comparison, Difference, Part}; -pub use new_runtime::{judged_records, Ended, ManagedCopies, NewRuntime, VideoHandle}; +pub use new_runtime::{ + gauge_records, judged_records, Ended, ManagedCopies, NewRuntime, VideoHandle, GAUGED, +}; pub use pixels::Shape; -pub use player::WAIT_COMPLETED; pub use player::{ Backend, Check, Counters, Counts, End, IdDiffers, Made, ManagedReads, PlayError, Player, ReadClass, ReadCopy, Relaid, Report, Shown, TextureWrites, }; +pub use player::{GAUGE_FRAMES, WAIT_COMPLETED}; pub use prepass::{Ahead, AheadGrid}; pub use range::{ display_library, recording_range, sidecar, RangeRow, RangeSource, RecordingRange, diff --git a/crates/metal2vulkan-validation/src/replay/new_runtime/judged.rs b/crates/metal2vulkan-validation/src/replay/new_runtime/judged.rs index 81bba38ca..7e5ef9ec4 100644 --- a/crates/metal2vulkan-validation/src/replay/new_runtime/judged.rs +++ b/crates/metal2vulkan-validation/src/replay/new_runtime/judged.rs @@ -2,12 +2,58 @@ //! counts two plays of one stream at one commit on one card give alike, summed over the whole //! play as the runtime executed it, each an `M2V-MATRIX metric` record that the matrix holds equal //! to its base's (`docs/VALIDATION.md`, "Records and rules"). A play that did not finish its range -//! gives none, so the base's records it lacks fail it. +//! gives none, so the base's records it lacks fail it. And the matrix's gauge records of a play: +//! each kind of object the runtime keeps live, at the ends of frames 100 and 200, which the +//! matrix holds flat. -use crate::replay::player::{PlayError, Report}; +use crate::replay::player::{PlayError, Report, GAUGE_FRAMES}; use crate::replay::range::stem; use std::path::Path; +/// The gauges of a play's end lines (`Backend::live`) that its gauge records carry +/// ([`gauge_records`]): each a count of one kind of object the runtime keeps live, which the +/// matrix holds equal at frames 100 and 200 (`blocks`, the memory pool's allocations, no higher +/// at 200), as it holds the harness's between its 100th and 200th runs. Left out: +/// `handles_out`, 1 while the play holds the device; `releases_waiting`, which the runtime's +/// block-maker thread lowers as the work before each release retires, whenever it runs; +/// `private_units`, the pool's allocations that hold the Private blocks taken, a layout of memory +/// that follows the bytes the program holds; and every byte and age gauge, which follows the +/// program's content and the pool's idle clock (the pipeline cache's data, within its bound of +/// 128 MiB; the translator's entries' bytes, within 64 MiB; the staging bytes; the allocations', +/// takes' and blocks' bytes, idle, reserved or in use; the shadows', resolve images' and stand-ins' +/// bytes, whose counts are here). +pub const GAUGED: [&str; 29] = [ + "blocks", + "imports", + "exports", + "surface_imports", + "surface_buffers", + "buffers", + "textures", + "textures_copied_over", + "samplers", + "lod_clamp_variants", + "level_elements", + "pipelines", + "kernels", + "kernel_variants", + "kernel_entries", + "render_contents", + "attachment_views", + "command_buffers", + "descriptor_slots", + "events", + "device_samplers", + "shadows", + "resolve_images", + "plane_stand_ins", + "timestamp_pools", + "occlusion_pools", + "buffer_set_pools", + "indirect_command_buffers", + "stage_entries", +]; + /// Each judged metric: its name, the executed counters it adds and the one it takes away. A new /// texture is zeroed by a clear, and the barriers leave out the one after an upload's clears /// (`texture_clear_barriers`). @@ -53,3 +99,28 @@ pub fn judged_records( }); records.collect() } + +/// The gauge records of the play of the stream whose first segment is `first`, with `report`, one +/// line each: `M2V-MATRIX gauge replay-rt/STEM/GAUGE@F N`, `STEM` as [`judged_records`] has it, +/// for each gauge of [`GAUGED`] at the end of each frame `F` of [`GAUGE_FRAMES`], read once the +/// gauges held still (`Backend::settled_live`). A play that ended no frame 200, and one whose +/// backend skipped anything by then, give none. +pub fn gauge_records(first: &Path, report: &Report) -> Vec { + let last = GAUGE_FRAMES[GAUGE_FRAMES.len() - 1]; + let skipped = (report.first_skip).is_some_and(|(frame, _)| frame <= last as u64); + if report.ends.len() <= last || skipped { + return Vec::new(); + } + let stream = stem(first).replace(char::is_whitespace, "_"); + let stream = &stream; + let records = GAUGE_FRAMES.iter().flat_map(|&frame| { + let live = &report.ends[frame].live; + GAUGED.iter().filter_map(move |&gauge| { + let value = live.get(gauge)?; + Some(format!( + "M2V-MATRIX gauge replay-rt/{stream}/{gauge}@{frame} {value}" + )) + }) + }); + records.collect() +} diff --git a/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs b/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs index b6aba7424..c2a92f788 100644 --- a/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs +++ b/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs @@ -86,7 +86,7 @@ pub(super) mod unwritten; mod videos; pub(super) use exported::{LANDINGS, MAKINGS, PARTS, UNJUDGED}; -pub use judged::judged_records; +pub use judged::{gauge_records, judged_records, GAUGED}; use super::args::{arg, data, metal, option_sets, refuse, uint, variant, Fields}; use super::covers::SlotStage; @@ -936,6 +936,12 @@ fn texture_class(pf: rt::PixelFormat, usage: rt::TextureUsage) -> Option Counters { + let deadline = std::time::Instant::now() + SETTLE_LIMIT; + let mut live = self.live(); + while std::time::Instant::now() < deadline { + std::thread::sleep(SETTLE_STEP); + let next = self.live(); + let still = (judged::GAUGED.iter()).all(|&gauge| live.get(gauge) == next.get(gauge)); + let waiting = next.get("releases_waiting").copied().unwrap_or(0); + live = next; + if still && waiting == 0 { + break; + } + } + live + } + /// A `pipeline I wall_nanos=N kernel=new|again` line for each compute pipeline state made, in /// order: its making's wall time, and whether its kernel was new to the play. Where the makes /// were written or pooled (`with_states`), the `states` line after the pool made every state diff --git a/crates/metal2vulkan-validation/src/replay/player.rs b/crates/metal2vulkan-validation/src/replay/player.rs index 27b537828..0dd875d94 100644 --- a/crates/metal2vulkan-validation/src/replay/player.rs +++ b/crates/metal2vulkan-validation/src/replay/player.rs @@ -27,6 +27,11 @@ use std::time::{SystemTime, UNIX_EPOCH}; /// A runtime's counters, cumulative, by name. pub type Counters = BTreeMap<&'static str, u64>; +/// The frames (counted from 0) at whose end the player reads the runtime's gauges once they hold +/// still ([`Backend::settled_live`]): a play's loop iterations 100 and 200, between which the +/// matrix holds each kind of object the runtime keeps live flat (`gauge_records`). +pub const GAUGE_FRAMES: [usize; 2] = [100, 200]; + /// The counts the stream fixes, the same on every play of it on any runtime: the calls played, /// the command buffers committed, the encoders made, the draws, dispatches and blit commands /// their calls issued, the buffer slots their set-buffer calls set (`binds`), the address-looking @@ -165,6 +170,14 @@ pub trait Backend { /// (`Report::ends`), never as growth. fn live(&mut self) -> Counters; + /// The runtime's gauges once what its own threads free after the frame's work retired has + /// gone, which the end of each frame of [`GAUGE_FRAMES`] reports, so that two plays of one + /// stream read them alike there. A backend whose gauges move on no thread of its own reads + /// them now. + fn settled_live(&mut self) -> Counters { + self.live() + } + /// What the backend skipped so far, of every kind, in one count: the player notes the frame /// and call where it first grows (`Report::first_skip`). A backend that skips nothing answers /// 0. @@ -1602,13 +1615,26 @@ impl<'b, B: Backend> Player<'b, B> { times.gpu_busy = covered(&mut self.intervals); self.times = Times::default(); self.intervals.clear(); + let unix_nanos = (SystemTime::now().duration_since(UNIX_EPOCH)) + .map_or(0, |since| { + u64::try_from(since.as_nanos()).unwrap_or(u64::MAX) + }); + let resident_bytes = resident_bytes(); + // At the matrix's frames the gauges are read once they hold still, a wait of the + // player's own that no frame's time holds. + let live = match GAUGE_FRAMES.contains(&(frame as usize)) { + true => { + let live = self.backend.settled_live(); + self.frame_began = Some(std::time::Instant::now()); + live + } + false => self.backend.live(), + }; self.report.ends.push(End { wall_nanos: u64::try_from((now - began).as_nanos()).unwrap_or(u64::MAX), - unix_nanos: (SystemTime::now().duration_since(UNIX_EPOCH)).map_or(0, |since| { - u64::try_from(since.as_nanos()).unwrap_or(u64::MAX) - }), - resident_bytes: resident_bytes(), - live: self.backend.live(), + unix_nanos, + resident_bytes, + live, times, }); if let Some(out) = &mut self.frame_out { diff --git a/crates/metal2vulkan-validation/src/replay/rt_replay.rs b/crates/metal2vulkan-validation/src/replay/rt_replay.rs index 05f16773c..80f14d2c0 100644 --- a/crates/metal2vulkan-validation/src/replay/rt_replay.rs +++ b/crates/metal2vulkan-validation/src/replay/rt_replay.rs @@ -144,7 +144,7 @@ use crate::candidate::LayerOn; use crate::gpu::{self, DeviceType}; use crate::replay::{ Backend, CommandBufferList, NewRuntime, PlayError, Player, ReadCopy, Report, StreamReader, - StreamWriter, Value, WAIT_COMPLETED, + StreamWriter, Value, GAUGED, WAIT_COMPLETED, }; use crate::ScratchDir; use metal2vulkan_devtools::metallib::{metallib, wrap, MtlbFunction}; @@ -3344,6 +3344,21 @@ fn an_index_released_after_a_held_commit_is_kept_back_though_it_names_nothing() kept_back("held-unnamed", &held_placement(&dir, other, Held::Unnamed)); } +/// The runtime backend's end lines carry every gauge the matrix's gauge records of a play carry +/// (`GAUGED`), as they stand and once they hold still (`Backend::settled_live`). +#[test] +fn the_end_lines_carry_every_gauge_the_gauge_records_carry() { + let cache = ScratchCache::new().unwrap(); + let mut backend = NewRuntime::new(rt_device(&cache), gpu::TEST_DEVICE).unwrap(); + for live in [backend.live(), backend.settled_live()] { + let missing: Vec<&str> = (GAUGED.iter().copied()) + .filter(|gauge| !live.contains_key(gauge)) + .collect(); + assert!(missing.is_empty(), "gauges the end lines lack: {missing:?}"); + } + backend.end().result().unwrap(); +} + /// A play that ends with a command buffer held on an event no record signals still ends its /// device: once it dropped, every gauge reads zero, and each goes out as the matrix's line, /// `M2V-MATRIX gauge KEY@drop 0`. diff --git a/crates/metal2vulkan-validation/src/replay/tests.rs b/crates/metal2vulkan-validation/src/replay/tests.rs index ac6b6493c..64274a619 100644 --- a/crates/metal2vulkan-validation/src/replay/tests.rs +++ b/crates/metal2vulkan-validation/src/replay/tests.rs @@ -9,11 +9,11 @@ use super::new_runtime::indices::Indices; use super::new_runtime::places::Waiting; use super::new_runtime::second::merge; use super::new_runtime::unwritten::Unwritten; -use super::new_runtime::{judged_records, Ended}; +use super::new_runtime::{gauge_records, judged_records, Ended}; use super::pixels::{difference, Shape}; use super::player::{ - Backend, Counters, Counts, IdDiffers, Made, PlayError, Player, ReadCopy, Relaid, Report, Shown, - TextureWrites, WAIT_COMPLETED, + Backend, Counters, Counts, End, IdDiffers, Made, PlayError, Player, ReadCopy, Relaid, Report, + Shown, TextureWrites, GAUGE_FRAMES, WAIT_COMPLETED, }; use super::stream::{segments, Call, StreamError, StreamReader, StreamWriter}; use super::value::{hex, Value}; @@ -578,6 +578,8 @@ struct Kept { /// Whether it skips every draw, and the draws it skipped. skips_draws: bool, skipped: u64, + /// The settled reads of its gauges it was asked (`Backend::settled_live`). + settled: u64, /// The frame and position of each call it was told it plays next. located: Vec<(u64, u64)>, /// The texture slots each compute pipeline state's kernel writes; one not here answers none. @@ -720,6 +722,13 @@ impl Backend for Kept { Counters::from([("calls", self.calls.len() as u64)]) } + fn settled_live(&mut self) -> Counters { + self.settled += 1; + let mut live = self.live(); + live.insert("settled", self.settled); + live + } + fn recorded_unified_memory(&mut self, unified: bool) { self.unified = Some(unified); } @@ -900,6 +909,65 @@ fn a_short_play_gives_no_judged_metric() { assert_eq!(judged_records(first, &report, &ended, None), none); } +/// The player reads the gauges once they hold still at the ends of frames 100 and 200 alone +/// (`Backend::settled_live`), and every other frame's as they stand. +#[test] +fn the_player_settles_the_gauges_at_frames_100_and_200_alone() { + let mut kept = Kept::default(); + let (report, ended) = played(&mut kept, |w| { + w.call("MTLCreateSystemDefaultDevice", 0, 1, &[], &[])?; + for _ in 0..=GAUGE_FRAMES[1] { + w.call("m2v.present", 1, 0, &[Value::Nil], &[])?; + } + Ok(()) + }); + ended.as_ref().unwrap(); + assert_eq!((report.ends.len(), kept.settled), (201, 2)); + let settled: Vec<(usize, u64)> = (report.ends.iter().enumerate()) + .filter_map(|(frame, end)| Some((frame, *end.live.get("settled")?))) + .collect(); + assert_eq!(settled, [(100, 1), (200, 2)]); +} + +/// The matrix's gauge records of a play are its end lines' counts of the kinds the matrix holds +/// flat, at frames 100 and 200, under the stream's first segment's stem (whitespace made `_`): +/// `M2V-MATRIX gauge replay-rt/STEM/GAUGE@F N`, in the kinds' order, a kind the backend does not +/// report left out, and no other gauge (here `handles_out` and `shadow_bytes`). A play that ended +/// no frame 200, and one whose backend skipped anything by then, give none. +#[test] +fn the_gauge_records_are_the_counted_kinds_at_frames_100_and_200() { + let first = std::path::Path::new("streams/a b.0000.m2vr"); + let live = |textures: u64| { + Counters::from([ + ("textures", textures), + ("blocks", 2), + ("handles_out", 1), + ("shadow_bytes", textures * 64), + ]) + }; + let mut report = Report { + ends: vec![End::default(); 201], + ..Report::default() + }; + report.ends[100].live = live(3); + report.ends[200].live = live(4); + let records = [ + "M2V-MATRIX gauge replay-rt/a_b/blocks@100 2", + "M2V-MATRIX gauge replay-rt/a_b/textures@100 3", + "M2V-MATRIX gauge replay-rt/a_b/blocks@200 2", + "M2V-MATRIX gauge replay-rt/a_b/textures@200 4", + ]; + assert_eq!(gauge_records(first, &report), records); + report.first_skip = Some((201, 7)); + assert_eq!(gauge_records(first, &report), records); + let none: [String; 0] = []; + report.first_skip = Some((200, 7)); + assert_eq!(gauge_records(first, &report), none); + report.first_skip = None; + report.ends.truncate(200); + assert_eq!(gauge_records(first, &report), none); +} + /// The gauges the runtime's backend reads once its device dropped go out as the matrix's /// lines, `M2V-MATRIX gauge replay-rt/device/GAUGE@drop N`: three fields after the marker, the /// key ending in `@drop`, as `scripts/matrix/results.py` reads a record, whose rule fails a gauge diff --git a/docs/REPLAY-STREAM.md b/docs/REPLAY-STREAM.md index 1dc7ad2a6..fb32d3b0c 100644 --- a/docs/REPLAY-STREAM.md +++ b/docs/REPLAY-STREAM.md @@ -1129,13 +1129,21 @@ union of the GPU intervals of the command buffers the frame waited for, where th them, which runs beside the rest, then `gpu_longest` and `gpu_longest_cb`, the longest of those intervals, one command buffer's, and that command buffer's stream id (the first of equal ones; 0 and 0 where the runtime gives none); and the backend's gauges then, as they stand, never as growth: -the runtime's live blocks, buffers, textures, pipelines, kernels, command buffers, timestamp and -occlusion query pools, spilled bytes, Managed buffers' +the runtime's live blocks, imports, exports, surface imports, surface buffers, buffers, textures and +those copied over, samplers, LOD clamp variants, level elements, pipelines, kernels, kernel +variants and entries, render contents, attachment views, command buffers, descriptor slots, +events, device samplers, shadows, resolve images, plane stand-ins, timestamp, occlusion and buffer +set pools, indirect command buffers, releases waiting, handles out, the pipeline cache's bytes, +spilled bytes, Managed buffers' spilled bytes (`managed_spilled_bytes`: the bytes of those whose GPU copy the player placed in a -spilled Private block) and idle Shared and -Private bytes the pool keeps, and the bytes +spilled Private block), the pool's Shared and Private bytes allocated, idle (and the idle ones' +ages), reserved and reused long, its Private units and their bytes used, the texture blocks' +bytes and those held, the Private takes' bytes and those held, the textures' own allocations' +bytes, the staging bytes, the translator's entries and their bytes, and the bytes of the blocks the backend holds for the stream by class, `shared_block_bytes` and -`private_block_bytes`), +`private_block_bytes`; at the ends of frames 100 and 200, the gauges once they hold still: read +every 10 ms until no release waits and two reads in a row agree on every kind the gauge records +below carry, for at most 2 seconds, a wait of the player's own that no frame's time holds), `devices apart from the guest's: #ID ...` where the stream recorded devices besides the one the guest makes its objects on (section 4), `check ID frame F SHA256 match|differs|unrecorded|covered|receiver` (`F` the frame it was read in, the presents played before it), ending `(CPU copy)` or `(device copy, read back)` for a buffer with two copies (above), `id ID RECORDED PLAYED` for each object whose runtime gives another `gpuResourceID` than the program saw (both in hex, `PLAYED` `none` where the @@ -1251,7 +1259,19 @@ metric replay-rt/STEM/RANGE/NAME N` (`STEM` the first segment's stem, whitespace `new_texture_zeroed_bytes`, their bytes), each one two plays of one stream at one commit on one card gave alike, which the matrix's rule (`scripts/matrix/results.py`) holds equal to the base's, failing a play whose base has a record it lacks; a play that did not finish its range -prints none, +prints none; where the play ended frame 200 and the backend skipped nothing by then, the matrix's +gauge records, one line each, `M2V-MATRIX gauge replay-rt/STEM/GAUGE@F N` for `F` 100 and 200 and +each count of a kind of object the runtime keeps live on the frame's `end` line (its blocks, +imports, exports, surface imports, surface buffers, buffers, textures and those copied over, samplers, +LOD clamp variants, level elements, pipelines, kernels, kernel variants and entries, render +contents, attachment views, command buffers, descriptor slots, events, device samplers, shadows, +resolve images, plane stand-ins, timestamp, occlusion and buffer set pools, indirect command +buffers and the translator's entries), which the matrix's rule holds equal between the two +frames (`blocks`, the pool's allocations, no higher at 200), as it holds the harness's between +its 100th and 200th runs; the handles out (1 while the play holds the device), the releases +waiting (which the runtime's own thread lowers whenever it runs), the Private units (a layout of +memory that follows the bytes the program holds) and every byte and age gauge (which follow the +program's content and the pool's idle clock) are not records, then `ok`, `ids: played to the end; N objects' gpuResourceID differ from the recording's` where the play ended but objects whose ID the program saw have other IDs in the runtime, or `error WHAT`. Where the backend skipped anything, the `skipped` line and the last diff --git a/docs/VALIDATION.md b/docs/VALIDATION.md index 00f9efe33..bf3fe710a 100644 --- a/docs/VALIDATION.md +++ b/docs/VALIDATION.md @@ -283,7 +283,7 @@ changes the harness sets the base for the next. |---|---|---| | `metric` | A deterministic count per frame or per command buffer: submissions, passes, barriers, bytes copied, pipelines created; and the replay player's totals of a play (`replay-rt/STREAM/RANGE/NAME`, [REPLAY-STREAM.md](REPLAY-STREAM.md) section 10), each one two plays of one stream at one commit on one card gave alike, printed only by a play that finished its range and skipped nothing | It is larger than the base's; a replay total, when it differs from the base's either way, or when the base has it and the leg does not (`EQUAL_METRICS`) | | `instructions` | User-space CPU instructions per draw or per dispatch, and per harness run, the p50 over the row's timed runs: the whole process's (`harness-//per_run`), and where the runtime names its threads, theirs with the harness's thread (`.../own_per_run`) and the rest, a driver's own threads (`.../others_per_run`) | It is more than 1% over the base's; the harness's counts are judged by the instructions gate instead (below) | -| `gauge` | Live objects of one resource kind, the key ending in the point it was read at: `@100` and `@200` (loop iterations), `@drop` (after the device dropped) | `@drop` is not 0, or `@200` differs from `@100`; for the memory pool's `blocks`, which frees allocations an earlier workload left idle once the most bytes in use over its window falls and the device is quiet for 20 ms, only `@200` over `@100` | +| `gauge` | Live objects of one resource kind, the key ending in the point it was read at: `@100` and `@200` (loop iterations: the harness's 100th and 200th runs, and a play's frames 100 and 200, `replay-rt/STREAM/GAUGE`, [REPLAY-STREAM.md](REPLAY-STREAM.md) section 10), `@drop` (after the device dropped) | `@drop` is not 0, or `@200` differs from `@100`; for the memory pool's `blocks`, which frees allocations an earlier workload left idle once the most bytes in use over its window falls and the device is quiet for 20 ms, only `@200` over `@100` | | `time` | A duration in microseconds: what a program waits on in a harness workload's run, timed on the host: for the frame rows (`frame`, `frame_5cb`), their throughput, two runs in flight, from one run's last completed handler to the next's, and their latency from idle as rows of their own (`_from_idle`), one run in flight, from its first commit to its last completed handler; for another workload that times its command buffers, its last command buffer's commit-to-complete time (the others' lateness is a column of the harness's table and no record), else the host wall time a run adds (a run's GPU time is a record of its own, `harness-gpu-/`, parked here) | Only as a cross-GPU outlier: its ratio to the base's is more than 1.25 times the median of that ratio over at least 3 GPUs. A leg with such an outlier of a harness row's time has its harness timed once more after every leg is in, and an outlier fails the leg only where both passes agree | | `size` | The size a harness row whose size follows the device ran at (`long_4cb`) | Never: it says what work the row's times measured | | `locks` | The lock budget's locked instructions per million added commands (`lock_budget/draw`, `lock_budget/bound_draw`, `lock_budget/dispatch`; rt's `tests::locks`), the whole process's in user space, on a node whose matrix setup names its CPU's event in `M2V_LOCK_EVENT` (`cpu_core/r21d0`, `r1e25`) | The test fails past 0.25 per added command, on every node alike; on a node whose setup names the event, a GPU leg missing any of the three fails; elsewhere each budget test passes counting nothing and prints `M2V-MATRIX uncounted lock_budget/`, which the leg's line shows as `not counted` | diff --git a/scripts/matrix/test_results.py b/scripts/matrix/test_results.py index 65540a582..5e048bd65 100644 --- a/scripts/matrix/test_results.py +++ b/scripts/matrix/test_results.py @@ -172,6 +172,13 @@ class RuleTests(unittest.TestCase): "gauge harness-new/creates/device/blocks: 1 live at device drop", "gauge harness-new/long_4cb/blocks: 8 at iteration 100, 9 at 200"]) + def test_a_plays_gauges_at_frames_100_and_200_are_held_flat_as_the_harness_s(self): + play = {"replay-rt/s/textures@100": 40, "replay-rt/s/textures@200": 41, + "replay-rt/s/blocks@100": 9, "replay-rt/s/blocks@200": 8, + "replay-rt/s/render_contents@100": 5, "replay-rt/s/render_contents@200": 5} + self.assertEqual(self.problems(recs(gauge=play), None), + ["gauge replay-rt/s/textures: 40 at iteration 100, 41 at 200"]) + def test_a_failed_suite_fails_the_leg(self): leg = leg_of(recs(), code=100) self.assertEqual(results.leg_problems(leg, recs(), None), ["suite rt exited 100"])