The ownership rules from the previous change stop a cancel from deleting
someone else's registration, but a process killed mid-cleanup left the
registration behind with nothing to retry it, and a registration the client
writes just after the cancel looked at the folder was never seen.
A cancelled cleanup now records a marker per folder (SHA-256 of its path,
written atomically): ACTIVE while the install runs, PENDING when the cleanup
must still happen, WATCHING while the client may still be writing its
registration. reconcile() runs on the next refresh, checks the marker against
the registrations that are actually there, retries with backoff, and clears
the marker once the registration is gone and the folder it created is
deleted. uninstall() verifies the registration really disappeared before it
reports success.
The design document moves to docs/development/battlenet-china.md: it describes
the merged state, so the -final suffix and the #2150 reference no longer
belong in it.
Cancelling an install uninstalled whatever registration lived in the folder,
so cancelling a reinstall of a game the user had installed from the Battle.net
client deleted that client's registration.
An install now decides ownership once, before it starts: the registrations that
were already in the folder belong to someone else and are never touched,
including the unfinished registration an earlier cancelled install left behind.
The decision is snapshotted into SavedQueue when the queue accepts the task, so
a resumed or restored install keeps it instead of re-reading a folder that may
already hold this task's own registration. The cancellation also holds the
folder against a concurrent uninstall, only removes the uids it saw, and only
deletes a folder it created itself. The queue publishes the cleanup key so a
second cancellation of the same game cannot start a parallel cleanup.
A version request that raced a client update read .build.info before asking and
after answering. When the build changed in between the check only cleared its
throttle and the badge, but nothing ever asked again, so an available update
stayed invisible until some unrelated trigger.
The repairable case (a newer local build than the one queried) now schedules a
force re-check after 30 s and at most twice; a failed read or a failed version
request still only clears the throttle and is not retried on a timer, so an
offline device does not spin on the network.
The update state was keyed by title, so two copies of the same game in
different folders shared one badge, and a China install was compared against
the global version line, which it never follows.
The badge is now keyed by id and folder. A China build asks the China
repository for the product it is actually served from (osic, s2c, d3cn), and
the check re-reads .build.info after the request so a build that changed
meanwhile is retried instead of reported against a stale key. refresh() checks
every installed Battle.net game, the library badge reads the same key, and the
detail screen re-checks once the running session ends.
Three lookups assumed one uid per store title, which breaks as soon as a title
has more than one identity or more than one copy:
- installUid() compared the store id to the discovered uid, so an alias such as
fen/fenris could not be managed; it also read a failed registration load as
'no install'. It now matches through sameTitle() and returns null when the
sources cannot be read.
- launchCode() served a folder from BattleNet.games(), which keeps one copy per
launch code, so a second copy of the same game in another folder had no code.
It now resolves the registrations of that folder directly (registrationsIn).
- StoresState kept a folder only when games() listed it; an unreadable
registration file made games() empty and the folder was deleted. It now also
keeps the folder when registrationsReadable() is false.
sameTitle() folds the China aliases into the store uid and accepts two uids that
share a code and product, so a China D3 copy still launches as D3CN.
Diablo III installed by the China client was a separate d3cn card with its own
identity, so a China copy and an international one could not coexist. It now
resolves to the diablo3 card through a Cnv alias that carries only the launch
code and the China product, the same way osic/s2_cn already did.
An install is also matched by its folder instead of by title, so two copies of
Diablo III in different folders each update, uninstall and launch with their own
recorded code. A shortcut whose copy is gone now says so instead of failing
with a Steam error.
The driver rewrites the uid for a Chinese client install (osi -> osic,
s2 -> s2_cn, diablo3 -> d3cn) inside the Windows agent script, so the Kotlin
side never learned which uid was actually installed. Cancelling a fresh
install then fell back to the store uid (diablo3), and when the same prefix
also held an international copy the Agent was asked to uninstall that copy
instead.
The driver now records the effective uid in .uid, emits it as BNET_UID as
soon as it is known and repeats it in the DONE payload; the installer keeps
it for the task. Cancel no longer guesses a uid: it uninstalls the recorded
one, or leaves the registration to Battle.net and only removes the folder
when it is empty or the recorded install is gone.
Parts 5 and 6 still read the registrations on disk before removing anything;
this part makes the earlier stacked PRs safe to merge on their own.
Keep the Steam install picker state out of the Steam engine object
The picker state lived on SteamStore, which is first touched from the
background stores refresh thread. On the Compose runtime in use, a state
object created outside a snapshot while the composition holds an open
snapshot is unreadable inside it, so the front end crashed on startup
with "Reading a state that was created after the snapshot was taken".
The state now lives on StoresState next to the other UI-facing store
state, and SteamStore holds no Compose state.
* fix(desktop): Log Out returns to DroidDeck, Return to Gaming Mode opens Steam
Both ended Plasma through the same logout call and the desktop script always
started Steam afterwards. Return to Gaming Mode now leaves a request that the
script reads; a plain Log Out ends the desktop. The app ships the shortcut
with the script so both always change together.
* Wait for the logout reply so a cold Shutdown service still gets the request
* Forget the return to gaming mode when the logout request fails
The Steam copy (AppID 12100) died on "Start new game" at 0042A703: FEX's reduced x87 precision turns a float into a bad pointer. GameEnvironment.knownGames sets FEX_X87REDUCEDPRECISION=0 for it, above the shared settings and below the game's own, and picking a FEX preset for the game keeps the fix.
Co-authored-by: Unixcision <14082251+Unixcision@users.noreply.github.com>
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
* fix(input): programs built with _FORTIFY_SOURCE read the virtual pads
Fortified builds, Flatpak runtimes among them, call __read_chk, __poll_chk
and __ppoll_chk in place of read, poll and ppoll, and glibc's versions go
straight to the kernel. Such programs opened a pad through the shim but read
its backing ring file instead of events, so they never saw input: Marathon
Recompiled's SDL reads the pad through __read_chk.
The shim now provides all three, with glibc's bounds checks, on the same
paths as read, poll and ppoll.
* fix(input): keep glibc's __read_chk for descriptors that are not pads
Only pad descriptors take the shim's read path; the rest go to the next
__read_chk, so fortified reads keep libc's cancellation point. The test
also polls the empty ring with a zero timeout, which a __poll_chk that
bypasses the shim would report as ready.
---------
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
Prepare the rootfs before a native program starts outside a session
The linker and libc are patched for Android's seccomp filter only when a
session starts. A helper started between sessions, after a runtime
update and before the first session, ran the unpatched linker and died
of SIGSYS (exit code 159). The shared native process builder now
prepares the rootfs itself when no session is running.
* fix(mali): Auto respects Venus turned off and picks the bridge on Mali-G2-Ultra
With GPU drivers on Auto, Mali (Venus) was turned back on after the user turned it off. Auto now respects that choice, and picks the bridge on Mali-G2-Ultra, where Steam's web helper dies on its first window through Venus (#2879). When Auto itself turns Venus off it clears the stored key, so its own decision does not read as the user's later.
* fix(mali): clear Auto-owned Venus preference when fallback ends
---------
Co-authored-by: Unixcision <14082251+Unixcision@users.noreply.github.com>
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
* Release zero-copy display buffers at latch; gamescope waits for scanout before reusing an image
* Test that zero-copy releases follow the kernel's fence attach, not the buffer kind
* Pin the gamescope build that waits for scanout before reusing an image
* Probe the fallback output image for scanout so the composite waits on it too
* Pin the gamescope build that probes the fallback output image
## Problem
Zero-copy layer transitions could leave the compositor in an
inconsistent state when allocating an `ASurfaceTransaction` completion
callback failed.
Some failure paths released the current or previous `ASurfaceControl`
even though the transaction had not been applied. This could invalidate
layer state or release resources before the transition completed.
## Fix
- Cancel and delete transactions when completion callback allocation
fails.
- Preserve the current layer and buffer state instead of releasing
resources prematurely.
- Roll back surface swaps when presentation cannot proceed.
- Return an error from failed presentation paths and leave the layer
available for recovery.
- Apply the same failure handling to presentation, layer hiding and
surface retirement.
## Tests
- `git diff --check`: passed.
- Native build: not run locally.
- Device testing:
> Tested on one device and helped with his problem, test build is up for
further testing.
## Changes
- Add vertical page scrolling using the controller's right stick.
> Reuse existing right stick axis detection for better controller
compatibility.
> Convert stick movement into scroll events for Compose scrollable
components.
> Add a dead zone threshold and rate limiting to prevent unintended
scrolling.
## Compatibility
- Supports controllers with different right stick axis layouts.
- Scroll behavior depends on the page's handling of scroll events.
Suggest by _corcse on discord
UwU
- **Perf:** Optimize DD FrameGen flow image initialization and shader
sampling.
> FrameGen should start faster and be more reliable.
- **Perf:** Skip unused FLOWREG image initialization and remove
redundant final FLOWREG barrier.
- **Perf:** Use initialization barriers for fresh framegen images.
> Helps with reliability and performance.
- **Perf:** Reserve capacity for image initialization barriers and Use
fixed storage for image initialization barriers.
- **Perf:** Batch FrameGen image descriptor updates and some FrameGen
image barriers.
> Less calls to the vulkan API.
- **Perf:** Skip unused global motion reduction sums.
- **Docs:** Add OF3_FLOWREG shader documents and some comments.
> This should be helpful when making future changes in the shader, only
for testing and development.
## Fixes
- Fix: Derive OF3 Flow Length from Array Size.
> Should make future changes easier.
- Fix: DD FrameGen scratch resource leak on resize.
- Fix: Present semaphore synchronization to prevent device loss on some
devices.
> Reported by a user, DDFG never worked on his device, this didn't
actually helped him, but im keeping because it can be useful for other
devices.
> issue reported on discord [Link to bug
report](https://discord.com/channels/1552707793247539220/1575946870151446589)
> This file contains the investigation made, in Portuguese:

## Performance
**OLD DroidDeck FrameGen**
| FPS (reported) | 1% low | Frametime | Game | DDFG | Device | DD
version |
|:--:|:--:|:--:|:--|:--:|:--|:--|
| 39.9 → 118.8 | 16.1 | 25.1 ms | Mass Effect | 3× | RP Nova, 12 GB,
Snapdragon 8 Gen 2 | 0.7.11 Stable |
| 32.5 → 91.4 | 21.9 | ## | NieR:Automata | 3× | S26U, SD 8 EG 5, Adr
840 | Preview b08d8e8 |
| 25.2 → 60.0 | ## | ## | Roadside Research | 4× | Odin2 Portal, Adreno
740 | 0.7.11 Stable |
*Report 1 — coleslaw117*
*Report 2 — twitchlemaxou*
*Report 3 — Dylon*
**NEW DroidDeck FrameGen**
| FPS (reported) | 1% low | Frametime | Game | DDFG | Device | DD
version |
|:--:|:--:|:--:|:--|:--:|:--|:--|
## Testing
- All checkd on Github green
- APK compiles
- All verification passed on my fork
- Working on test build
* perf(effects): half-precision upscalers, AMD CAS and a gather-based NIS from Bannerlator
The screen-effect chain ran every upscaler and CAS in fp32, and NIS read its
36-tap support and coefficient tables per pixel. Ported from Bannerlator
(The412Banner/Bannerlator 16595ed8 + 671feb8c), where the same shaders run in
its Wayland compositor:
- SGSR, SGSR HQ, FSR EASU and RCAS get a half-precision build of the same
source (-DDD_HALF=1, *_half_frag.h). The divide-by-zero guards DroidDeck
added to EASU, RCAS and CAS are kept.
- CAS: AMD's FidelityFX CAS (ffx_cas.h v1.0.2, 5-tap), half precision.
- NIS: a prepass writes the scene with luma in alpha at scene size
(nis_luma.frag); nis3.frag gathers that luma and reads its coefficient banks
from a 4 KB uniform buffer (nis_coef.h, set 1 of its own pipeline layout).
Without the buffer, NIS falls back to nis.frag.
- debug.droiddeck.upscale.shaders=old builds the previous fp32 set, for A/B.
The half SGSR, SGSR HQ, CAS, NIS luma and nis3 SPIR-V is identical to
Bannerlator's (glslang 16.2.0). Notices: AMD CAS added to
THIRD_PARTY_NOTICES.txt; NVIDIA NIS covers the new NIS files.
* fix(effects): NIS prepass address at full precision; fast NIS only where it is safe
From review:
- nis_luma.frag: the half build made gl_FragCoord RelaxedPrecision, so a
16-bit load rounds pixel centres past x = 1024 (1279.5 -> 1280) and
texelFetch reads the wrong or an outside texel. Only colour and luma are
mediump now; the load and the integer address stay full precision
(checked in the SPIR-V).
- Fast NIS keeps luma in alpha, so it runs only on chain formats with at
least 8 alpha bits; the 10-bit HDR composition format (2-bit alpha) uses
nis.frag.
- A driver that rejects nis3_half or nis_luma_half gets nis.frag instead of
a disabled effects chain.
- If the NIS luma target cannot be allocated, that frame uses SGSR from the
scene instead of skipping every effect.