forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on ef5832fea151ca30db92b142c8de131c5f43fc49Filtered to crates/engine/src/hwproc.rsClear filter

2026-08-14

🐛 fix(engine): a bar that has been filled is not taken back when the GPU diesAhmet Kaan Gümüş · 197d1e2
🐛 fix(engine): a bar that has been filled is not taken back when the GPU dies

The hardware encoder's process dying puts the whole export through the
software encoder again, and the bar was put back to zero to do it: a
person watching 93% of a film written suddenly saw 5%, at the one moment
they most needed to believe the editor was still working. The mark holds
instead, and the re-run moves it on once it passes it -- which needed the
copied-picture path to publish with `fetch_max` like everything else.

With it, the rest of that same seam:

* the audio pass is joined however `run` leaves, not detached. The mp4
  path runs the sound beside the picture, and a picture that failed left
  that thread running: the re-run then started a second pass, so a
  machine that had just lost its GPU mixed the same film's sound twice
  at once.
* a dead child is a *type* (`hwproc::Lost`) and not a phrase. `is_lost`
  commits an export to being written again from the first frame, and a
  substring match handed that decision to any future error whose wording
  happened to mention the child.
* a wedged child is waited out by its own measure. The 15 s ceiling is
  what an encoder opening on a 4K frame may need, and it is also fifteen
  seconds an export spends on a child that will never answer again,
  before the software encoder it is owed can begin. Once a child has
  answered its first frames it has said what its frames cost, and eight
  times the slowest of them (never under two seconds) contains a wedge
  in two or three rather than fifteen -- while a slow open still gets
  the whole ceiling and is never killed for being slow. The editor is
  live throughout either way: the wait is on the export's own thread.
* the countdown cannot be handed a rate below zero or a division by
  nothing: a bar that went backwards read as "~0:00 left" over six
  minutes of encoding, and the estimate is a guess, never a lie.
🐛 fix(engine): the seat a test cycles is one no other test is sitting inAhmet Kaan Gümüş · 88ce23e
🐛 fix(engine): the seat a test cycles is one no other test is sitting in

The stand-in encoder seat was armed by a process-wide variable and read by
`hw_seat`, so a software test that had already opened its own export picked
it up mid-flight, met the hang injection, and stalled: `cargo test -p engine
--test export` was green or five-failed depending on the interleaving. The
progress reset the fallback does made it worse -- one cancel test hot-spins
on progress reaching 1.0 and a regression there never ends.

The seat is process state, so it is borrowed rather than assumed: the whole
software suite shares a read guard, exactly as parallel as it always was, and
the encoder-death family takes it exclusively, lifting the software encode
pin only for its own exports and putting it back before it lets go. Which
lets `hw_seat` go back to being production policy with no test flag in it.

Also: a child that does not answer `vh_enc_dma_geometry` is now reaped there
instead of costing the next picture a second whole timeout; the plugin's own
note no longer claims the editor never loads the encode half, when what it
never does is *call* it -- the availability check is a dlopen and opens no
VA-API display; and the guard that refuses to write an export again in
software when a person picked the GPU by name now has the test it was
shipped without.
✨ feat(engine): the driver that aborts kills a process nobody was editing inAhmet Kaan Gümüş · c0a1847
✨ feat(engine): the driver that aborts kills a process nobody was editing in

Mesa's radeonsi calls libc abort() from its own C worker thread when the
video ring resets under it -- amdgpu_ctx_set_sw_reset_status, mesa 26.1.6,
vcn_unified_0 hung during an AV1 encode submission on 2026-08-13. A foreign
thread's abort is not an unwind, so every catch_unwind in the plugin was
structurally unable to see it: the editor died with the driver and took the
session's work with it.

So the encoder is not in the editor's address space any more. HwEncoder is a
handle on a `hw-encode-child` process that dlopens the plugin, and its death
-- by abort, by any signal, or by going quiet past VE_HW_TIMEOUT_MS -- comes
back as an error the export answers by writing the file again in software.
A person who picked the GPU by name still gets the refusal in words rather
than an encoder nobody chose.

Isolation that cost the speed would not be worth having, so pictures do not
travel down a pipe: in-memory ones go through a memfd mapped in both
processes, and pictures still on the GPU never move at all -- their
DRM-PRIME descriptors cross as file descriptors over SCM_RIGHTS, so the
zero-copy export path stays zero-copy across the boundary. Measured on this
box at 1080p: 430 fps in-process, 384 isolated, 89% of it, worst case
(every export of an untouched clip takes the descriptor path instead).

The proof does not need a wedged ring, which is the one thing a wedged
machine cannot supply: VE_HW_TEST_FAKE opens a stand-in seat in the child and
VE_HW_TEST_ABORT / VE_HW_TEST_HANG say where it dies or stops, so the
containment paths are exercised on any machine, GPU or no GPU.

Decode is still in the editor's process, where the same abort would still be
fatal; the seam to move it is now the one this built.