RUNTIME_VERSION 1934: a resource's staged work goes with it, so a released device is torn down; an uncounted device reads nothing

Picks perdraw's steelbrain/uncounted-commands (334b9132e5, 8a94fa0439).

The leak: a resource staged its bytes for the device's next submission (FirstMoves::register_bytes),
and the waiting work held the staging Buffer, which held a program handle of the device. That work
was dropped only when a submission took it. So a resource dropped before any submission left the
device holding a handle to itself, and the device was never torn down. This hit a sparse 2D
texture's tile map, a Private buffer made with bytes, a Managed buffer's upload and a texture's
staged replace_region copy. FirstMoves::forget now drops a resource's waiting work when the
resource goes: from a buffer's drop where it staged work, and from Image::release.

The reading: the recorder routes at most 8 devices, and a device past them records uncounted, which
read as 0. In the cost alone leg, 5 sparse cases leaked a device in each of their rounds, so the 8
slots were never freed and 155 of 512 cases' commands_recorded read 0 alone (m3-max-10139).
WorkCounts::commands_uncounted now marks such a device. Conformance opens its device through
open_counted, which waits for a slot (up to 60 s) or fails with the reason, and read_counts
refuses an uncounted device.

Verified (m3-max-10291, ms01 lavapipe, at 8a94fa0439):
- clippy in three configurations and rustdoc clean; api_signatures 3/3;
- the focused first_moves, staged_work_teardown, recorder_slots and teardown_threads tests 19/19;
- the conformance suite 1043/1043;
- the runtime suite 1955/1956. Its one red, pool_room_creations, is the race fixed on development
  by 0baffba4f9, which the branch's base lacked; it passed 12/12 when run alone.
- Release cost legs over all 1233 cases: whole set 32 s and alone 98 s, both exit 0. 0 cases
  read uncounted, and 0 record commands in the set but none alone (882 and 882).
- Negative control 0182681206 (forget a no-op, never landed): both new device tests fail.
This commit is contained in:
Anees Iqbal committed 2026-11-08 17:49:47 -08:00
1 parent d58fb15ba0
commit 6b92bff521
2 files changed
+2 -2

No files matched your search

@@ -1 +1 @@
e835871cb8ac68e452f0c19805e6a2e63ed8e6466dec7f385609230eff810f97
9d14f0c39bcf32bcd718dd5cd78cbb5b92a49a2be05fef86494c61ac3fad5c26
+1 -1
View File
@@ -93,7 +93,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 493;
/// changes no behaviour, and then updates that hash alone with the commit saying why, or changes
/// behaviour and also bumps this version. The commit that bumps it says what changed; this comment
/// keeps no history.
pub const RUNTIME_VERSION: u32 = 1933;
pub const RUNTIME_VERSION: u32 = 1934;
/// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex,
/// of the manifest, the build script, and exactly the files the crate roots' module tree compiles