Name pipelines left out on purpose instead of "being made"

The diagnostics breakdown counted every draw or dispatch of a pipeline
left out on purpose (make::left_out: CS_RaytracingResolve without the
ray-tracing structure builder, CS_ScreenProbes_ActivateRays) as "being
made": such a pipeline is never queued, so its host pipeline is never
made. In gameplay that was some 630 indirect dispatches a frame
("dropped 632.0/frame without a host pipeline: being made") while the
queue was empty in every frame ("0 being made"): the ray-tracing
resolves, one indirect dispatch per material (329 distinct resolve
programs bound in run 155824, their first binds in the second the
first indirect signature was dropped). No world draw is among them.

- make::missing names the reason ("left out on purpose: ...").
- The frame line counts them per frame, direct and indirect together
  ("N of all these left out on purpose: ray-tracing passes without the
  structure builder"), in release builds too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
readmet3xt-labandClaude Opus 5.5 committed 2026-11-26 17:14:53 +05:30
1 parent 9a791323ba
commit f149e26fea
3 files changed
+50 -3

No files matched your search

+40 -2
View File
@@ -150,10 +150,16 @@ impl Pending {
}
}
/// Why a pipeline has no host pipeline (diagnostics): its shaders that do
/// not translate, else "refused" or "being made"; `None` if it has one.
/// Why a pipeline has no host pipeline (diagnostics): left out on purpose
/// ([`left_out`]), its shaders that do not translate, else "refused" or
/// "being made"; `None` if it has one. (A pipeline left out is never made:
/// it was counted as "being made" in every frame, some 630 indirect
/// ray-tracing resolves a frame in gameplay, while no pipeline was queued.)
#[cfg(feature = "diagnostics")]
pub(crate) fn missing(p: &Pending) -> Option<String> {
if let Some(why) = p.left_out {
return Some(format!("left out on purpose: {why}"));
}
match p.made.get() {
Some(Some(_)) => None,
None => Some("being made".into()),
@@ -213,6 +219,15 @@ fn screens_first() -> bool {
/// Pipelines queued and not made yet.
static WAITING: AtomicU64 = AtomicU64::new(0);
/// Draws and dispatches (direct and indirect) asked of a pipeline left out on
/// purpose ([`left_out`]), since the last [`take_left_out`].
static LEFT_OUT: AtomicU64 = AtomicU64::new(0);
/// See [`LEFT_OUT`] (for the frame line).
pub(crate) fn take_left_out() -> u64 {
LEFT_OUT.swap(0, Ordering::Relaxed)
}
/// Pipelines queued and not made yet (for the frame line).
pub(crate) fn waiting() -> u64 {
WAITING.load(Ordering::Relaxed)
@@ -222,6 +237,7 @@ pub(crate) fn waiting() -> u64 {
/// queues it on first use.
pub(crate) fn ready(p: &Arc<Pending>) -> Option<&HostPipeline> {
if p.left_out.is_some() {
LEFT_OUT.fetch_add(1, Ordering::Relaxed);
return None;
}
// A still-pending pipeline was requested by the title too. Prewarm it
@@ -586,6 +602,28 @@ mod tests {
assert!(matches!(p.made.get(), Some(None)));
}
/// A pipeline left out on purpose (a ray-tracing resolve without the structure builder)
/// is never queued, so never made: it is counted as left out, and named so, not as
/// "being made" (some 630 indirect dispatches a frame were, in every gameplay frame).
#[test]
fn pipelines_left_out_are_counted_and_never_queued() {
let mut p = Pending::new(Vec::new(), None);
p.left_out = Some("shades ray-tracing hits without BVH, left out");
let p = Arc::new(p);
let before = LEFT_OUT.load(Ordering::Relaxed);
assert!(ready(&p).is_none());
assert!(ready(&p).is_none());
assert!(!now(&p));
assert_eq!(p.queue_state.load(Ordering::Relaxed), NOT_QUEUED);
assert!(p.made.get().is_none());
assert!(LEFT_OUT.load(Ordering::Relaxed) >= before + 2);
#[cfg(feature = "diagnostics")]
assert_eq!(
missing(&p).as_deref(),
Some("left out on purpose: shades ray-tracing hits without BVH, left out")
);
}
#[test]
fn pending_pipeline_is_recorded_for_the_next_launch() {
let mut p = Pending::new(Vec::new(), None);