Files
metal2vulkan/docs
Anees Iqbal f5da0934bf exit_guard: past half its bound, the hook names where the sections it waits for began
An exit that waited for the runtime's work said nothing about what it waited for until its bound
ran out, and then only that the driver still ran it (the at-once notice). An exits-lane exit
that took 2.08 s on the RTX 5080 (runtime_lane::exits, handler_learns_exit, development
9bd38c7994) left no sign of the call it waited for.

Each thread's outermost section now keeps its caller's place while it lasts (Guard::places, a
slot of 64 each, Location::caller through the #[track_caller] doors: enter, Guard::enter,
Guard::enter_making, driver_making, and so release::object's caller). Once its wait has passed
half its bound, Guard::close says on standard error, once: "metal2vulkan: the exit has waited N ms
for M section(s) of the runtime's Vulkan work, begun at: file:line, ...". A section that begins
while every slot is taken goes unnamed. exit_guard's module docs and docs/API.md's process-exit
difference say so.

Tests:
- tests::exit_guard::the_sections_in_progress_name_where_they_began: an outer section's place
  is named, a nested section's is not, another thread's section is named with its own place,
  and an ended section is gone.
- a_busy_exit_past_the_bound_ends_at_once_with_its_status now reads the naming line before the
  notice for a section in progress, and no such line for a CPU device's work.

Verified: tests::exit_guard on homelab-gem10-1 (plain build), m3-max-8041: 46 of 46 passed.
(cherry picked from commit edee4b49637eddd2f6f2daf83ce2b2246b9fc6a5)
2026-11-08 03:41:48 -08:00
..