Mid-frame view flushing can deadlock when the render thread synchronously waits for JavaScript
I maintainer di solito rispondono entro 1 giorno
@bkaradzic-microsoft ci sta già lavorando.
Dal 30/9/2026.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp, javascript
- Ambito
- computer-graphics
Direzione di ricerca
Start in Core/Graphics/Source/DeviceImpl.cpp at upstream commit 3450373508, tracing FlushViewsIfNeeded(), PerformMidFrameViewFlush(), and FinishRenderingCurrentFrame(). Exercise the triggering sequence around the maxViews - 16 threshold and confirm the circular wait or establish the required host-side frame-pumping contract. Done means the flush no longer hangs, or unsupported synchronous dispatch fails explicitly and its contract is documented and enforced.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
DeviceImpl::FlushViewsIfNeeded() can wait indefinitely when an embedding application synchronously waits for JavaScript rendering to finish before calling FinishRenderingCurrentFrame().
The current guard checks that at least one frame-completion scope is active, but an active scope does not establish that the render thread is available to service a mid-frame flush.
Triggering sequence
- The render thread dispatches rendering work to the JS thread and synchronously waits for it to complete, intending to finish the native frame afterward.
- With a frame-completion scope active, JS submits enough render-target passes to reach the mid-frame view-flush threshold (
maxViews - 16). FlushViewsIfNeeded()setsm_flushRequestedand waits onm_flushCompleteCV.- The render thread cannot reach
FinishRenderingCurrentFrame()to service that request until JS returns. JS cannot return until the flush completes.
This creates a circular wait:
Render thread: waiting for JS rendering to complete
JS thread: waiting for render thread to service a view flush
Expected behavior
The flush should complete, or an unsupported frame-driving pattern should fail explicitly rather than hang. If synchronous dispatch is unsupported, the required host-side frame-pumping contract should be documented and enforced.
Evidence and scope
A repeatable rendering stall was observed when the workload crossed the flush threshold. The circular-wait explanation is based on source inspection; a debugger-confirmed pair of blocked thread stacks and a standalone public reproducer are not yet available.
The relevant implementation is DeviceImpl.cpp at upstream commit 3450373508, particularly FlushViewsIfNeeded(), PerformMidFrameViewFlush(), and FinishRenderingCurrentFrame().
Increasing the view capacity avoids this path for workloads that remain below the new threshold, but does not fix the underlying synchronization dependency.
- Lingua principale
- C++
- Stelle
- 931
- Fork
- 169
- Merge medio
- 2g 17h
- PR unite (30g)
- 66
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di BabylonJS/BabylonNative
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
BabylonJS/BabylonNative#2138 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BabylonJS/BabylonNative#2042 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
BabylonJS/BabylonNative#2052 ·
I maintainer di solito rispondono entro 1 giorno
-
testing
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
BabylonJS/BabylonNative#2136 ·
I maintainer di solito rispondono entro 1 giorno
-
Support useNDCHalfZRange (half-range NDC depth) so Babylon.js half-range depth visual tests can runAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
BabylonJS/BabylonNative#2134 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di BabylonJS/BabylonNative
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
gofractally/psibase#2379 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
simnJS/AnyPS5#735 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs-format
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Niko1221/Strata#7719 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni