Document the Adreno 740 acquire-fence investigation

This commit is contained in:
Kurt Himebauch committed 2026-12-03 11:20:18 -05:00
1 parent 8b3cc7eb15
commit 804fa55b16
1 file changed
+59
@@ -0,0 +1,59 @@
# Adreno 740 frame loss when acquire fences are unavailable
**Investigation, not a fix.** Evidence through December 3, 2026, 16:17 UTC. The safety fallback stays in place. We have not accepted a producer fence on the Thor or verified an FPS benefit.
## Reproduction and controls
- AYN Thor, Adreno 740, Android 13, Linux 5.15; rc6 runtime. Official Bright Family House demo, same house scene. Game target 120 FPS, VSync off, Steam limiter off, display at 60 Hz.
- [DD-Turnip v1.1.0](https://github.com/Droid-Deck/Drivers/releases/tag/DD-Turnip-v1.1.0), Linux Mesa `15c6fd6181711ab13fe71fe711085287027f80df`, Drivers recipe `27d6917cf4243f04775b243769bd3e0cf09b3bdc`. Stock Linux library SHA-256: `417e0d92d804c20f05b1d882f18508e6f2dd42da02a397a14ebd79f02ba22e54`.
- Android's process guard was off only for the early historical A/B and restored afterward. The modern tests use normal OS protection. Keep that state for further tests.
## Measurements
**Controlled build comparison.** Source and DroidDeck compositor rates are separate counters. Neither independently confirms display presents.
| Tested build | Path under test | Source FPS | Compositor FPS |
| --- | --- | ---: | ---: |
| [`11af78340a536bc1566c1577238204fafbdee69f`](https://github.com/Droid-Deck/DroidDeck/commit/11af78340a536bc1566c1577238204fafbdee69f), #3560 | Before the missing-fence guard | ~42 | ~42 |
| [`aab15f31462c7031a3d73647713a7401c4079271`](https://github.com/Droid-Deck/DroidDeck/commit/aab15f31462c7031a3d73647713a7401c4079271), #3427 | Safe copy when no acquire fence arrives | ~42 | ~21 |
| [`affb0da37fa73bac99063e590d9eb630d6dc2d98`](https://github.com/Droid-Deck/DroidDeck/commit/affb0da37fa73bac99063e590d9eb630d6dc2d98), #3623 | Modern reference; drop persists | ~42 | ~21 |
**Independent display-present samples.** These were separate runs from the counters above. Bars show about two actual presents/s per block.
```text
Pre-guard reference (direct eligible) 38.19 ███████████████████
Modern missing-fence copy fallback 21.09 ███████████
Modern native zero-copy explicitly OFF 21.02 ███████████
```
The native zero-copy OFF run also had HDR off. The observed copy-wait measure was about 46 ms. This is consistent with the copy/wait path pacing display updates, but does not establish that the wait is the only cost. The pre-guard rate is a performance reference, not evidence that unfenced direct scanout is safe.
**Direct-route evidence.** In a separate capped sample of the same house, native Wayland FROG reported `flip:true` and Gamescope forwarded 480 additional frames while compositing zero. These are Gamescope events, not display presents or proof of host direct scanout. A neutral probe using the same stock Linux library digest as the game exported a real, pending Vulkan `SYNC_FD`. That shows export capability on this device, not that the game exported a present fence or that the host accepted one.
## Opt-in prototype checkpoints
| Layer | Experimental artifact | Verified so far |
| --- | --- | --- |
| Linux Turnip producer | [Build](https://github.com/Droid-Deck/Drivers/actions/runs/47141995501), [artifact](https://github.com/Droid-Deck/Drivers/actions/runs/47141995501/artifacts/15745379965), recipe `6c85b9ace776078ed70f68f2b91394dbdb1e47e9` | Linux-only v1.1.0 diagnostic. Archive SHA-256 `c4663695ba1a8ec40d6f7ea92d469cf415af731c0aabddbc5fbe4afa5ce2b7c3`; library SHA-256 `df658d5298b991cd2717dabd91199707f1602b1ce1851b2b3ce38258418fcb37`. WSI compilation and focused protocol/semaphore tests passed. |
| Gamescope receiver and relay | [Build](https://github.com/Droid-Deck/DroidDeck/actions/runs/47141802134), [artifact](https://github.com/Droid-Deck/DroidDeck/actions/runs/47141802134/artifacts/15743359314), source `666d86b4851d7f8777575b64ef0b125f45467181` | Test-only relay build passed. |
| Android host | [Build](https://github.com/Droid-Deck/DroidDeck/actions/runs/47143273178), [artifact](https://github.com/Droid-Deck/DroidDeck/actions/runs/47143273178/artifacts/15746510922), source `3b274746fbad6061c9182338908f7115f43d0ab3` | Paired host build and probe fixture passed in CI. |
The paired capped **OFF** control recorded **730 actual presents over 24.337 s (30.00 FPS)**; a separate 10 s counter window recorded **301 layer copies and no host direct admissions**. Do not compare this capped control directly with the uncapped measurements above.
Two **ON** attempts failed closed before the host could bind the peer to the actual Gamescope process. The guest marker was missing or unusable; a second marker was not observed before cutoff. A wrapper marker can correspond to an early `gamescope --version` invocation, not the real Wayland backend. One follow-up identified a unique live Gamescope peer from socket credentials, but the sample ended before executable identity could be read. **No gate was armed, no native acquire fence was accepted, and no ON FPS result is available.** The device was restored after each pass.
## Hypotheses and next test
1. The adjacent-build drop is consistent with the missing-fence guard routing a previously fast path to copy. Explicitly disabling native zero-copy reproduces the same rate, but does not establish why the copy wait is about 46 ms.
2. A fence from the final writer, preserved through Gamescope and accepted by the host, could allow safe direct scanout. The neutral probe establishes that export is possible; the real game's present path has not been verified.
3. The immediate blocker is identity, not measured fence throughput. Observe the uniquely matched peer while live and confirm its executable or loaded mapping against the expected artifact. Confirm the game's loaded Linux ICD separately. Do not arm from a wrapper marker, process name, or command line alone.
Run OFF/ON/OFF with the same test binaries, shot and camera, runtime, resolution, refresh, caps and protection state. Record exact hashes and route per run. Keep the capped route check separate from uncapped performance. Fix the warm-up and sampling windows, run at least three repetitions per condition, and record actual presents and frame-time distribution separately from source and compositor rates. In each window count producer fence emits, matching Gamescope relays, host fence accepts, direct admissions, and reasons for fallback.
## Acceptance and rollback
- [ ] Verify live game renderer, Gamescope and host identities before any ON run.
- [ ] Correlate real fences with their matching attach and commit. Missing, stale, mismatched or invalid fences must still take the safe fallback.
- [ ] Show that accepted fences increase safe direct admissions and improve actual display presents or frame times against both OFF controls. Compositor counters alone do not qualify.
- [ ] Check camera motion, pause/resume and swapchain recreation for stale frames, flicker, hangs and premature releases. Keep current behavior if either frame safety or the gain remains unproven.
- [ ] Disable the opt-in and restore stock session components afterward. No default change, release, or catalog promotion is part of this investigation.