Skip to content

Proton support: shared-handle transport for the frame bridge helper - #3

Draft
eayankov wants to merge 3 commits into
JSa25:mainfrom
eayankov:proton-fixes
Draft

eayankov wants to merge 3 commits into
JSa25:mainfrom
eayankov:proton-fixes

Conversation

@eayankov

@eayankov eayankov commented Nov 8, 2026 •

Copy link
Copy Markdown

PR: AttilaCPUPerfFix — Proton support for the Upscaling and Framegen add-on

Branch: proton-fixes → main · Commits: 2 (0b94285, 6f994f1) · Base: e0f9b9c (6.10.6)

What this does

Upscaling repo PR.

Lets the game-side DLL and the separate helper64.exe exchange GPU frames on
Proton (Linux/Wine), where the add-on previously could not run:

  • 0b94285 Publish frame bridge shared handles for helper duplication.
    The bridge publishes its shared color/depth/motion resources as named
    handles plus a fixed-width sidecar file (fgb_handles.h) so a 64-bit
    helper in another process can duplicate and import them. The existing
    named-open transport for older peers is kept; a missing sidecar selects it,
    an invalid one fails explicitly.
  • 6f994f1 Clean up failed frame bridge initialization. If helper
    startup fails, acquired resources are released after the helper's exit is
    confirmed, and the job-object handle is retained until exit and closed
    after — a later valid launch can initialize cleanly.

Verification status (honest state)

  • Verified on Proton 11.0-2e, RX 7900 XTX / RADV: stable 4K campaign and
    battle sessions with active Quality FSR (thousands of SR round trips, no
    timeouts, no present failures); menu upscaling works; duplicated-handle
    transport exercised through a standalone cross-process GPU probe (both
    formats, contents verified, bidirectional fences).
  • Frame generation observed working (gamescope, FG 2x) — shipped beta.
  • Not yet runtime-verified: repeated settings-triggered helper restarts and
    invalid-sidecar/failure paths (the cleanup commit's behavior is
    source-reviewed and mock-tested only).
  • Display/swapchain changes: the bridge currently shuts down cleanly and the
    game falls back to native rendering; live recovery is deliberately out of
    scope for this change.
  • Game crashes during battle/campaign loading under Proton
    (Empire.Retail.dll+0x1617248, read 0xD) reproduce with no mods at all
    and are a game/Proton-level fault, not introduced by this change; a Proton
    issue report is being filed separately. Full per-object motion raises that
    fault's incidence, so camera-only stays the recommended default on Proton.

🤖 Generated with Claude Code

eayankov and others added 3 commits November 4, 2026 20:23
… switch window on failed restarts

A failed start retains its resources while the helper may still be
importing them; if that helper hangs past the confirm wait, nothing
retried the cleanup and the g_dev || g_helper guard blocked every later
fgb_start for the session. The start guard now polls the helper with a
zero timeout and finishes cleanup_failed_start once it has exited.
Also destroy the freshly made switch child window when the restart fails
after it was created (no helper owns it; leaving it occludes the game's
fallback picture).

Co-Authored-By: Claude Code <noreply@anthropic.com>
@eayankov

eayankov commented Nov 8, 2026

Copy link
Copy Markdown
Author

Code review of this branch found three lifecycle issues on rare failure paths; two are fixed in 73d5b08, one documented:

  • Fixed: a failed start retains its resources while the (terminated but unconfirmed) helper may still be importing them; if that helper hung past the confirm wait, nothing retried the cleanup and the g_dev || g_helper guard blocked every later fgb_start for the session. The guard now polls the helper with a zero timeout and finishes cleanup_failed_start() once it has exited.
  • Fixed: a failed fgb_restart after the new child window was created (fences/publish/launch failure) left a blank click-through child window occluding the game's fallback picture; the window is now destroyed on those paths (no helper owns it at that point).
  • Known, not changed: wait_helper_stopped() can close g_helper while the watchdog thread (250 ms wait loop) or a render-hook fgb_active() poll is waiting on the same handle — undefined per Win32 if the close lands inside their wait. This predates the branch (fgb_stop/fgb_restart already closed the handle mid-session) and its consequences are self-limiting (object-typed APIs reject a recycled handle value), so it is recorded rather than hot-fixed; a proper fix wants the watchdog joined or its own duplicated handle, which deserves its own tested change.

@eayankov

eayankov commented Nov 8, 2026

Copy link
Copy Markdown
Author

Build evidence for 73d5b08 with the pinned llvm-mingw 20261006-ucrt-ubuntu-22.04-x86_64 (tarball SHA-256 5f9c6ed9…, as recorded):

  • 73d5b08 builds clean (only the branch's known warnings): dinput8.dll SHA-256 732476ad2ac89bf4ff7cf7342e35af792b9e2edce9f2318596e10be4661d4293
  • reproducibility check: unmodified 6f994f1 rebuilds byte-identical to the previously recorded hash ce82fd1cb7d2eafbb8fab18b1c72ae4100b1fd998f2910f705dbaa0410d1d93e, so the toolchain and fixed-timestamp link reproduce exactly.

Not installed anywhere — this build exists to prove the fix compiles; your Windows CI remains the release path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant