This repository now holds libreims_vgpu, a Rust library that is the host side of the paravirtualized GPU macOS guests drive, in place of Apple's ParavirtualizedGraphics.framework: the library and its C API (reims_vgpu.h), the PCI device's option ROM, QEMU's apple-gfx on that API (vendor/qemu), the behaviour-lock suite that drives the C API as QEMU does, and reims-ctl, the VM manager users run. README.md says what it is and how it is laid out, and AGENTS.md how to change it. Every file of the earlier tree is replaced. vendor/qemu moves to the steelbrain/reims-vgpu branch of the same public repository.
30 KiB
30 KiB
Lessons
Each lesson is a trap that decides what the guest or the host sees, or what a check reports, found by the suite, a review or a VM boot: what went wrong, why, and how to recognise the next one. A new trap found the same way goes here.
The platform and the runtime
- A model of an Objective-C mechanism must still drive the real one where the platform uses it. A model of
@autoreleasepoolthat held Rust values alone left everything Metal autoreleased on the library's threads unreleased (the+0-commandBuffer, its encoders). Uncommitted command buffers then used up the queue's 64 slots, and the 65th-commandBufferblocked.rt::Poolpushes and pops a real pool around each unit of work for that reason (architecture 7.4). Whether a dropped uncommitted buffer is still in the pool depends on the build: an optimized one elides Metal's autorelease of it, and a dev build does not. - Leaks that only exhaust a resource show up as "the Nth of anything hangs". When a suite case starts to differ at exactly the 65th faulting exec, suspect
MTLCommandQueue's defaultmaxCommandBufferCountof 64 and count the uncommitted buffers, not the record that hangs. - An object autoreleased on the host's thread goes to the host's pool, which the host pops after the API call has returned, and a host in C has no pool at all. A thread-local stack that only the library's own holders and a worker's idle drain empty keeps such values alive forever on a host thread. Every public entry pushes a pool and opens a holder of its own (
reims_vgpu::entry::run), so what the call held or Metal autoreleased on the host's thread goes before it returns; a thread the library started keeps a last-resort holder and pool for what is held or autoreleased there outside any unit. - An isolated task's GPU addresses (a heap's
gpuAddress) reach the guest, so what a faulted exec leaks shows up as moved addresses, not as a hang, and since isolated tasks share the host's Metal device, as moved addresses in every task made after it. - A
dispatch_syncblock runs on the caller's thread, and that is ordering the guest sees, not an implementation detail. ASerialQueue::syncthat ran the block on the queue's worker and woke the caller afterwards let a child FIFO overtake the root:DeviceCore::create_fifostarts the child's thread inside its sync block, and while the root FIFO thread waited for the wake-up, the new child ran its replayed NOP and raised its interrupt before the root published the define's stamp (irq_stamps["0x2","0x1"]instead of["0x3","0x1"], one run in ten).SerialQueue::syncruns the block on the caller's thread. When an interrupt snapshot flakes, look for a hand-off between threads that the order does not need, not for a lock or a publish order. - An
@autoreleasepoola raise leaves is not popped: clang registers the pop as a normal cleanup only, so the enclosing pop (or the host's own) frees what was autoreleased inside it. A pool popped at the raise frees what Metal autoreleased in it too early;rt::pool::aroundleaves it pushed. And a pool pushed only after the body never catches Metal's+0returns at all. - A weak load under MRC with
-fobjc-weakisobjc_loadWeak: the object comes back retained and autoreleased into the innermost pool, so its release, and its teardown when that reference was the last, lands at the pool's pop, after what the block did.Weak::upgradeinto a local drops it at the end of the Rust scope instead, which can run the teardown in the middle of the work. Where an upgraded reference's last release crosses the API, hold it to the end of its hold's holder (Hold::keep), or, where that teardown syncs onto the queue running the block, let it go withrt::held::release_off_thread(architecture 7.4). - A wrapper and the library's object are two lifetimes where the host sees one. A block of the library's can keep a display after the host's last release of the handle that wraps it, and the library's teardown then runs later, on that block's thread. A callback the library makes from its teardown must not take the wrapper as its context: hand it what the wrapper held. The C API's display callbacks each hold the host's callback table, not the
RvgDisplayhandle, and the table'sdestroyruns when the last of them goes (api.md section 5, "Callback tables and their destroys"). - A
+0message send to an unretained pointer takes no reference, so it can never be the last release.Weak::upgradeinto a temporary is a retain and a release: when the host's release lands meanwhile, the temporary's drop runs the teardown on the sender's thread, under the sender's locks (a detach that takes the same lock hangs), and for an object whose last release has already begun the upgrade fails where an unretained pointer still reaches the object. Reach the object without a reference wherever the code sends to a pointer it does not own:DeviceCore::display_coredoes, for the device's port table and the guest display's client, taking the display's core and never a reference to the host's display. - A queue worker's idle drain is the last-resort holder's release and pool pop, after the thread has left the queue: a teardown released there may
synconto that same queue (the device's teardown onto its reporting queue), and libdispatch runs what is pending on another worker first. Asyncthat waits for "the worker" to hand over the turn hangs when the caller is that worker;SerialQueue::syncruns the blocks queued ahead of it itself there (rt::queue). dispatch_releaseof a source's last reference cancels it (_dispatch_source_xref_dispose): pending data is dropped, and the cancel callout frees the handler on the target, with nodispatch_source_cancelcalled. A model whose release leaves the source live delivers merges libdispatch never delivers.rt::signal::CoalescingSignalcancels at its last release.- An exception costs time the guest can see. In an arm64 process the first
@throw/@catchcosts about 25 µs (the unwinder's first use), later ones about 5 to 8 µs, and a%@of the object a few more; a RustResultcosts about 1 µs. Ininterplay_limits_high_children_circular[isolate]the cheaper path let the guest see child 9's "Circular wait" fault before the asynchronous fault-mask set landed (0x102cread 0 where the slower path's read gives 1). Measured from the doorbell write's return to the fault's visibility, 16 runs each: 91-207 µs (median 106) with a real exception at each raise, 47-352 µs (median 81) withResults alone. A raise here is a value, with no exception thrown (architecture 6.2). When a suite difference depends on how soon something becomes visible after an error, measure the error path's latency, not just its effects. - A fixed-width model of an unbounded stack fails silently at depth. A catch-scope stack that kept "is the innermost scope a foreign boundary?" as a 64-bit register, shifted on each scope entry, lost the boundary's bit when a resolver's lookup recursed through more than 64 nested scopes, and a throw there made a round trip it should not have. Keep, per scope, the value it replaced and restore it on exit, which is exact at any depth, and test past the width (70 nested scopes).
- Work done only for a log line belongs inside the line's gate. Reading an exception's
callStackReturnAddresseseagerly at every caught Metal raise was work only a line printingcallStackSymbolsneeds, and it cost time on the guest's error path. Alogmacro evaluates its arguments only when a logger takes the line; a read with an effect the guest can see (guest memory, which can die) goes before the line instead, so it happens whether logging is on or off (architecture 14). - A
dispatch_data_createdestructor is behaviour: a destructor block with a NULL queue runs on acom.apple.root.default-qosworker after the release returns, whileDISPATCH_DATA_DESTRUCTOR_DEFAULTmakes a copy that the releaser frees inline. - A retaining pointer's assignment releases before it retains. Apple's framework assigns its retaining pointers by doing nothing when the new pointer is the one held, and otherwise releasing the old one before retaining the new one. Where that release crosses the API, compare the handles' identities, drop the old handle, then store the new one's reference:
*slot = Some(new.clone_ref())takes the new reference first. - A check every thread makes must not touch a
thread_local!whose value has a destructor. Reading the isolated task's trap (aRefCell<Option<Arc<_>>>) before every Metal send and guest write, on every thread, made the C API's display tests die with SIGSEGV within milliseconds in 7 of 10 crate runs, and never under a debugger; reading a destructor-freeCell<bool>first, and the trap only on a thread that runs a task's code, gave 0 in 12 (tasks::isolation::life). The likely route is the destructor's registration on a thread's first access, made while that thread already destroys its thread-locals. When a test segfaults at once and only now and then, look for a thread-local that a change made every thread touch. - An isolated task's death inside Metal is a death of the host's process, and it lands asynchronously to what the runner does next. A death in the task's own code ends only the task, as a fault the guest sees; a crash inside Metal, on the task's own thread in the host, ends the process wherever the runner has got to: a service walk that rang more doorbells after the fatal command died at op 4222 in one run and 4224 in another. The contract fixes where a run dies, so the fatal command goes behind 256 NOPs, as
exec_objects.submit_lastdoes for an in-process death, its FIFO's doorbell is rung last, and its fault is the first wait: the process then dies in that wait every run. A death case whoseaftermoves between runs races the runner's next ops: find the thread that dies, and make the runner wait for it. - A Metal call's output can change with the host's boot, which no host key captures. Apple's private
-fillTexture:level:slice:region:color:pixelFormat:on a texture of pixel format 550 (a two-plane XR10 format the public headers do not name) writes texels that change at every reboot and are the same in every run within one: what the guest read of them after the library's page-out was84307cca,84b0e5c9and843027c0across three boots (measured), sharing their low 15 bits and the top two, which the page-out kernel sets. Cases that dumped those texels failed after each reboot on every build alike. Their fills now sit outside the dumps, and a copy from another 550 texture writes the dumped texels. When cases fail at once on every build after a reboot, run them at an older commit before bisecting, and check whether what they dump is the platform's own output rather than the library's. - A test that frees memory and then expects its address to be unmapped races every other test thread in the process:
mach_vm_allocateanywhere hands the page straight back out. Recheck the region when the unexpected happens, and retry with a fresh page.
The Vulkan platform
- A Metal comparison run after MoltenVK has worked on Metal's device, in the same process, sees Metal let go late. A test of texture ID reuse that ran the Vulkan platform's sequence first and Metal's second found Metal's texture, released while a command buffer held it, still held when
waitUntilCompletedreturned, in 3 runs of 3. Metal run alone frees it by the time the wait returns (5 runs of 5), and 300 ms after the wait it was free in both runs that waited (measured on the M3 Max). Metal lets go of a command buffer's resources asynchronously, and once MoltenVK's work shares its device, that release loses the race with the waiter; it looks like the runtime freeing IDs too early. Run Metal's side of a comparison first, before the Vulkan platform makes anything in the process, wherever what is compared depends on when Metal lets go of something (IDs, addresses, retain and use counts, reuse):texture_identifiers_are_reused_as_metals,a_command_buffer_holds_a_surface_as_metals_doesandholds_as_metalsdo. When Metal's side of a comparison disagrees with a plain-Metal probe of the same sequence, run it again with Metal's side alone in its process. - A rule that covers a list of shapes is only as whole as its list, and the list must come from every scenario that makes one, not from the cases the change already knows. A death at a depth or stencil texture whose size Metal's was not measured for exempted the shape of the two cases it named, a 2D
Depth32Float_Stencil8texture of two levels, and missed theDepth32Float_Stencil8cube arrays and anX32_Stencil8texture other scenarios make: the full suite died in all three, in every setup, where the change's own check had run a subset picked by name. Unit tests could not show it either: only the guest's serialized descriptors turnallowGPUOptimizedContentsoff. The scenarios build without a device, so the list can be exact: build every one with its descriptor builders wrapped, and list each descriptor of the formats in question with the scenarios whose ops carry its bytes. How to spot the next one: a new death at a creation call, checked by a suite subset rather than the full suite. - A copy of raw bytes carries the layout of every object over them. Core pages a legacy heap's bytes to and from the guest's pages through its buffer over all of the heap, so the guest's pages hold, and a texture of the heap reads after a page-in, whatever layout the platform keeps there. On the Vulkan platform that was the driver's: a native driver's own tiling, or on MoltenVK Metal's layout of MoltenVK's texture, whose usage can differ from the guest's and with it whether Metal compresses the texture (measured,
legacy_heap_textures_are_metals_where_metal_keeps_them_plain). Nothing died or announced it, and no test or suite case read a heap's bytes over a texture. How to spot the next one: for any path that copies an object's bytes whole (paging, a buffer over a heap, an alias of the same memory), list every object that shares those bytes and ask whose layout each one's bytes are in. - A device test that builds its objects another way than core builds them checks another flow than the one the guest drives. Tests of objects over the guest's pages under a heap's texture (
gpu::over_pages) made their heaps over the guest's pages at once, where core makes a detached heap over memory of its own, places the guest's textures in it, and gives it the guest's pages only at its first prepare, by a replace (resources/heap/detach.rs): in core's flow every check compared the guest's pages with core's temporary allocation. The same test replaced a buffer without the detach core makes first, which Metal refuses, so it died at its first line on its first GPU run and had never reached its assertions. Make test objects as core does (detached_heap,replace_heap,detached_bufferingpu::resource's tests), and for a check of where an object lies, ask what changes where it lies after it is made: a replace, a detach, a discard. - A sweep shows a rule only where it holds an input on which two rules part. The colour fill packer (
crate::gpu::fill) was compared with Metal over thousands of colours, but its NaNs were onlyf64::NANand-f64::NAN, and no double lay strictly between two integer edges, so three of Metal's rules went unmeasured and the packer missed all three: a signalling NaN into an integer channel stores the largest value, a NaN's payload survives into a half or float channel, and anR32Uintdouble strictly between 2^31 - 1 and 2^31 stores 2^31. How to spot the next one: a sweep of an encoding whose NaNs are all default quiet NaNs, or whose edge values are all exact integers; it must also hold signalling NaNs, payload bits at the positions each target format keeps and drops, and values strictly between representable edges. - An option of a release can move what the release does first. Without a keep-alive, the runtime frees a no-copy buffer's import and then runs the deallocator; given one (its D822), it runs the deallocator first, at Metal's moment, frees the import, and only then drops the keep-alive. A keep-alive holding nothing would have moved every unmap a deallocator of core's makes before the free, on every release, and a driver that validates host-pointer imports at each submission fails on unmapped pages. The platform gives the keep-alive what must outlive the import: the aliases and twins it imports, and a hold that makes core's unmaps through
VulkanVmwait for the free (reims-vgpu-vulkan'sremap). How to spot the next one: when a dependency adds an argument that changes when a callback runs, read the code that runs it for the order of everything else it does, not just the callback's moment. - A copy of a Vulkan handle keeps nothing alive. Shared shader modules each held a clone of
ash::Device, a table of function pointers around a raw handle, which a review passed as harmless; a module released after the device's teardown then destroyed itself through the dead device, and runs on a software rasterizer (llvmpipe) crashed every time. A rawVkRenderPasscopied into a pool's closure was the same slip. How to spot the next one: in a change that shares or caches a Vulkan object, or moves one into a closure, list every holder and check that each ends before the device and the loader do.
QEMU, the window and VM boots
- The suite never runs QEMU, so QEMU's side of the C API is checked only by a VM boot. QEMU's
thread_pool_submit_immediatesubmits a job and then resizes the pool to the work left, and asserts that is more than 0: its callers had submitted long jobs, butapple-gfx's MMIO jobs finished in microseconds, often before the resize, and a vmapple boot aborted in minutes (upstream's fix,2566b6e902, comes in through vendor/qemu's merge of upstream master, docs/qemu.md "MMIO"). The suite and every unit test passed throughout. A change tohw/display/apple-gfx*.c, or to what QEMU calls, needs a VM boot before it is called done. - A device-info answer chooses the guest's code, not only a value it reads. Answering Metal's SIMD bits of key 33 on the Vulkan platform, where they had followed the device, made hundreds more suite cases match Metal's, and a macOS 15.6.1 guest then died at boot: with the bits set, its frameworks chose a SIMD blur whose tile dispatch the runtime refuses, where before they took a fallback and booted. With that fixed, a 26.6.2 guest died at the next refusal down the same path, a sampler that path makes and the other never did. The suite's scenarios do not model the guest's choice, and guest shaders are never committed, so only a boot shows it. How to spot the next one: a change to what device info, GPU families or feature queries answer; boot the guests on it before it merges, and keep the old answer until they boot (AGENTS.md, "Checking a change").
- A difference a boot already logs is a death on every boot once it is made one. A change that ended the process on two differences the Vulkan platform had logged passed
cargo xtask check, and every macOS 26 boot then died early, at about 6 s on MoltenVK and 38 s on an NVIDIA driver, each at one of the two: the last good boot's log had counted 873 states with one and 20 with the other. No committed test runs the shaders a guest's boot draws. How to spot the next one: before a change ends the process on something the platform logged, look its code up in the last good boot's notice counts; any count there is a death every boot reaches. - A hop to another thread that the caller waits for is a wakeup the caller depends on.
apple-gfxmade each MMIO access on a thread of itsThreadPoolwhile the vCPU waited inAIO_WAIT_WHILE, holding the BQL, for the job to setcompletedand callaio_wait_kick. One vmapple boot hung 3 million accesses in, at a doorbell write: the access had completed and no thread was in the library, yet the vCPU slept inaio_poll'sselectfor good, and QEMU's main loop, its UI and the other vCPUs waited for the BQL it held. The wakeup was lost somewhere between the pool's job,aio_wait_kick's BH and the event notifier, and no stress test of the pattern reproduced it. The hop bought nothing, since an access waits only on the library's threads, which never wait on QEMU, so QEMU now calls the library on the vCPU's thread (docs/qemu.md, "MMIO"). Before a host waits for its own job on another thread, ask what the job waits on: when it is nothing of the host's, call it directly. When a sampled thread sleeps in a poll inside a wait loop and no thread runs the job it waits for, suspect a lost wakeup, not a slow job. - A build that reads a pkg-config package at configure keeps what it read. meson reads
reims-vgpu.pcwhen QEMU is configured and keeps its flags,Libs.privateamong them, in its build files; a change to the package does not make it configure again. When the library came to need Carbon (the window's ISO keyboard check), a QEMU build configured before that linked the newlibreims_vgpu.awith the old framework list and failed on two Carbon symbols. Neithercargo xtask checknor the suite links QEMU, and the smoke reads the package at each link.make qemukeeps a copy of the package it configured with (build/qemu/reims-vgpu.pc.configured) and configures again when the dist tree's differs. When a host that links the archive fails on a system framework's symbols after a library change, compare the dist tree'sLibs.privatewith the flags the host's build recorded (for QEMU, the link line inbuild/qemu/build.ninja) before looking at the code. - An activity against App Nap can keep the host awake.
NSActivityUserInitiatedincludesNSActivityIdleSystemSleepDisabled: the window's activity, begun with it for the process's life, kept the host from idle sleep for as long as QEMU ran.NSActivityUserInitiatedAllowingIdleSystemSleepkeeps App Nap away and leaves sleep to the host's own settings (reims-vgpu-window/src/native/macos/app.rs). No test can see it: when a Mac stops sleeping while the library runs, readpmset -g assertionsfor the process first. - A VM's timings depend on whether the person at the host sees QEMU's window. Under
-display cocoa, macOS napped QEMU 30 to 50 s after it lost the focus: every QEMU thread (the vCPUs and the library's FIFO and display threads among them) ran at priority 4, and Metal's compiler service ran QEMU's compiles at 0 to 4. A 26.6.2 guest booted that way reached its desktop at 215 s, and at 53 s when QEMU was kept in front (measured); it looked like slow compiles and shader caches.apple-gfxholds an activity against App Nap while it is realized (docs/qemu.md, "App Nap"). Before trusting a boot's timings, read the host log'sSet AppNap statelines for QEMU's pid (log show --predicate 'process == "runningboardd" AND eventMessage CONTAINS ":<pid>]"'):active:Ybegins a napped stretch, and the next focus (SETFRONT: pid=<pid>) ends it. Or sample its threads' priorities with libproc'sPROC_PIDTHREADINFO: a QEMU whose named threads all sit at 4 is napped. - A system value that names the device last used is read at each use. HIToolbox's keyboard type (
LMGetKbdType) follows the keyboard last typed on: the window read it once, when it opened, so a keyboard of the other layout plugged in afterwards (ISO in place of ANSI, or the reverse) swapped the key left of 1 with the key right of left Shift in the guest.InputStateasks again at each key event (the window crate'snative::is_iso_keyboard). When input maps right on one keyboard and wrong on another, look for a value read once that names a device. - A value the host sends is not the value the guest decides by. A display matching a Retina host screen was told 144 ppi and a scale factor of 2, and the macOS 13.6 guest still booted to a 1× desktop: it ignores the scale factor for its default, reads the size in millimetres as whole centimetres rounded up (611.04 mm is 62 cm), so it saw 141.6 ppi, below its HiDPI threshold (
reims-vgpu-window'spolicy). Unit tests of the policy passed throughout, since they checked what was sent. When a guest-visible choice misses, boot the guest and read what it made of the values (ioreg'sDisplayAttributes,/Library/Preferences/com.apple.windowserver.displays.plist), from a fresh clone, since the guest keeps its display settings per display. - A threshold measured in the units the library tells is not the guest's rule when the guest reads them in coarser units. The window predicted a macOS guest's HiDPI default as "more than 143 ppi across the told millimetres", but the guest rounds the told width to whole millimetres and then up to whole centimetres, and switches between 146.666 and 146.667 ppi across that:
2560x1600@146reads 45 cm, 144.5 ppi, and ran 1× while the window sized itself for 2×. Nor was it one rule: 1280 pixels wide stayed 1× at 216.7 ppi, and 5832 wide ran HiDPI at 128.8 (docs/qemu.md, "A chosen density's boundary"). Measure a guest's threshold with inputs that land near it in the guest's own units (here, pixels across whole centimetres, chosen by width and density), split the rounding models with a value between them (440.39 mm, which reads 44 cm only when rounded to whole millimetres first), and vary the width to learn whether one number decides it.
Tools and worktrees
git stashis one list, shared by every worktree of a repository (refs/stashis not per worktree), so a stash pushed in one worktree can be popped into another. Set work aside with a WIP commit on the worktree's own branch, or a patch file under/tmp, never a stash. When changes appear that nobody in the tree made, or a pop conflicts with files the tree never touched, suspect another worktree's stash.- A shared
CARGO_TARGET_DIRruns another tree'sxtask. Cargo keys a workspace member's build by its path inside the workspace, not by where the workspace is, and calls the binary fresh when no source file at those relative paths is newer than its last build. So a worktree whose files predate the other tree's last build ofxtaskruns that build, made from the other tree's sources (measured on two copies of one package sharing a target directory: the secondcargo run -vprintedFreshand ran the first copy's binary). Give each worktree its own target directory under~/.cache. When a tool behaves as if a change were missing, look forFreshincargo run -v. - An archived tree's files carry their commit's time, so cargo can take a dependency's new sources for its old build.
git archivestamps each file with the commit's time andtar -xkeeps it, andrsync -akeeps the source's times; cargo calls a path dependency fresh when none of its source files is newer than its last build. Exporting a newer metal2vulkan commit over a tree built after that commit's date left the runtimeFresh: one cargo command reported a new item missing while another, which rebuilt, compiled it. After every extract, stamp the files with the time of extraction (tar -xm, orfind <dir> -type f -exec touch {} +), and check that the next build's log showsCompiling metal2vulkan. When one cargo command sees a dependency's new item and another does not, orcargo build -vprintsFreshfor a dependency whose sources just changed, look at the sources' times. - rustc's incremental state can fail a build that is sound. After an edit to
reims-vgpu-vulkan, an incrementalcargo clippy --workspace --all-targets --all-featuresfailed inreims-vgpuwith E0275, an overflow evaluatingmetal2vulkan_runtime::heap::HeapShared: Sendfor the window's Vulkan sink, whose auto-trait walk through the runtime's types runs near the recursion limit, or with an internal compiler error, "encountered incremental compilation error with evaluate_obligation". The incremental cache keeps the result of one order of that walk, and the edited crate's build takes another; a comment appended to a file of the crate reproduces it, and a build ofreims-vgpufrom nothing passes, as does one withCARGO_INCREMENTAL=0. The cure iscargo clean -p reims-vgpubefore the check. How to spot the next one: an E0275 or an ICE namingevaluate_obligationin a crate the change did not touch, after an edit to a crate it depends on, that a clean build of that crate does not show. - A submodule shared by several worktrees has one
core.worktree. When a superproject worktree'svendor/qemuis a linked worktree of the main checkout's module repository (.git/modules/vendor/qemu/worktrees/<name>),git submodule updatethere writes that worktree's path into the module's config, which every worktree of it shares. From then on every git command in the main checkout'svendor/qemuacts on the other worktree's files: a fast-forward moves the main checkout's branch and writes the other directory, the main checkout's own files stay at the old commit, andgit statusandgit diffreport the other tree's state.git -C vendor/qemu rev-parse --show-toplevelmust print the main checkout'svendor/qemu; restore it withgit config --file .git/modules/vendor/qemu/config core.worktree ../../../../vendor/qemu, run from outside the submodule, since git reads the broken config before any flag. Give a worktree that builds QEMU its own clone of the submodule, or leave its submodule uninitialised, and remove a linked worktree of the module withrm -rfandgit worktree prune, nevergit worktree remove. When a submodule's status contradicts its files (git diffshows a changegit hash-objectdoes not), suspectcore.worktree. - nextest's
--stress-countwith--no-fail-fastexits with the last iteration's status only. Measured with cargo-nextest 0.9.140: a test that failed in iteration 1 of 3 and passed in 2 and 3 exited 0, under the summary3/3 stress run iterations: 2 passed, 1 failed; without--no-fail-fastthe first failure stops the run and it exits 100. Count failures from the summary line, never from the exit code.