Skip to content

Gamescope payload 20261101.3: Xwayland attaches a game's shared-memory segment through the sysvshm server - #2312

Closed
utkarshdalal wants to merge 1 commit into
masterfrom
gamescope-payload-20261101-2
Closed

utkarshdalal wants to merge 1 commit into
masterfrom
gamescope-payload-20261101-2

Conversation

@utkarshdalal

@utkarshdalal utkarshdalal commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Description

GL games on the xlib software winsys (SteamWorld Dig 2 is the reporter case) tore horizontally under gamescope: Xwayland refused the game's MIT-SHM segment with BadAccess, Xlib fell back to XPutImage in 15 row bands of 1280x51 per frame, and Xwayland committed between bands. Cause: Xwayland preloads the container's libandroid-sysvshm.so, whose shmat() only knows ids the calling process created. Fix (GameNative/xserver#2, on top of GameNative/xserver#1): when the SysV attach fails, Xwayland asks the app's sysvshm server for the segment's fd and attaches it like an fd-passed segment; and Xwayland finishes glamor's GPU work before each present since the stack has no implicit sync. Frames now arrive as one XShmPutImage. No change to the container, its shm library, the game process, gamescope, or the daemon.

This PR is only the payload version bump. Payload gamescope-gamenative-20261101.3.tzst = shipped 20261031.3 + bin/Xwayland (xserver bd9c2cdd4, gamescope CI 41314597152, sha 4dded856); every other member is byte-identical to 20261031.3. Size 14290138 B, sha256 4c5ac792fc9fef9a3e5b3e65343836d5fdfb02ca724eaab7fbe868d30a70d551, uploaded and verified on the CDN.

Measured on a Retroid Pocket 6 (SWD2, same scripted map-toggle scene, 30 s screenrecord, tear detector, pristine container, shipped gamescope 20261031.3 and the master daemon on both sides; only bin/Xwayland differs):

Xwayland frames tears fps
shipped (20261031.3) 1812 20 59.93
this payload's 1812 0 60.03

Second fix run on the same stack: 0 tears / 1810 frames, 59.99 fps. Log on the fix side: (II) gn: ShmAttach: SysV id 6 (3686400 bytes) attached via the sysvshm server; Xwayland maps the segment (/dev/ashmem/sysvshm-6).

Also measured with gamescope#26 (A52 disabled) and this Xwayland: 0 tears, but the 60 cap is not held (63.9 fps, frame intervals 8/17/25 ms mixed) — the tear fix does not depend on A52; the cap does.

Recording

Control and fix recordings: ~/workspace/gn-testlogs/swd2-tearing-20261101/xwl_shmem/{control3,fix5}/rec30.mp4.

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by CodeRabbit

  • Updates
    • Updated the Gamescope version information.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 218b7eae-e9a8-48be-ab3e-ad69b2f8bad3
Commits

Reviewing files that changed from the base of the PR and between effc01d and d358883.

Files selected for processing: 1
  • app/src/main/java/app/gamenative/display/GamescopePayload.kt

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

GamescopePayload.VERSION changes from 20261031.3 to 20261101.3.

Changes: Gamescope payload version

Layer / File(s) Summary
Update payload version
app/src/main/java/app/gamenative/display/GamescopePayload.kt
GamescopePayload.VERSION changes to 20261101.3.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: joshuatam

Merge Risk: Minimal · up to d3588

The selected payload revision is intentional and available from both hosts. No actionable merge risk is established.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the Gamescope payload version and the primary Xwayland shared-memory change.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template and is substantive. It explains the tearing bug under gamescope, the cause (Xwayland's shmat() only knows segment ids the calling process created), the …
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Full details: Description check

Explanation

The description follows the repository template and is substantive. It explains the tearing bug under gamescope, the cause (Xwayland's shmat() only knows segment ids the calling process created), the fix (fd request from the sysvshm server plus glamor finish before present), and the payload contents and checksum. It includes before/after measurements in a table. The Type of Change selection is correct (Bug fix). Two checklist items are not checked: 'I have attached a recording of the change' is unchecked, although the Recording section gives a local file path. That path is not an attachment, and a local path on the author's machine is not accessible to reviewers. The Recording section also needs an attached GIF or video. The 'discussed in #code-changes' item is checked, but the description does not say whether that discussion happened. The description is otherwise complete, so the check passes with minor gaps.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…y segment through the sysvshm server

Under gamescope, GL games on the xlib software winsys tore horizontally:
Xwayland refused the game's MIT-SHM segment, Xlib fell back to XPutImage
in 15 row bands per frame, and Xwayland committed between bands.
Xwayland now fetches the segment's fd from the app's sysvshm server and
attaches it (GameNative/xserver#2, on top of #1). Payload = 20261031.3 +
bin/Xwayland; nothing else in the payload changes.
@utkarshdalal
utkarshdalal force-pushed the gamescope-payload-20261101-2 branch from effc01d to d358883 Compare November 1, 2026 14:33
@utkarshdalal utkarshdalal changed the title Gamescope payload 20261101.2: Xwayland attaches a game's shared-memory segment through the sysvshm server Gamescope payload 20261101.3: Xwayland attaches a game's shared-memory segment through the sysvshm server Nov 1, 2026
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