Commit Graph
3018 Commits
Author SHA1 Message Date
The412Banner 63dbb01185 fix(proton): set the anti-cheat runtime when the x86-64 tool is chosen directly 2026-12-06 11:04:38 +00:00
Jay Pokale 98f14f4005 Fix typos in comments and docs (#3796) 2026-12-06 04:32:09 -05:00
The412Banner 59397f0ef9 feat(bionic): dd-directcontroller, XInput from the pad state for games started without Steam (#3792)
Two problems with games set to "Start without Steam" on DroidDeck-Bionic.

1. launch.sh set WINE_LSTEAMCLIENT=1 for every launch, so Wine replaced any steamclient(64).dll
   a game loads with lsteamclient, DroidDeck's bridge to its Steam client. A game started
   without Steam has no Steam client behind it; one that brings its own steamclient64.dll (a
   Steam emulator such as gbe_fork's ColdClient loader) quit after its splash screen because
   SteamAPI_Init failed. With DROIDDECK_NO_STEAM on, launch.sh now sets WINE_LSTEAMCLIENT=0
   unless the player set a value.

2. Wine's xinput reads the HID reports winebus makes from the evdev events fakeinput replays
   out of each controller ring, through a queue per handle. A game that reads them slower than
   the pad reports gets old stick positions: in Halo: The Master Chief Collection the character
   kept moving for a second or two after the stick was let go (vibration off in DroidDeck and
   in the game changed nothing).

dd-directcontroller (tools/bionic-runtime/dd-directcontroller) is an XInput DLL set
(xinput1_1..1_4, 9_1_0, uap; ARM64X for system32, i386 for syswow64) that answers
XInputGetState from the snapshot of the whole pad FakeInputWriter keeps in each ring file's
header (sequence-locked, read with 32-bit loads only). XInputSetState returns at once; a worker
thread hands rumble changes to a renamed copy of Wine's builtin xinput1_4
(dd-directcontroller-wine-xinput.dll), so rumble keeps DroidDeck's force-feedback path without
Wine's lock holding up a game thread. A pass-through mode sends every call to that copy. A
background thread reads the mode file every 250 ms ('1' direct, '0' pass-through) and does the
once-a-second ring and pad-node checks, so a game thread never waits on a file. Based on
Bannerlator's direct XInput DLL (GPL-3.0).

- launch.sh copies the DLLs into the prefix (replacing the links to the tool's builtins, never
  writing through them), sets xinput*=n,b and writes the mode file next to the controller
  folder (DD_DIRECTCONTROLLER_CONTROL) when the game is set to start without Steam;
  DD_DIRECTCONTROLLER=0 starts it in pass-through, and a game no longer set to start without
  Steam gets Wine's links back. DROIDDECK_NO_STEAM is kept in the environment it passes on.
- tools/bionic-runtime/build.sh builds and checks the DLLs (export tables of both ARM64X views,
  imports, no TLS directory, version resource) with a pinned llvm-mingw and runs the host test
  of the ring reader; the workflow caches the toolchain.
- App: a "Direct controller" switch under Controller > Device settings in the session menu,
  shown while the running game uses dd-directcontroller. It writes the mode file, so the game
  moves between the pad state and Wine's own xinput at once, and saves the choice for the game
  (DD_DIRECTCONTROLLER=0). A session deletes the mode file at start, so only a launch that uses
  dd-directcontroller brings the switch back. Translated in every language.


Review fixes: synchronized setting save; the DLL pins itself before its worker threads; pass-through forwards XInputPowerOffController; launch.sh keeps a native XInput DLL that is neither Wine's nor ours; switch requests run in order; XInputEnable reaches Wine's xinput when there is no rumble worker.
2026-12-06 04:16:37 -05:00
MaxsTechReview a8224c76a2 fix(components): pair native D3DX with its effect compilers (#3461) 2026-12-06 02:09:29 -05:00
DantalianandDantalian ed106ea840 fix(theme): pin the status bar black like the navigation bar (#3780)
Co-authored-by: Dantalian <Dantalian-dev@users.noreply.github.com>
2026-12-06 01:37:02 -05:00
The412Banner 96ae61541c fix(components): Match bundled .NET installers to their runtime
Detect modern .NET runtimes separately from .NET Framework and refresh cached detector results.
2026-12-06 01:06:57 -05:00
Tushar Gandhe a4751dacbe feat(settings): Keep search history and center opened settings
Recall recent Settings searches and bring the setting opened from search into view.
2026-12-06 00:34:44 -05:00
LunaDL f50691ebc9 fix(theme): Keep Inner Gamer animation from resetting screens
Keep the settings composition stable while the animated palette and speed change.
2026-12-06 00:03:11 -05:00
kalac2232 2ab642bf4e fix(session): Handle invalid filenames when trimming page cache
Walk files with NIO and skip unreadable entries. Keep page-cache trimming from interrupting session startup.
2026-12-05 23:34:33 -05:00
Kurt Himebauch cad55fc2b9 Keep adaptive sticks visible at rest
Separate adaptive stick capture from idle visibility and keep dock touch capture bounded.
2026-12-05 23:33:11 -05:00
Kurt Himebauch a02ea07386 ci: Fail main build on VirusTotal detections
Enable the existing fail_on_detection flag for the main APK scan.
2026-12-05 23:16:17 -05:00
Kurt Himebauch c1d6d425fa Exclude Android Native sleep from Steam playtime (#3777)
* Prepare Steam playtime before Android Native suspend

* Keep Steam wake recovery ordered and retry transient delivery

* Keep pending Steam wake recovery across idle requests

* Make Steam wake race tests wait on explicit gates

* Synchronize all Steam preparation timing tests
2026-12-05 22:58:01 -05:00
Kurt Himebauch 70be3d3eea Add a single-column Side strip HUD preset (#3783)
* Add a single-column Side strip HUD preset

* Keep only the 1% low in Side strip
2026-12-05 21:24:08 -05:00
MaxsTechReview f2206893d0 fix: Share logs includes Easy Anti-Cheat launcher logs from game prefixes (#3760)
* fix: Share logs includes Easy Anti-Cheat launcher logs from game prefixes

Anti-cheat launch failures only show the real error code in anticheatlauncher.log inside the game's compatdata prefix, which Share logs never collected. Recent .log files under each prefix's EasyAntiCheat folder are now added under anticheat/<appid>/ with high share priority.

* Keep only the anti-cheat app ID readable and keep launcher logs from every library

A numeric folder name is readable only as the app ID right under anticheat/; elsewhere it is hashed as before. Prefixes for the same app ID in a second library go under anticheat/<appid>/library<N>/ so neither log is dropped.

* Keep signed compatdata prefixes and mark unreadable ones as partial in Share logs

* Keep discovery records inside the manifest limit

* fix(logs): keep both prefix folders when signed and unsigned app ids collide

* fix(logs): give each anti-cheat prefix its own sibling folder in the archive

* fix(logs): share the current session's game logs before anti-cheat logs

* fix(logs): order enhanced exports by share priority and record denied anti-cheat folders
2026-12-05 20:42:07 -05:00
MaxsTechReviewandKurt Himebauch ce64f5ade4 fix(gog): create ISI savePath folders on first launch (#3452)
* fix(gog): create ISI savePath folders on first launch

* Use the existing case of GOG save folder roots

---------

Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-12-05 20:29:55 -05:00
Kurt Himebauch c85e82683b Standardize native runtime defaults (#3779)
fix: standardize guest runtime defaults
2026-12-05 19:51:23 -05:00
LunaDLandKurt Himebauch 88d44b0dc6 Feat: Improve ARMv8.0 Steam compatibility with LSE emulation (#3720)
* feat: emulate LSE atomics so the Steam client starts on ARMv8.0 CPUs

* fix: keep NZCV across patched LSE min/max stubs and catch st* aliases

* fix: fail the LSE check when objdump fails

* fix: validate the CASP pair on a mismatch in the LSE emulator

* fix: sandboxes switch on the LSE emulator when it is preloaded

* fix: keep the MaliBridge pointer from main

* Handle LSE atomics before preload constructors

* Support early LSE handling in root guest processes

* Fix LSE-Emu signal and patching review findings

* Assert CASP and min/max sites use patched stubs

* Correct patch test statistics regexes

* Validate SIGILL syscall ABI and retain active state on restore failure

* Preserve the previous SIGILL disposition during early install

* Synchronize instruction fetch on generated LSE stubs

* Address LSE-Emu follow-up review findings

* Fix missing LSE signal handler state declarations

* Honor application signal mask when forwarding SIGILL

* Preserve SA_RESETHAND mask during handler forwarding

* Fix LSE opt-out after early handler install

* Avoid recursive SIGILL forwarding during LSE emulation

* Fix LSE SIGILL handler re-entry tracking

* Honor SA_NODEFER in forwarded SIGILL mask

* Preserve nested SIGILL delivery semantics

* Preserve explicit SIGILL mask with SA_NODEFER

* Reduce LSE patch contention across threads

* Guard nested faults before acquiring patch lock

* Fix early SIGILL restore and wake patch waiters

* Preserve libc restorer when restoring application SIGILL

* Wait for concurrent LSE patch instead of skipping

* Fix LSE patch lock release and fork recovery

* Avoid reinstalling the early SIGILL handler

* chore: retrigger CI

* Avoid proc maps reads in concurrent SIGILL patching

* Prevent late IFUNC handler install when emulation is disabled

* Clarify cached mapping lookup

* Move cached map declarations before find_gap

* Default LSE instruction patching to off

* Document conservative LSE emulation default

* Keep LSE instruction patching opt-in in sandbox preload

* Document default and opt-in LSE emulation checks

* Assert LSE patching remains opt-in in sandbox tests

* Align LSE device checks with SDK 34 patching behavior

* Check expected mprotect failures in opt-in device run

* Clarify LSE emulator device validation criteria

* Specify controlled SDK mprotect validation

* fix(lse-emu): publish SIGILL actions atomically

* fix(runtime): honor LSE_EMU=0 before preload

* test(runtime): keep LSE preload disabled when opted out

* fix(runtime): fully honor LSE_EMU=0 opt-out

* test(runtime): verify LSE opt-out removes inherited preload

* fix(runtime): filter inherited LSE preload without preload file

* fix(lse-emu): use bounded signal-safe action snapshots

* fix(runtime): split inherited preloads on spaces and colons

* test(runtime): cover both LSE preload entry orders

* fix(lse-emu): recycle displaced SIGILL snapshots

* fix(preload): preserve colliding path cache entries

* test(lse-emu): report patch failure details

* fix(lse-emu): serialize action snapshot publishers

* fix(lse-emu): fall back to reachable arena mapping

* fix(lse-emu): make signal action publication nonblocking

* refactor(lse-emu): remove obsolete publisher lock

* Fix SIGILL snapshot retirement and honor session LSE opt-out

* Preserve the Java staging API and isolate the SIGILL stress test

* fix(nativeguest): filter LSE preload when disabled

* fix(lse-emu): tighten seccomp and signal setup

* fix(session): preserve active LSE override while staging

* fix(lse-emu): return atomically displaced signal actions

* fix(lse-emu): stage raw signal masks safely

* fix(lse-emu): distinguish seccomp listener success

* fix(lse-emu): publish seccomp veto atomically

* fix(lse-emu): fail closed on RX restore errors

* fix(lse-emu): keep stack-using atomic stubs on trap path

* fix(lse-emu): allow patching with inherited seccomp

* test(lse-emu): cover LDAPR patch path

* test(lse-emu): assert LDAPR-only patching

* fix(nativeguest): filter disabled LSE from preload chains

* docs(lse-emu): define inherited seccomp patch policy

* fix(lse-emu): emulate LDAPR trap fallback

* refactor(lse-emu): remove unused seccomp query

* fix(nativeguest): release filtered preload chain in scope

* test(lse-emu): allow forwarded udf diagnostic

* fix(nativeguest): avoid unsafe preload fallback when disabled

* test(lse-emu): match full zero instruction field

* test(lse-emu): match complete instruction diagnostics

* Keep nested native preloads from duplicating host libraries

* fix(nativeguest): fail exec when disabled preload cannot map

* fix(nativeguest): stop exec when preload mapping fails

* fix(nativeguest): propagate preload filter allocation failures

* Consume only the selected one-shot SIGILL action

* Reclaim abandoned SIGILL action slots after fork

* Revalidate the live file mapping before optional LSE patching

---------

Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-12-05 19:09:28 -05:00
MaxsTechReview 73fac3723f fix: Games start again in proot sessions (session preload no longer needs spare static TLS) (#3765)
* Keep the session preload loadable when spare static TLS runs out

The syscall-dispatch selector pointer in the zram preload used the
initial-exec TLS model. That marks the whole libddsession TLS block
(about 1.8 KB) as static, so loading it at runtime needs that much spare
static TLS. Under proot there is not enough, and every guest program
failed with "cannot allocate memory in static TLS block". The default
model keeps the same per-thread behaviour without that requirement.

* Read the dispatch selector only once a thread has turned dispatch on

A thread's first read of the selector can allocate its TLS block when the
preload was loaded at runtime. The page-out handler and the prctl wrapper
now read it only after some thread in the process enabled syscall user
dispatch, so processes that never use it never touch the variable from a
signal handler.

* Keep the dispatch selector in a thread key so the signal handler never allocates

* Bind the selector lookup before the handler can run and refuse to arm dispatch without a selector slot

* fix(preload): retry selector key setup after key exhaustion

* fix(preload): publish the dispatch selector only after the kernel accepts it
2026-12-05 18:57:23 -05:00
Kurt Himebauch 1596e2966d Organize Developer settings and label droiddeckctl (#3770) 2026-12-05 17:28:14 -05:00
Kurt Himebauch 16ea8d9168 Use a keypad for wireless debugging pairing codes (#3766)
* Use a keypad for wireless debugging pairing codes

* Make wireless pairing keys legible in SystemUI

* Fit both keypad rows in the heads-up notification

* Find the verified loopback ADB port after pairing

* Post the pairing keypad as a separate heads-up alert

* Keep the pairing keypad accessible and recover rotated ADB ports

* Show how to keep the pairing popup open
2026-12-05 17:19:51 -05:00
Kurt Himebauch 423f600d4b Match the Dev Harness dropdown to the usage tracker (#3762)
Match the agent model picker to the usage panel
2026-12-05 16:31:37 -05:00
Kurt Himebauch 3b0c0d3496 Add landscape-only fullscreen for launcher and sessions (#3764)
Add portrait-aware fullscreen for launcher and sessions
2026-12-05 16:30:37 -05:00
The412BannerandKurt Himebauch 565bd7c6b1 fix(storage): record all-files access in session logs and warn when added games need it (#3470)
* fix(storage): record all-files access in session logs and warn when added games need it

* Cover all added games in storage access diagnostics

---------

Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-12-05 16:24:52 -05:00
MaxsTechReview caae385924 fix: Game debug logs reach x86-64 Proton games and Share logs keeps them (#3759)
* fix(fex): game debug logs reach games run on the x86-64 Proton

The x86-64 DroidDeck-Proton path runs the game through droiddeck-fex proton,
which applied per-game settings but never the Game debug logs or Detailed
graphics logs, so no Proton log was written for those launches. The proton
action now applies both after the game's settings, as droiddeck-game-env does,
and caps the Proton log size.

* fix(logs): Share logs keeps a session's game logs ahead of Steam client logs

The shared archive packed the Steam client's own logs (several MB each) before
the session's game logs, so the 64 MB budget could run out and drop the Proton
log Game debug logs had just written. Session-critical files go first, then the
session's game logs, then everything else.
2026-12-05 13:00:31 -05:00
The412Banner c54cadacde fix(decky): stop the plugin reload loop that leaks Steam's UI memory (#3741) 2026-12-05 12:57:53 -05:00
The412BannerandKurt Himebauch 6da10cf986 fix(diagnostics): the session report names the firmware build date (#3484)
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-12-05 12:56:55 -05:00
The412BannerandKurt Himebauch b37bc316bb fix(display): the frame limit lifts after picture-in-picture instead of holding the session at 30 fps (#3708)
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-12-05 12:55:20 -05:00
The412BannerandKurt Himebauch eaa64597e0 fix(logs): Share logs keeps the running session's game log when Steam's own logs are large (#3397)
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-12-05 12:54:57 -05:00
The412Banner 9d7821f120 fix(game-debug): show vkd3d-proton warnings in game debug logs (#3713) 2026-12-05 11:17:14 -05:00
SlicelessBread c72316f5a7 fix(ctl): reach the broadcast bridge of release variants under another package (#3718) 2026-12-05 11:10:53 -05:00
Daniel b0f459607d fix(effects): replace the SMAA approximation with SMAA 1x (#3727) 2026-12-05 11:03:09 -05:00
The412Banner 374aa6d68c fix(game-env): full FEX x87 precision for PlayStation PC SDK games (#3730) 2026-12-05 11:01:26 -05:00
Hy300leosquizz 68940c862b fix(zerofg): four frame-generation fixes split out of #3611 (#3731) 2026-12-05 10:53:03 -05:00
Tushar Gandhe 6a6bab812f fix(ui): icons on tab dropdowns and in menu rows have their label's color (#3757) 2026-12-05 10:51:53 -05:00
Kurt Himebauch 0b7d7aa634 Fix Air Triggers on RedMagic phones with unnamed input devices (#3755)
Recognize RedMagic triggers merged into an unnamed keyboard
2026-12-05 10:34:47 -05:00
K11MCH1 b63a72affb Add Game Space's Air Trigger actions, vibration and light effects (#3752)
Game Space's shoulder trigger settings have more than a button mapping.
The Air Triggers panel now offers the same options:

- Vibration when a trigger is touched.
- The shade Game Space draws on the screen edge under a touched trigger,
  red for the left trigger and blue for the right.
- The trigger LED effect: off, steady or pulse. DroidDeck sends the code
  RedMagic's lighting settings give that effect.
- Per trigger and layout: single tap holds the button while the trigger
  is touched (the previous behaviour), long press keeps it pressed until
  the next touch, and rapid fire clicks it while the trigger is held at
  Game Space's low, normal or high click frequency (2, 5 or 10 clicks a
  second).

Vibration, the shade and the LEDs follow the finger on the trigger, not
the clicks rapid fire sends. Long press and rapid fire press a toggle
button as a plain one, and on-screen buttons vibrate only for finger
presses.
2026-12-06 00:33:16 +09:00
MaxsTechReview b9f149b3c9 fix(proton): hand steam:// links to Steam and route anti-cheat in Unreal binary folders (#3754)
* Hand steam:// links to Steam and find anti-cheat files in Unreal binary folders

The link helper skipped itself by comparing resolved paths. Without proot the same
file is reachable under two paths, so the helper ran itself forever and a launch
whose Proton fix asks Steam to install a runtime never started. It now compares the
files themselves and passes steam:// links to the Steam client.

Anti-cheat routing looked only three folders deep, which misses the
<Project>/Binaries/Win64/<anti-cheat> layout Unreal games use; it now looks five deep.

* Use whichever anti-cheat runtime is installed when a game ships both kinds
2026-12-05 10:11:48 -05:00
MaxsTechReview 8d34be4b0d Fetch the x86-64 DroidDeck-Proton when an anti-cheat runtime is installed (#3751)
* Fetch the x86-64 DroidDeck-Proton when an anti-cheat runtime is installed

* Find anti-cheat runtimes in every Steam library and move the default with the x86-64 build

The runtime probe now resolves each library of both Steam clients through the
session's mounts, so a runtime on a card or added library, or in the x86-64
client's libraries, starts the automatic download. Replacing an older x86-64
build moves a general default that names it, as Bionic already did.

* Probe the configured card library for anti-cheat runtimes

A card library that libraryfolders.vdf does not list is still searched at
launch, so the runtime probe checks it too, for both Steam clients.
2026-12-05 08:54:42 -05:00
K11MCH1 e595792dd7 Turn RedMagic Air Triggers on again after Game Space's own setup (#3749)
Game Space sets up the triggers for every app that comes to the front.
For an app without a Game Space trigger case, that switches the trigger
keys and lights off. At session start this ran right after DroidDeck
opened the triggers, so they stayed off. Opening now applies again 1 and
5 seconds later, and closing cancels the pending reapply.

Entering the trigger light scene writes the lights off, so they stayed
dark until a trigger was released. Opening now ends with the release
actions, which show the idle light picked in RedMagic's lighting
settings. This also covers turning the triggers on from the drawer.
2026-12-05 21:47:13 +09:00
K11MCH1 8a27ea841c Add RedMagic Air Triggers to the session's controller settings (#3737)
* Add RedMagic Air Triggers to the session's controller settings

Controller > Device settings gets a "Redmagic Air Triggers" panel on
RedMagic phones whose Game Space exposes its trigger provider. The
toggle switches the shoulder triggers to plain F7/F8 keys through Game
Space's exported TgkDataProvider (no permission, no trigger panel or
markers), and each trigger presses a button of the active touch layout:
LT and RT by default, or any button picked in the dropdowns, saved per
layout.

The triggers go back to their earlier state when the toggle is off,
the session pauses or ends, or the app is killed mid-session (the next
session start closes what this app opened). A distribute state another
app turned on is left alone.

* Show Air Trigger presses on screen and light the triggers

A trigger now presses its button through the on-screen controls when
that button is shown, so it shows as pressed and shares a toggle
button's state with touches. A hidden button still gets the trigger's
own input source.

Game Space lights the triggers only from its own trigger view, through
ColorfulLightManager, which apps cannot call. DroidDeck sends the same
requestColorfulLight to the ColorfulLightService binder: the shoulder
scene while the triggers are on, and the press/release lights the
user's RedMagic lighting settings ask for.

* Set the trigger light effect so the Air Trigger LEDs turn on

RedMagic's light service writes no trigger light until a shoulder
effect has been set, and only Game Space's own trigger view sets one.
After entering the shoulder light scene, send the effect the user picked
in RedMagic's lighting settings (selection in lighting_shoulder_config_json).

* Cancel forced Air Trigger releases and close the triggers while paused

A trigger press that DroidDeck ends itself (focus loss, the triggers
closing, another button chosen mid-press) now cancels the button like a
cancelled touch, so a command button such as the keyboard does not run.

A toggle latched while its button was hidden is handed to the visible
button on the next trigger press instead of staying held underneath it.

The triggers also close while the session is paused and reopen when it
resumes.

* Keep an Air Trigger hold when a touch on the same button is cancelled

A cancelled touch stream cleared every press of the button, including
the Air Trigger still holding it, so the button let go while the trigger
stayed down. Touch cancels now end only the finger presses. Releasing
all input still clears the button completely.

* Release Air Trigger-only button holds when all input is released

Releasing all input only cancelled buttons a finger owned. A button held
only by an Air Trigger kept its pressed state after its output was
released, so it stayed lit and a finger on it did nothing until the
trigger was lifted. A full release now cancels every button.
2026-12-05 19:38:03 +09:00
MaxsTechReview 872c5e1834 fix(native): reopen refused memfds and answer links in the form they are named (#3734)
* fix(native): reopen refused memfds and answer links in the form they are named

Android's app policy refuses the open permission on memory files, so a
read-only reopen of an own memfd through /proc/self/fd/N,
/proc/thread-self/fd/N, /proc/<own pid or thread>/fd/N or /dev/fd/N
failed with EACCES while read, write and mmap of the descriptor still
worked. The hook now answers such a refused read-only open with a new
memfd holding the same bytes, name, mode and seals. Writable opens,
other processes' descriptors and regular files stay refused. FEX routes
guest openat through libc syscall(), so x86 guests get the same answer.

readlink() stripped the rootfs prefix from every target, so a link
stored with a real target (Proton's s: drive) read as /root/... while
getcwd(), /proc/self/fd and /proc/self/maps give the real path, and a
path resolved through the link no longer matched the working directory.
A link named by its real rootfs path, and /proc/<pid>/cwd, now keep the
real target, as realpath() of a real path does; guest and relative names
keep the guest form.

* fix(native): keep the memfd copy read-only, leave openat2 errors native, keep guest form for remapped link names

The copy that answers a refused read-only memfd reopen is now sealed
against writes and resizing, so it cannot be written through as a
read-only descriptor could not. openat2 reads its open_how only after
the kernel refused the open with EACCES, so an unreadable pointer gets
the kernel's EFAULT. readlinkat and fstatat keep the guest form for a
relative name the hook remapped to a real path; only a name the caller
supplied in real form keeps the real target.

* fix(native): pin the memfd being copied and refuse copies that cannot match it

* Copy a refused memfd only when the path and the descriptor name one file
2026-12-05 02:54:50 -05:00
2d25fb91c5 Run Easy Anti-Cheat and BattlEye games on x86-64 DroidDeck-Proton under FEX (#3641)
* FEX: emulate x86-64 ptrace, seccomp and /proc for anti-cheat launchers

* Guest hook: route raw execve/execveat through the exec wrapper and pass self-sent SIGSYS to the program

A program that execs with syscall(SYS_execveat, ...) bypassed the environment the
guest needs, so re-executing /proc/self/exe died in the loader. /proc/self/exe now
maps to the real program on exec as it already does on open.

A SIGSYS the program queues itself, or one from a filter for another architecture,
went to the Android-filter emulation instead of the program's handler.

* FEX: list only guest mappings in /proc/<pid>/maps on hosts below 47 address bits

Credit the anti-cheat emulation source in the patch header.

* Preloads: leave poll, ppoll and select buffers untouched when no emulated device is open

A bad user pointer now reaches the kernel and returns EFAULT instead of crashing the caller inside the wrapper.

* Emulate only host-architecture seccomp traps in the guest hook; report the calling thread's seccomp mode in FEX's /proc/self/status

A SIGSYS carrying another architecture's seccomp siginfo now takes its default action when the program has no handler, so a process whose emulated filter traps a syscall while SIGSYS is blocked or ignored dies as on Linux.

* FEX: read the host status file through the raw openat syscall

* README: credit StonkGuy's FEX anti-cheat emulation

* FEX: open the host status file with a direct system call so preloads cannot rewrite it

* FEX: hand a traced program's ptrace state across exec

* Credit StonkGuy in the FEX anti-cheat patches and README

Co-authored-by: StonkGuy <68372320+StonkGuy@users.noreply.github.com>

* FEX: open guest paths with the raw openat system call so host preloads cannot replace the file

* FEX: serve emulated proc files by the requested path when the host returns a memfd

* FEX: map fixed guest memory above a small host address space

Co-authored-by: StonkGuy <StonkGuy@users.noreply.github.com>

* FEX: serve decoder reads from fixed guest memory above the host limit

* Run games with anti-cheat files on an x86-64 DroidDeck-Proton under FEX

The Proton launchers look for Easy Anti-Cheat or BattlEye bridge files in
the game folder and, when an x86-64 DroidDeck-Proton and the matching Proton
runtime are installed, hand the launch to that Proton under FEX with the
game's own prefix. Picking the x86-64 tool directly also runs it under FEX.
DROIDDECK_ANTICHEAT=off keeps a game on ARM64.

* Keep x86-64 DroidDeck-Proton builds out of the ARM64 tool list

* droiddeck-fex: take the runtime from an adopted tool's original manifest

* FEX: show the guest command line when the argument area cannot be remapped

* FEX: describe the container's procfs in emulated mount tables

* FEX: order the anti-cheat series after the guest stack patch from main

* Test the container procfs view of FEX's emulated mount tables

* Docs: describe the anti-cheat signal mask fix and the container procfs view

* README: match the StonkGuy credit to the renumbered FEX patches

* Keep anti-cheat games on a tool the user chose instead of moving them to x86-64

* test(game-env): build the adopted-tool wrapper through extra_wrapper_sh

* Check anti-cheat runtime bridges, apply component choices under FEX and honour MAP_FIXED_NOREPLACE above the host limit

* Check the driver query is answered before each wrapper's call sites

* Keep x86-64 Proton builds out of the automatic default tool

* Keep high guest mappings intact when a fixed map or unmap fails

Check room in the region table, splits included, before a fixed map or
unmap removes anything, return the host munmap error without touching
the table entry, and keep write-protecting low shared aliases of
executable ranges that sit above the host address limit.

* Keep a requested x86-64 default and accept linked anti-cheat runtimes

A request for the current automatic x86-64 default now marks it as the
app's choice, so the next settle no longer moves it back to ARM64.
Anti-cheat runtime discovery follows a symlinked runtime directory.

* Route anti-cheat games to x86-64 Proton only on a capable FEX

The FEX build now lists its patches in share/fex-emu/.droiddeck-patches.
Anti-cheat routing needs the fixed guest memory patch in that list and
otherwise keeps the launch on ARM64, as an older FEX cannot map the
anti-cheat helper buffer above the host address limit. Installing a FEX
build without the list removes a list left by an earlier build.

* Update FEX before deciding anti-cheat routing

A device on an older FEX build never went through droiddeck-fex on the
ARM64 path, so the catalog FEX was never installed and the gate kept
anti-cheat games on ARM64 forever. dd_anticheat now runs the new
droiddeck-fex update action first, which installs the catalog build
under the same lock and retry window as other FEX launches.

* Leave MAP_FIXED_NOREPLACE above the host limit to the host

Wine finds the top of the address space with MAP_FIXED_NOREPLACE probes.
Claiming those probes above a 39-bit host limit made Wine place its stacks
in relocated memory, and every wineserver request then failed with EFAULT
because the iovec buffers it passes to writev are nested pointers that are
not translated. Only MAP_FIXED requests are relocated again, so the probes
see the real host limit while fixed mappings above it keep working.

* Translate only pointer syscall arguments into high guest memory

Pointer arguments are now picked from a per-syscall layout table, so
scalar values such as a truncate length are never rewritten. Sized
buffers must map to one contiguous host range or the call fails with
EFAULT, and new host backings are placed next to their guest
neighbours so adjacent mappings stay contiguous. readv, writev and the
preadv/pwritev family, sendmsg and recvmsg get a host-side copy of
their iovec and msghdr with translated bases, leaving the guest copies
untouched. Code invalidation for kernel writes maps the host buffer
back to its guest address, and an unmap checks the table before it
changes any host mapping.

* Claim high guest memory only with LSE atomics and invalidate every code alias

High guest mappings are claimed only when the JIT emits LSE atomics, and
exclusive load/store instructions are never single-stepped, so an atomic
on high memory cannot spin. A store into high code invalidates every
mirror of the written page through the tracked mapping. madvise and
mprotect on high memory apply to each region at its own host address.

* Reject wrapping lengths and drop stale code on discarded high memory

A nonzero length that wraps when page-aligned now fails madvise with
EINVAL and mprotect with ENOMEM, as on Linux. Discarding advice on
high memory invalidates translated code for the range whenever advice
reached any region.

* Add an end-to-end probe for guest memory above the host address limit

* Emulate exclusive pairs on high guest memory and release failed host unmaps later

* Size counted guest buffers by element and keep exclusive access within guest protection

poll, ppoll, epoll waits, mmsg calls and select bitmaps now translate the whole array their count describes, so a buffer that crosses into an unrelated host range fails with EFAULT and oversized counts cannot wrap. High regions remember their protection through mprotect, splitting at the range edges, and exclusive stores to read-only pages or loads from inaccessible pages reach the guest as a fault instead of being emulated.

* Refuse a high unmap when failed host unmaps could not all be retained

UnmapLocked counts the overlapping regions before it changes anything and returns ENOMEM when the retired list could not hold all of them, so a host range is never dropped from tracking while still mapped.

* Serve memory trim requests while syscall user dispatch blocks

A thread that runs with syscall user dispatch on and its selector set to
block (as x86-64 Wine does while in Windows code) took the trim signal
with the selector still blocking. Every raw syscall the handler made was
then dispatched to the program's SIGSYS handler, which either deadlocked
the thread or killed the process when SIGSYS was blocked, so the session
saw it as a deaf process and the game stalled during loading.

Track the selector each thread registers through prctl, allow syscalls
for the length of the handler and restore the selector before returning.

* Allow syscalls for a forwarded prctl while dispatch blocks

The prctl wrapper issues its syscall from the preload's own text, so a
thread whose selector blocks got SIGSYS where the plain libc call would
have been dispatched the same way by the caller's own rules. Allow
syscalls for the forwarded call and restore the selector afterwards.

The dispatch test now waits until the selector blocks before it sends
the trim request, and checks a prctl call made while it blocks.

* Merge high regions after protection changes and translate message batches

Protect now merges neighbouring high regions whose guest and host
ranges touch and whose protection and code state match, so toggling
page protections no longer fills the region table.

Exclusive loads on high memory accept write-only pages and exclusive
stores need only PROT_WRITE, matching x86-64 where writable pages are
readable.

sendmmsg and recvmmsg translate the name, control and io vectors of
every message in the batch, return msg_len for each processed message
and the received header fields for recvmmsg.

Counted arrays passed to getgroups, setgroups, semop, semtimedop,
io_submit, io_getevents, io_pgetevents, move_pages, futex_waitv and
listmount are now checked to stay within one host range. The unused
ToHost helper is removed.

* Translate fixed-size, string and in-array guest pointers in high memory

Give every syscall pointer without a length a fixed x86-64 size, a
length read through another argument, or a terminator scan for strings,
so spans crossing separately backed regions are refused before the
kernel sees them. Size message queue buffers as the type word plus
msgsz. Translate io_submit control blocks and their buffers, including
vectored reads and writes, through bounded host copies, restore the
guest words afterwards, and report guest iocb addresses back from
io_getevents. Translate move_pages page lists for the calling process
and futex_waitv addresses. Merge new mappings with matching neighbours.

* Size high-memory syscall spans by kernel widths and embedded sizes

Read counts with the width the kernel uses for each argument, so int
and unsigned int counts ignore the upper register bits and negative
counts reach the handler. Size capability data by its header version,
perf and scheduler attributes, file handles and mount requests by their
own size fields, and landlock rules by rule type. Keep the translated
prefix of a message batch, read headers that span separate backings one
by one, write results back through the current guest mapping, and stop
counting messages whose length cannot be stored. Revisit an entry moved
into an earlier slot while merging regions. Give newer syscalls
fallback numbers in the test harness.

* Send translated message batches one message at a time

Submit sendmmsg batches that need scratch headers one message per call,
storing each length before the next message goes out, so a length that
cannot be stored stops the batch where Linux would. Skip the name length
when no name was given and store flags before the control length. Check
the whole fixed file-handle header even when its size is invalid. Hand
capget and capset a private header so the checked data size matches the
version the kernel reads, and return a rewritten version to the guest.
Patch and restore AIO control blocks under the mapping lock and restore
only the block that was patched.

* Harden high-memory aio, capability and message batch write-backs

Restore patched aio buffers through /proc/self/mem when the control block
became read-only and keep the scratch vectors alive if that fails too,
fault capability calls whose header write-back fails, stop send batches
after a short message, and pin the batch socket with a private dup.

* Pin batch sockets, fall back to whole batches and reconcile pending aio restores

Follow-up message sends and the first dispatch share one duplicated
socket. When it cannot be duplicated, the whole translated batch goes
to the kernel in one call and lengths are written back up to the first
one that cannot be stored. Short sends compare against the iovec
lengths given to the kernel. Unrestorable aio_buf edits, including
unreadable control blocks, keep their storage in a bounded list that
later submissions reconcile.

* Stop message batches at unreadable vectors, send singly without a spare descriptor and reserve aio restore slots

A message whose iovec snapshot cannot be taken ends the prepared batch
instead of being sent with an unknown length; when it is the first
message the kernel handles the original array natively. When the
batch socket cannot be duplicated, messages still go one at a time on
the original descriptor with each length written before the next send.
Pending aio restore slots are reserved under the pending mutex before
the first guest edit and released or handed to the pending record, so
concurrent submissions cannot exceed the bound. Tests use a real
socket pair, injected descriptor exhaustion and concurrent
reservations.

* Send only the first message of a batch when the socket cannot be pinned

* Replay high-memory faults over the whole access and reconcile aio restores on unmap

* Keep high-memory traps ordered, fault-exact and locked against unmap

Protect, Map and low mmap/munmap/mremap/mprotect reconcile pending aio
restores at once, and io_submit reconciles them even when no high region
is mapped. Ordered loads and stores split across backings are emulated
between full fences instead of being byte-copied through the trampoline;
atomics and exclusives are still refused. Gather and scatter use
fault-safe copies, and a failing piece is re-faulted at the guest
instruction through a probe load, with SIGBUS redelivered the same way.
The VMA lock is held from planning until the scatter finishes, so unmap
and protect cannot race a resumed access. Sign-extending loads are no
longer classified as writes.

* Defer user signals while guest high memory mappings are held

Only the trampoline breakpoint completes a replay, user-sent SIGSEGV,
SIGBUS and SIGTRAP raised while the mapping lock is held are requeued
after it is released, and stranded control block words are restored
when their page turns readable again. The harness now runs under a
timeout.

* Rebase the FEX patch series onto FEX-2612

* FEX: restore stranded aio words before readable protection, report failures

Restore every pending aio word in the range before a readable guest
protection is applied, on both the high and low paths, and fail the guest
mprotect with the old protection kept when a word cannot be restored or its
window cannot be closed. Ignore user-sent SIGSEGV/SIGBUS after deferral,
read the cleared syscall info when resuming with guest GPRs and on restore,
and check exclusive acquisition from a separate thread in the harness.

* FEX: submit aio control blocks through private host copies

Stop editing guest IOCBs in place when aio_buf needs translation. io_submit
now hands the kernel a host copy of each such control block, maps
io_event.obj back to the guest pointer when the completion is reaped,
redirects io_cancel by guest pointer and context to the copy, and frees
copies on reap, on io_destroy, or when the kernel did not accept them.
The guest control block is never patched and its protection is never
touched, so the pending restore records, the protection windows and the
restore hooks in mmap, munmap, mremap and mprotect are removed with their
tests.

* fex: keep aio keys, cancels and reaped events native for copied control blocks

Guest aio_key is no longer cleared before dispatch: the slot is probed with a
same-value write and only the first n accepted copies get key 0 after the host
io_submit returns n. io_cancel redirects to a copy only when the guest block is
readable and its key is 0, so unreadable blocks fault in the kernel as before.
io_getevents and io_pgetevents reap into emulator storage, translate and
release copies there, then copy the events out, returning -EFAULT if that
fails. A successful io_setup clears the ring header magic so userspace ring
reapers fall back to io_getevents, where copies are translated and released.

* fex: leave aio rejections, keys and unwritable event buffers to the kernel

A copied control block whose key slot is read-only is now passed to the
kernel as the guest's own block at the end of the list, so the kernel reports
its native fd, eventfd or key error. After io_submit, guest keys follow the
private copies through the first rejected position, and they are stored
through a fresh translation of the guest address, skipped when it no longer
maps. io_getevents and io_pgetevents probe the guest event buffer and reap at
most its writable prefix, handing an unwritable buffer to the kernel so
completions are not consumed.

* Kept AIO completions and key stores stable against sibling remaps

Wrapped event buffers go to the kernel unchanged. Direct reaps report guest
control blocks and release copies only after the store lands. Guest stores and
reads hold the mapping lock across translation and copy. Completions whose
copy-out fails are stashed per context and delivered first on the next reap,
and dropped on io_destroy.

* fex: stage every AIO reap and keep stashed completions recoverable

Hold the guest mapping for every high address, restore the caller's
signal mask after thread-context holds, replace the fixed event stash
with a per-context table that reserves space before dispatch, stage
all reaps so control block identities are translated before copy-out,
keep collecting ready completions once the stash meets min_nr, and
restash events on every error except an interrupted delivery or a
destroyed context.

* fex: own AIO recovery storage before dispatch and bind it to the context lifetime

Allocate the recovery node with the event buffer before the kernel
consumes completions and hand the buffer itself to the stash when
copy-out fails, so settling never allocates. Track each context by a
generation that io_setup advances, so a destroy that finishes after a
replacement context reuses the ring address only releases the old
context's copies and stash. Drop the reservation cap so blocking reaps
keep their min_nr.

* fex: publish AIO contexts from private storage, keep their generation, wake blocked reapers for stashed completions

* fex: wait for AIO events in bounded slices instead of wake markers, roll back setup by its own generation, fault unreadable io_setup output

Blocked reapers wait in the kernel for at most 20 ms at a time and take stashed completions between waits until the guest minimum or timeout is met, so no eventfd or io_submit notification is needed. Deferred signals end the wait like EINTR. io_setup rollback uses the generation BeginContext installed, and an unreadable context output returns -EFAULT before dispatch.

---------

Co-authored-by: StonkGuy <68372320+StonkGuy@users.noreply.github.com>
Co-authored-by: StonkGuy <StonkGuy@users.noreply.github.com>
2026-12-05 02:26:42 -05:00
MaxsTechReview 56213d74b3 fix(ubuntu): drop the Mesa patches Ubuntu's Mesa 26.2 now ships and rebase the rest (#3736) 2026-12-05 01:59:21 -05:00
The412Bannerandmaxjivi05 9c6fafec4c fix(hook): end readlink answers so Steam's install scripts run without proot (#3386)
Co-authored-by: maxjivi05 <maxjividen@gmail.com>
2026-12-05 00:52:52 -05:00
LunaDL f06c37e279 Feat: Add per-game scaling filter (#3726) 2026-12-05 00:47:58 -05:00
Kurt Himebauch b072cedd16 Fix black bottom-screen Mirror with HDR enabled (#3710)
* Keep Mirror frames readable with HDR enabled

* Exercise mirror capture messages in the native host queue test

* Preserve the HDR display fallback while Mirror is open
2026-12-04 14:01:37 -05:00
Kurt Himebauch 77fffa7592 Show recent photos in place of the keyboard when attaching to the agent (#3702)
* Show recent photos in place of the keyboard in the agent composer

The attach button opens a tray, at the keyboard's height, of the device's
recent pictures; a tap attaches or detaches one. The tray also opens the
system file picker and asks for photo access when the app has none.

* Agent instructions: manifest needs an APK; the agent resumes after a Lab build restart

* Skip the tray's back handler where the host has no back dispatcher

* Offer the photo tray in windows that cannot open pickers, such as the floating pet

* Fix the tray's permission request for windows without a registry

* Move the game screenshot button into the photo tray

* Name only the model in the agent's compact chip

* Keep the session drawer open while the tray's picker or photo permission prompt is up

* Address review: tray height on short screens, denied photo access, kept photo marks, tile labels, Lab build refusals

* Keep tray photos being copied across the tray closing

* Let a tray photo copy clear only its own in-progress marker

* Review: one attachment file per copy, photo tile labels, superseded copies attach nothing

* Drop tray photo copies still running when the message is sent
2026-12-04 13:42:17 -05:00
Kurt Himebauch de3ed8b986 Keep the followed channel's offer off the Tests list while browsing it (#3707)
* Show the followed channel's update offer above the test list only when following a test

* Keep install progress and errors on the Tests list while following Stable or Preview
2026-12-04 13:25:24 -05:00
JRAlmonte 86b8ae3c99 fix(nativeguest): do not apply a realtime limit of zero (#3704)
Flatpak emulators that use SDL (Flycast, Rosalie's Mupen GUI, xemu) were
killed with status 137 a second or two after a game started. Without a
RealtimeKit, xdg-desktop-portal reports RTTimeUSecMax 0, and SDL sets that
as RLIMIT_RTTIME before asking for a realtime thread. The kernel checks the
limit on a thread that is realtime or has a CPU-time timer armed, and a
limit of 0 is reached at once: SIGKILL at the hard limit.

Fixes #3672
2026-12-04 13:02:07 -05:00
Kurt Himebauch fe6f8638c6 Lay wide session drawer pages out in two columns (#3694)
Keep drawer content composed when changing width, and keep component notes within their groups so columns stay balanced.
2026-12-04 12:15:50 -05:00