Crash report names the indirect executions a list stopped at; constant buffer slots hold their scratch memory
Both device losses of 2026-11-25 (play-1125-0203, n02) stopped at the same place, found by the run of three indirect executions between barriers in the captures: compute 0452fc2d2e2fc4c3 (meshlet culling), behind fc5e66f8f873d3bb. - With device-removed data on (DRED=light too) each list keeps, per indirect execution, the pipeline and the first 16 dwords of user data; the report says them for the stopped commands, and what the heap slots they name hold. - A dynamic slot that shows a constant buffer in a list's scratch chunk holds that chunk (n02: the fault was in the memory of three freed chunks). VICTORY_SLOT_HOLDS=0: not held, as before. - A slot's resource is let go after its descriptor is written over, not before; the same resource again is not retired. - indirect::tests::raw_loads_past_views (ignored, a measurement): on the RX 7900 XTX raw loads through typed, structured and constant buffer views have no end: they read whatever lies after the view. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
0abcb9fd89
commit
c3830a5d36
7 files changed
+411
-15
No files matched your search
@@ -0,0 +1,127 @@
|
||||
//! What the indirect executions of a list ran, for the report of a removed
|
||||
//! device: with `VICTORY_D3D12_DRED=light` the lists carry no markers, and
|
||||
//! the two device losses of 2026-11-25 (sessions play-1125-0203 and n02)
|
||||
//! said only that a list of 814 (954) commands stopped at an indirect
|
||||
//! execution. The pipeline of each was found hours later by finding the
|
||||
//! same run of commands in a capture.
|
||||
//!
|
||||
//! Per list, in the order recorded: the pipeline (by its host object, whose
|
||||
//! name is kept once) and the first root constants (user data) it had. The
|
||||
//! report finds an indirect execution by how many the breadcrumbs' history
|
||||
//! has before it. Nothing is kept without device-removed data.
|
||||
//! `VICTORY_D3D12_DRED=faults` and no data at all: nothing is noted.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
/// Words of user data kept of each execution.
|
||||
pub(crate) const WORDS: usize = 16;
|
||||
|
||||
/// One indirect execution.
|
||||
#[derive(Clone, Copy)]
|
||||
pub(crate) struct Ran {
|
||||
pipeline: usize,
|
||||
kind: u32,
|
||||
count: u32,
|
||||
words: [u32; WORDS],
|
||||
used: u8,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct Indirects {
|
||||
names: HashMap<usize, String>,
|
||||
ran: Vec<Ran>,
|
||||
}
|
||||
|
||||
/// A list's, shared with the report's table of lists.
|
||||
pub(crate) type Shared = Arc<Mutex<Indirects>>;
|
||||
|
||||
impl Indirects {
|
||||
/// An indirect execution of `kind` (the argument's type) of at most
|
||||
/// `count` records with `pipeline` (a host object) and user data.
|
||||
pub(crate) fn note(&mut self, pipeline: usize, name: &str, kind: u32, count: u32, user: &[u32]) {
|
||||
self.names.entry(pipeline).or_insert_with(|| name.to_owned());
|
||||
let used = user.len().min(WORDS);
|
||||
let mut words = [0; WORDS];
|
||||
words[..used].copy_from_slice(&user[..used]);
|
||||
self.ran.push(Ran { pipeline, kind, count, words, used: used as u8 });
|
||||
}
|
||||
|
||||
pub(crate) fn clear(&mut self) {
|
||||
self.ran.clear();
|
||||
if self.names.len() > 512 {
|
||||
self.names.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/// The `nth` execution (from 0): its text and its user data.
|
||||
pub(crate) fn nth(&self, nth: usize) -> Option<(String, &[u32])> {
|
||||
let ran = self.ran.get(nth)?;
|
||||
let name = self.names.get(&ran.pipeline).map_or("a pipeline", String::as_str);
|
||||
let words = &ran.words[..usize::from(ran.used)];
|
||||
Some((
|
||||
format!("{name} (indirect kind {} max {}, the list's indirect execution {nth}, user data {words:x?})", ran.kind, ran.count),
|
||||
words,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
/// How many indirect executions come before command `at` of a history of
|
||||
/// breadcrumb operations (`is` tells them): which of a list's it is.
|
||||
pub(crate) fn before<T>(history: &[T], at: usize, is: impl Fn(&T) -> bool) -> usize {
|
||||
history[..at.min(history.len())].iter().filter(|op| is(op)).count()
|
||||
}
|
||||
|
||||
/// The heap slots the user data may name, for the report to describe: the
|
||||
/// words that are slots as they are, and the slots from where a word is a
|
||||
/// table's byte offset (32 bytes a descriptor), `table` of them.
|
||||
pub(crate) fn slots(words: &[u32], count: u32, table: u32) -> Vec<(usize, u32)> {
|
||||
let mut out = Vec::new();
|
||||
for (i, &word) in words.iter().enumerate() {
|
||||
if word > 0 && word < count && word % 32 != 0 {
|
||||
out.push((i, word));
|
||||
}
|
||||
if word % 32 == 0 && word / 32 > 16 && word / 32 < count {
|
||||
out.extend((0..table).map(|k| (i, word / 32 + k)).filter(|s| s.1 < count));
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// The execution a breadcrumb history stops at is found by the ones
|
||||
/// before it, and its pipeline and user data are told.
|
||||
#[test]
|
||||
fn an_indirect_execution_is_found_by_its_place_in_the_history() {
|
||||
let mut all = Indirects::default();
|
||||
all.note(1, "[compute a]", 2, 1, &[0x2549f40, 0x20, 0x11]);
|
||||
all.note(2, "[compute b]", 2, 1, &[7; 20]);
|
||||
all.note(1, "another name of the same is not taken", 10, 4, &[]);
|
||||
// dispatch, indirect, barrier, indirect, indirect
|
||||
let history = [6, 5, 15, 5, 5];
|
||||
let nth = before(&history, 3, |op| *op == 5);
|
||||
assert_eq!(nth, 1);
|
||||
let (text, words) = all.nth(nth).unwrap();
|
||||
assert!(text.starts_with("[compute b] (indirect kind 2 max 1"), "{text}");
|
||||
assert_eq!(words, [7; WORDS]);
|
||||
let (text, words) = all.nth(2).unwrap();
|
||||
assert!(text.starts_with("[compute a] (indirect kind 10 max 4"), "{text}");
|
||||
assert!(words.is_empty());
|
||||
assert!(all.nth(3).is_none());
|
||||
assert_eq!(before(&history, 99, |op| *op == 5), 3);
|
||||
all.clear();
|
||||
assert!(all.nth(0).is_none());
|
||||
}
|
||||
|
||||
/// A table's byte offset names the slots from it on; a small word that
|
||||
/// is no multiple of a descriptor's bytes names its own slot.
|
||||
#[test]
|
||||
fn user_data_names_slots() {
|
||||
let words = [0, 0x2549f40, 0x20, 0x11, 0x26f1, 0xffff_ffff];
|
||||
let slots = slots(&words, 1_245_184, 2);
|
||||
assert_eq!(slots, [(1, 0x2549f40 / 32), (1, 0x2549f40 / 32 + 1), (3, 0x11), (4, 0x26f1)]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user