Compare commits

...
5 Commits
17 changed files with 525 additions and 38 deletions

No files matched your search

+6 -6
View File
@@ -76,17 +76,17 @@ What was really run: see [Status](#status) (a real install into a scratch prefix
| Launcher window (`summit-gui`): Home, Library (grid and list), Unfiltered, a page per game, Settings | **Working** | Run fullscreen on the KDE X11 desktop; every screenshot above is that window. Software OpenGL there: **not checked on a GPU-rendered desktop or a TV**. |
| Keyboard navigation (arrows, Enter, Esc, Tab between sections) | **Working** | Driven with synthetic X key events on the desktop: Tab walked Home, Library, Unfiltered, Settings; arrows moved focus; Enter opened a game's page, toggled Enhance and pressed Play. `/`, `P` and `F11` were not pressed in this run (they were in the earlier headless and Xvfb checks). |
| Layouts (Big picture, Grid, List) and six themes | **Working** | All three layouts and five of the six themes captured live from a saved `ui.toml`; Midnight is the default one. |
| Play from the launcher with Enhance | **Working** (X11 and KDE Wayland) | Voidrunner: Enhance toggled on with the keyboard, Play pressed: the launcher ran `summit run custom:voidrunner --enhance`, the game and the engine started. Both stopped when the game was killed, and the screen mode was unchanged afterwards. On KDE Wayland: Play on Voidrunner's page did the same (the launcher used to refuse Enhance there). If the engine can't capture (no window found, the share dialog cancelled), the game now goes on without it. |
| Live enhance (`--enhance`): RIFE frame generation + FSR upscaling on a running game's window | **Working on X11 and KDE Wayland** | **KDE Plasma 6.8 Wayland, RTX 5080**: Voidrunner (an XWayland game) read through XWayland, the picture over it on a chosen monitor at 60 fps, FSR draw 0.06 ms, 21 to 38 ms from a frame reaching the engine to the screen; the game kept the keyboard, also in its own fullscreen mode. Native Wayland windows through the ScreenCast portal and PipeWire: run with a test window only (the share dialog once, then restored for new windows with no dialog; about 50 frames a second, CPU copy). Other Wayland desktops untested. **X11**: The engine's picture covered the 1080p screen with the 1280x720 game window under it, the game kept the keyboard. **Slow on that machine**: output 32 to 40 fps while the game drew 52 to 58, because software OpenGL takes about 15 ms to draw a 1080p frame; delay 65 to 97 ms. Not measured on a GPU-driven display. |
| Play from the launcher with Enhance | **Working** (X11 and KDE Wayland) | Voidrunner: Enhance toggled on with the keyboard, Play pressed: the launcher ran `summit run custom:voidrunner --enhance`, the game and the engine started. Both stopped when the game was killed, and the screen mode was unchanged afterwards. On KDE Wayland: Play on Voidrunner's page did the same (the launcher used to refuse Enhance there). If the engine can't capture (no window found, the share dialog cancelled), the game now goes on without it. **Independent re-run from a fresh install** ([docs/WAYLAND_VERIFY.md](docs/WAYLAND_VERIFY.md), KDE Wayland, 3 runs): launcher (a native Wayland window) -> Library -> `/` search -> Voidrunner -> Play with Enhance on: picture, stats line and watermark over the game, keys reached the game, the game's own Quit ended it with exit status 0, the engine stopped, the monitor mode went back (49 -> 51 -> 49). That run found the XWayland/native mix-up and the replay default described in the report. |
| Live enhance (`--enhance`): RIFE frame generation + FSR upscaling on a running game's window | **Working on X11 and KDE Wayland** | **KDE Plasma 6.8 Wayland, RTX 5080**: Voidrunner (an XWayland game) read through XWayland, the picture over it on a chosen monitor at 60 fps, FSR draw 0.06 ms, 21 to 38 ms from a frame reaching the engine to the screen; the game kept the keyboard, also in its own fullscreen mode (re-run from an installed copy: 21 to 27 ms on the stats line, 60 to 61 fps out while the game ran at 54 to 60). Native Wayland windows through the ScreenCast portal and PipeWire: run with a test window only (the share dialog once, then restored for new windows with no dialog; about 50 frames a second, CPU copy). Other Wayland desktops untested. **X11**: The engine's picture covered the 1080p screen with the 1280x720 game window under it, the game kept the keyboard. **Slow on that machine**: output 32 to 40 fps while the game drew 52 to 58, because software OpenGL takes about 15 ms to draw a 1080p frame; delay 65 to 97 ms. Not measured on a GPU-driven display. |
| In-game overlay with the Summit watermark | **Working** | Stats line (top left) and `summit - git.molberg.cloud/alex/summit` (bottom left) are on screen in the engine's window. `--no-watermark` turns the watermark off (earlier check). Not drawn into saved clips. |
| Instant replay clips: global save key (Ctrl+Alt+R), clip lengths from Settings | **Working on X11 and KDE Wayland** | **KDE Wayland**: Ctrl+Alt+R through the GlobalShortcuts portal saved clips while the game had the keys (needs the installed `summit.desktop`, which gives Summit an app id; without it, an X11 key grab through XWayland works while an XWayland game has the keys, also run). **X11**: Buffer 60 s, clip 30 s: Ctrl+Alt+R during play saved a 30.1 s H.264 1280x720 MP4 that ffprobe reads and ffmpeg decodes. **This run found a bug and fixed it**: the global key used to save the whole buffer (60 s) and ignore the configured clip length. |
| `install.sh` | **Working (one machine)** / dry-run elsewhere | Real run into a scratch prefix (`SUMMIT_PREFIX`) on an Ubuntu 24.04 machine, with the checkout supplied through `SUMMIT_SRC_DIR` instead of the clone: built, copied the two binaries and the engine, made the venv; `import torch` there gave 2.11.0+cu128. **This run found a bug and fixed it**: with an NVIDIA GPU the venv got PyPI's torch 2.15+cu132 (CUDA 13.2; the test machine's driver stops at 13.0) and the cu128 step did nothing; torch is now installed from the cu128 index first. Not run on the neon test machine itself, not as a non-root user, not into `/usr/local`, and the engine on the test machine ran from its existing venv. Other distros: `--dry-run` only. |
| Instant replay clips: global save key (Ctrl+Alt+R), clip lengths from Settings | **Working on X11 and KDE Wayland** | **KDE Wayland**: Ctrl+Alt+R through the GlobalShortcuts portal saved clips, **also while a native Wayland window (the launcher) had the keyboard instead of the game** (independent re-run, [docs/WAYLAND_VERIFY.md](docs/WAYLAND_VERIFY.md)). The portal accepted Summit in that run with no `summit.desktop` in any applications folder the portal reads; the earlier run on the same desktop was refused without one ("An app id is required"), so install it (`install.sh` does, under its prefix) and treat the no-file case as luck, not a guarantee. Without the portal, an X11 key grab through XWayland works while an XWayland game has the keys (run once, earlier). **X11**: Buffer 60 s, clip 30 s: Ctrl+Alt+R during play saved a 30.1 s H.264 1280x720 MP4 that ffprobe reads and ffmpeg decodes. **This run found a bug and fixed it**: the global key used to save the whole buffer (60 s) and ignore the configured clip length. |
| `install.sh` | **Working (one machine)** / dry-run elsewhere | Real run into a scratch prefix (`SUMMIT_PREFIX`) on an Ubuntu 24.04 machine, with the checkout supplied through `SUMMIT_SRC_DIR` instead of the clone: built, copied the two binaries and the engine, made the venv; `import torch` there gave 2.11.0+cu128. **This run found a bug and fixed it**: with an NVIDIA GPU the venv got PyPI's torch 2.15+cu132 (CUDA 13.2; the test machine's driver stops at 13.0) and the cu128 step did nothing; torch is now installed from the cu128 index first. **Second real run** (independent verifier, 2026-11-24): as a non-root user on the KDE Wayland desktop (Arch, RTX 5080), into a scratch prefix, with `--no-deps` (no sudo allowed there; every package the script would install was already present): built, installed both binaries and the engine, made the venv (`torch 2.11.0+cu128`, CUDA on the 5080), downloaded the RIFE model, and `summit doctor` / Play with Enhance then ran from the installed copy. That run found **four bugs, now fixed with tests**: sudo was used even for a prefix in the user's home; the binaries were looked for in `<src>/target` and not where cargo put them (`CARGO_TARGET_DIR`); the dry-run showed the venv in the wrong place; running the installer again (an update) died in `uv venv`. The `pacman`/`sudo` step itself was **not** run, nor `/usr/local`, nor the release-package path. Other distros: `--dry-run` only. |
| Steam scan (all library folders, installed or not), Steam playtime, "most played" | **Tested** | Sample libraries, including the demo one above. Not run against a real Steam install in this run. |
| Heroic (Epic, GOG) and Lutris detection | **Tested** | Sample files only. |
| A reason for every detected entry (Unfiltered); heuristic detection; Windows `.exe` outside a Wine prefix listed as Software | **Tested** | The Unfiltered screenshot shows the reasons for the demo library's Steam entries on the real window. Heuristic and `.exe` detection: unit tests and sample folders, not a real disk full of games. |
| Hours played: Steam's own for Steam games, Summit-tracked sessions for everything else | **Tested** | Unit tests and the demo library; Summit's own tracker ran with Voidrunner earlier. `state.json` is now changed under a file lock, so the launcher and `summit run` saving at once both keep their change (checked: 2 x 40 parallel `summit pin`). |
| Add a game from the launcher (Library > **+ Add a game**, or **ADD** on a folder found on disk) | **Tested** | New since the RC run: the desktop's file dialog picks the file that starts the game, a second dialog asks for its name (guessed from the folder, skipping `bin`, `x86_64` and the like), the library reloads and the game's page opens. Checked on Xvfb with a stand-in zenity, both ways in; not on a real desktop or with kdialog. |
| `summit doctor` readiness list | **Working** (KDE Wayland) / **Tested** | Says whether the engine, its venv, torch with CUDA, the model, `ffmpeg`, `xrandr`, `xdg-open` and a file dialog are there, and what each missing one turns off. On Wayland also XWayland, the ScreenCast and GlobalShortcuts portals, `summit.desktop` for the app id, PipeWire and GStreamer's `pipewiresrc`, KWin, the monitor tool and the GPU. Run on the KDE Wayland desktop (all ok, torch 2.11+cu128 on the RTX 5080) and on the build machine; unit tests. |
| `summit doctor` readiness list | **Working** (KDE Wayland) / **Tested** | Says whether the engine, its venv, torch with CUDA, the model, `ffmpeg`, `xrandr`, `xdg-open` and a file dialog are there, and what each missing one turns off. On Wayland also XWayland, the ScreenCast and GlobalShortcuts portals, `summit.desktop` for the app id (the warning's wording is hedged after the re-run: the portal worked once without it), PipeWire and GStreamer's `pipewiresrc`, KWin, the monitor tool and the GPU. Run on the KDE Wayland desktop, twice (all ok, torch 2.11+cu128 on the RTX 5080; the second time from an installed copy) and on the build machine; unit tests. |
| Pin to Home, custom artwork | **Working** / **Tested** | Pins from the CLI and the launcher; `summit art`. **New since the RC run**: the launcher's **Change artwork** opens the desktop's file dialog (kdialog on KDE, zenity elsewhere) and the cover and backdrop change at once: checked on Xvfb with a stand-in zenity, not on a real desktop. |
| Display profile applied at launch (monitor, resolution, refresh) and put back | **Working on X11 and KDE Wayland** | KDE Wayland: `summit run` switched HDMI-A-1 from 1920x1080 @ 119.98 to @ 60 Hz and back, four times, with `kscreen-doctor` picking the mode by id (that monitor has two modes named `1920x1080@120`, so the old name-based plan could restore the wrong one). X11, earlier: from a custom mode to 1280x800 @ 74.99 Hz and back. wlroots: unit tests only. GNOME Wayland: skipped with a message. |
| Per-game profile editor (Profile on a game's page) | **Working** (earlier run) | Listed the monitor's real xrandr modes; every change is written to the profile. Not opened in this run. Focus is stored only (raising the game window is not built). |
@@ -166,7 +166,7 @@ summit enhance window:Voidrunner # or: enhance a game that is alr
`summit run <id> --enhance` starts the game, waits for its window (up to `--wait` seconds), starts the engine on it with the game's profile (monitor, fullscreen, upscaler, frame generation, model, `target_hz`), and stops both when either one exits. A window can also be named with `--window` (`class:NAME`, `pid:N`, `xid:N` or part of the title) for games whose window belongs to another process.
How it works on Wayland (run on KDE Plasma 6.8, see [docs/WAYLAND_REPORT.md](docs/WAYLAND_REPORT.md)): the engine looks for the game among XWayland windows and, on KDE, among KWin's own window list. An **XWayland** game (Proton, Wine and most older games) is read exactly as on X11, through XWayland, with no dialog. A **native Wayland** game goes through the desktop's ScreenCast portal: the desktop asks once which window to share, Summit keeps the permission (`~/.config/summit/screencast-token`) and later runs, also of a restarted game, start without asking. Its frames come over PipeWire through GStreamer (`gst-launch-1.0 pipewiresrc`, a CPU copy, about 18 % of one core at 1080p). In both cases the picture is an XWayland window that KWin keeps above the game, fullscreen games included, and that never takes the keyboard. `summit doctor` lists what is missing. Gamescope was tried (it runs and upscales with its own FSR on that desktop) but is not used: it has no frame generation.
How it works on Wayland (run on KDE Plasma 6.8, see [docs/WAYLAND_REPORT.md](docs/WAYLAND_REPORT.md)): the engine looks for the game among XWayland windows and, on KDE, among KWin's own window list (which cannot say which windows are XWayland ones, so the engine asks the X server for the pids it has: an XWayland game that KWin lists before the engine's size/title filter lets it through used to be mistaken for a native one, got the share dialog and the slower PipeWire copy; fixed in the verify run). An **XWayland** game (Proton, Wine and most older games) is read exactly as on X11, through XWayland, with no dialog. A **native Wayland** game goes through the desktop's ScreenCast portal: the desktop asks once which window to share, Summit keeps the permission (`~/.config/summit/screencast-token`) and later runs, also of a restarted game, start without asking. Its frames come over PipeWire through GStreamer (`gst-launch-1.0 pipewiresrc`, a CPU copy, about 18 % of one core at 1080p). In both cases the picture is an XWayland window that KWin keeps above the game, fullscreen games included, and that never takes the keyboard. `summit doctor` lists what is missing. Gamescope was tried (it runs and upscales with its own FSR on that desktop) but is not used: it has no frame generation.
| | |
|---|---|
+9 -11
View File
@@ -177,18 +177,17 @@ fn main() -> Result<()> {
if let Some(o) = &out { state::path_text(o)?; }
let p = profile::load(&profile)?;
let mut args = engine::plan(&eng, &src, &p, out.is_none(), out.as_deref(), max_ticks);
// Instant replay only exists while playing on screen. Lengths come from the launcher's settings page;
// without a ui.toml the engine keeps whatever it has stored itself.
if out.is_none() && summit_core::ui::path().is_ok_and(|p| p.exists()) {
let ui = summit_core::ui::load();
args.extend(engine::clip_args(ui.replay_seconds, ui.clip_seconds));
// Instant replay only exists while playing on screen. Lengths come from the launcher's settings page
// (its defaults until the user changes them).
if out.is_none() {
args.extend(engine::ui_clip_args(&summit_core::ui::load()));
}
if out.is_none() && no_watermark { args.extend(["--watermark".to_string(), "off".to_string()]); }
args.extend(engine::extra_args(std::env::var("SUMMIT_ENGINE_ARGS").ok().as_deref()));
let py = engine::python(&eng);
println!("{} {}", py.display(), args.join(" "));
if !dry_run {
let st = std::process::Command::new(&py).args(&args).env("SMOOVPLAY_TITLE", "Summit").status()?;
let st = std::process::Command::new(&py).args(&args).env("SMOOVPLAY_TITLE", "Summit").env("PYTHONUNBUFFERED", "1").status()?;
anyhow::ensure!(st.success(), "engine exited with {st}");
}
}
@@ -259,15 +258,14 @@ fn main() -> Result<()> {
let mut game = child.spawn().map_err(|e| anyhow::anyhow!("could not start {}: {e}", cmd[0]))?;
let live = engine::Live { wait_secs: wait, watermark: if no_watermark { Some(false) } else { None } };
let mut args = engine::run_enhance_plan(&eng, game.id(), window.as_deref(), &p, &live);
if summit_core::ui::path().is_ok_and(|p| p.exists()) {
let ui = summit_core::ui::load();
args.extend(engine::clip_args(ui.replay_seconds, ui.clip_seconds));
}
args.extend(engine::ui_clip_args(&summit_core::ui::load()));
args.extend(engine::extra_args(std::env::var("SUMMIT_ENGINE_ARGS").ok().as_deref()));
let py = engine::python(&eng);
out!("{} {}", py.display(), args.join(" "));
let grace = std::time::Duration::from_secs(8);
let mut eng_proc = match std::process::Command::new(&py).args(&args).env("SMOOVPLAY_TITLE", "Summit").env("SUMMIT_GAME", &title).spawn() {
// PYTHONUNBUFFERED: the engine's lines reach last-run.log (the launcher's "what went wrong" text) as they
// happen, not in one block when it ends (a live run's log was empty of them for minutes).
let mut eng_proc = match std::process::Command::new(&py).args(&args).env("SMOOVPLAY_TITLE", "Summit").env("PYTHONUNBUFFERED", "1").env("SUMMIT_GAME", &title).spawn() {
Ok(c) => c,
Err(e) => { let _ = engine::stop(&mut game, grace); anyhow::bail!("could not start the engine ({}): {e}", py.display()); }
};
+95
View File
@@ -0,0 +1,95 @@
//! `install.sh --dry-run` as a new user would run it: a prefix in their own home must need no sudo, `--no-deps`
//! must not touch the system package manager, and the dry run must show the venv where the real run makes it.
use std::path::PathBuf;
use std::process::Command;
fn script() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../install.sh")
}
fn dry_run(prefix: &std::path::Path, extra: &[&str]) -> String {
let out = Command::new("sh")
.arg(script())
.arg("--dry-run")
.args(extra)
.env("SUMMIT_PREFIX", prefix)
.env("SUMMIT_SRC_DIR", PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../.."))
.output()
.expect("run install.sh");
assert!(out.status.success(), "install.sh failed: {}", String::from_utf8_lossy(&out.stderr));
String::from_utf8_lossy(&out.stdout).into_owned()
}
#[test]
fn user_prefix_needs_no_sudo() {
let dir = std::env::temp_dir().join(format!("summit-install-test-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
let prefix = dir.join("prefix");
let out = dry_run(&prefix, &["--no-deps"]);
let _ = std::fs::remove_dir_all(&dir);
assert!(!out.contains("sudo"), "a prefix the user can write needs no sudo:\n{out}");
assert!(out.contains("install -Dm755"), "{out}");
}
#[test]
fn no_deps_skips_the_package_manager() {
let dir = std::env::temp_dir().join(format!("summit-install-test-nd-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
let out = dry_run(&dir.join("p"), &["--no-deps"]);
let with = dry_run(&dir.join("p"), &[]);
let _ = std::fs::remove_dir_all(&dir);
for pm in ["pacman", "apt-get", "dnf", "zypper"] {
assert!(!out.contains(pm), "--no-deps must not call {pm}:\n{out}");
}
assert!(out.contains("--no-deps"), "{out}");
// Without it the installer still installs the system packages (on a known distro).
assert!(with.contains("Installing build and runtime dependencies") || with.contains("skipping package manager"), "{with}");
}
#[test]
fn dry_run_shows_the_venv_in_the_install_prefix() {
let dir = std::env::temp_dir().join(format!("summit-install-test-venv-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
let prefix = dir.join("p");
let out = dry_run(&prefix, &["--no-deps"]);
let _ = std::fs::remove_dir_all(&dir);
let want = format!("uv venv --python 3.12 {}/share/summit/engine/.venv", prefix.display());
assert!(out.contains(&want), "expected `{want}` in:\n{out}");
}
#[test]
fn installs_the_binaries_from_where_cargo_puts_them() {
// A user with CARGO_TARGET_DIR set has no $SRC/target: the first real run on the owner's desktop died on
// `install: cannot stat .../src/target/release/summit`.
let dir = std::env::temp_dir().join(format!("summit-install-test-tgt-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
let out = Command::new("sh")
.arg(script())
.args(["--dry-run", "--no-deps"])
.env("SUMMIT_PREFIX", dir.join("p"))
.env("SUMMIT_SRC_DIR", PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../.."))
.env("CARGO_TARGET_DIR", "/somewhere/else/target")
.output()
.unwrap();
let _ = std::fs::remove_dir_all(&dir);
let out = String::from_utf8_lossy(&out.stdout);
assert!(out.contains("install -Dm755 /somewhere/else/target/release/summit "), "{out}");
}
#[test]
fn running_the_installer_again_keeps_the_venv() {
// `uv venv` fails on an existing venv ("A virtual environment already exists"): the second run, to update, died there.
let dir = std::env::temp_dir().join(format!("summit-install-test-again-{}", std::process::id()));
let prefix = dir.join("p");
let py = prefix.join("share/summit/engine/.venv/bin/python");
std::fs::create_dir_all(py.parent().unwrap()).unwrap();
std::fs::write(&py, "#!/bin/sh\n").unwrap();
use std::os::unix::fs::PermissionsExt;
std::fs::set_permissions(&py, std::fs::Permissions::from_mode(0o755)).unwrap();
let out = dry_run(&prefix, &["--no-deps"]);
let _ = std::fs::remove_dir_all(&dir);
assert!(!out.contains("uv venv"), "{out}");
assert!(out.contains("the venv exists"), "{out}");
assert!(out.contains("uv pip install"), "{out}");
}
+1 -1
View File
@@ -192,7 +192,7 @@ pub fn wayland_checks(p: &WaylandProbe) -> Vec<Check> {
let shortcuts = text.contains("org.freedesktop.portal.GlobalShortcuts");
v.push(match (shortcuts, p.desktop_file) {
(true, true) => Check::new("save key", Status::Ok, "Ctrl+Alt+R from any window, through the GlobalShortcuts portal"),
(true, false) => Check::new("save key", Status::Warn, "summit.desktop isn't installed, so the GlobalShortcuts portal won't give Summit an app id: Ctrl+Alt+R works only while an XWayland game has the keyboard (install.sh installs it)"),
(true, false) => Check::new("save key", Status::Warn, "summit.desktop isn't in an applications folder the portal reads (install.sh installs it under its prefix; a prefix outside XDG_DATA_DIRS isn't read). Plasma 6.8 refused Summit's shortcut without it on one run and accepted it on a later one: if Ctrl+Alt+R does nothing outside the game, copy it to ~/.local/share/applications; the fallback works while an XWayland game has the keyboard"),
(false, _) => Check::new("save key", Status::Warn, "no GlobalShortcuts portal: Ctrl+Alt+R works only while an XWayland game has the keyboard; R in the engine window is not reachable while the game has it"),
});
}
+8
View File
@@ -258,6 +258,11 @@ pub fn clips_dir() -> Option<PathBuf> {
Some(dirs::video_dir().or_else(|| dirs::home_dir().map(|h| h.join("Videos")))?.join("Summit"))
}
/// Instant replay flags from the launcher's settings (`ui::load()`: the defaults the Settings page shows when
/// there is no ui.toml yet). Not passing them then left a new user with a Settings page saying "Keep the last 1 min"
/// and an engine with replay off, so Ctrl+Alt+R saved nothing (seen on the first real install, 2026-11-24).
pub fn ui_clip_args(ui: &crate::ui::UiSettings) -> Vec<String> { clip_args(ui.replay_seconds, ui.clip_seconds) }
/// Instant replay flags for the engine, from the launcher's clip settings.
/// The engine only accepts 15, 30, 60, 180, 300 or 600 seconds, and a save is never longer than the buffer.
pub fn clip_args(replay_seconds: u32, clip_seconds: u32) -> Vec<String> {
@@ -284,6 +289,9 @@ mod tests {
}
#[test] fn clip_args_follow_the_engine_choices() {
assert_eq!(clip_args(60, 30).join(" "), "--replay 60 --clip-length 30");
// A new user has no ui.toml: the settings page shows 1 min / 30 s, and that is what the engine gets.
let none = std::env::temp_dir().join("summit-no-such-ui-toml-for-test/summit/ui.toml");
assert_eq!(ui_clip_args(&crate::ui::load_from(&none)).join(" "), "--replay 60 --clip-length 30");
assert_eq!(clip_args(30, 300).join(" "), "--replay 30 --clip-length 30");
assert!(clip_args(45, 15).is_empty());
}
+21
View File
@@ -19,6 +19,27 @@ program** (its GLFW is built without the Wayland backend: `X11: The DISPLAY envi
it crashes), so the Voidrunner runs are **XWayland** runs. The native Wayland capture path (portal + PipeWire) was
run with a stand-in test window (`engine/devtools/wayland_standin.py`), not with a real game.
## Corrections after the independent re-run (see [WAYLAND_VERIFY.md](WAYLAND_VERIFY.md), 2026-11-24)
A second agent installed Summit fresh as a non-root user on the same desktop and ran it from the launcher. It found
that parts of this report were too sure. Read these before the sections below:
- **XWayland or native (items 1, 2, 5, 6, 11 and the table above).** KWin 6.8's script API has no `windowId`, so the
"is this an XWayland window" flag in `framegen/kwin.py` was **always false**. The engine only took the XWayland path
when its own X-window filter (title, minimum size) already had the game on its first look; otherwise it took the game
for a native Wayland window and opened the share dialog. That happened with Voidrunner from the launcher. Fixed: a
KWin window is native only if no X client has its pid. The XWayland runs in this report were real XWayland runs (the
re-run saw the same), but the path was not as reliable as stated.
- **Item 9 (the global key needs `summit.desktop`).** In the re-run the portal accepted Summit and Ctrl+Alt+R worked
(also with the native launcher window focused, so it is really global) with no `summit.desktop` in any applications
folder. The refusal seen here once is real, but the file is not a sure requirement; doctor's wording was softened.
Install it anyway.
- **Item 15 (`install.sh`).** Run for real now (non-root, scratch prefix, `--no-deps`): four bugs, fixed. Also this
report's claim that "install.sh installs" the desktop file only holds under the install prefix.
- **A new user's engine had instant replay off** (Settings said 1 min): Ctrl+Alt+R saved nothing until `ui.toml` existed.
Fixed in the re-run; the clips in items 5, 6, 10 were made with a `ui.toml` present.
- **"Not verified": the launcher's backend** is native Wayland (the X client list does not have it).
## How it works now
| Game's window | Capture | Picture on top | Clip key |
+196
View File
@@ -0,0 +1,196 @@
WAYLAND VERIFY: PASS
# Wayland verify: an independent re-run on the owner's desktop
Run on 2026-11-24 by a second agent that had not made the Wayland code, on the same desktop as
[WAYLAND_REPORT.md](WAYLAND_REPORT.md): Arch Linux, KDE Plasma 6.8 Wayland, RTX 5080 (driver 615.78.08), HDMI-A-1
1920x1080 as the test monitor (mode id 49 = 1920x1080 @ 119.98 at the start). Rules kept: only `~/summit-test`
(this run's fresh folder is `~/summit-test/verify`; Summit's config, data, cache and clips were pointed into it with
`XDG_*` and `SMOOVPLAY_REPLAY_DIR`), no sudo, only my own PIDs killed, never his apps or Steam (the launcher read
his Steam library, as it does).
**PASS means**: installed like a new user would (non-root, own prefix), started the launcher on Wayland, played
Voidrunner from the launcher with Enhance, and saw the overlay, the watermark, game input, a clip saved with
Ctrl+Alt+R, a clean exit and the monitor mode restored. **It took fixes to get there**: the first runs hit six bugs
(below). They are fixed and committed with tests, and what is claimed as working was seen after the fixes.
## What I did and saw
### 1. Install, as a new user
- `id -u` = 1000 (`zebratic`). Source copied to `~/summit-test/verify/src` (no `.git`, no `target`, no venv).
Environment: `SUMMIT_PREFIX=~/summit-test/verify/prefix`, `SUMMIT_SRC_DIR=~/summit-test/verify/src`, cargo's home and
target dir inside the fresh folder. What I **reused**: uv's download cache and managed Python from the earlier test
folder (so torch was not downloaded again) and the copy of Voidrunner.
- `sh install.sh --dry-run`: detected `arch`, `nvidia`, `wayland`; the pacman line has `gstreamer gst-plugins-base
gst-plugin-pipewire` (all already installed: `pacman -Q` checked). **Bug 1**: with a prefix in the user's own home it
still printed `sudo install -Dm755 ...`, `sudo mkdir`, `sudo cp`, `sudo chown` for every copy. **Bug 2**: the dry
run showed `uv venv` in `<src>/engine/.venv` while the real run makes it under the prefix.
- I may not use sudo there, so the real run is `sh install.sh --yes --no-deps` (the new flag skips the `pacman` steps; the
packages were all present). **The `sudo pacman` steps were never run.**
- Real run 1: the build finished (1 m 34 s) and then `install: cannot stat '.../src/target/release/summit'`.
**Bug 3**: the script assumed `<src>/target`; `CARGO_TARGET_DIR` (or `build.target-dir`) puts the binaries elsewhere.
It now asks `cargo metadata`.
- Real run 2: installed `prefix/bin/summit` (5.6 MB), `summit-gui` (32 MB), the engine, the app-menu entry and icon under
the prefix, made the venv with `torch 2.11.0+cu128` and the requirements, downloaded the RIFE model.
`prefix/share/summit/engine/.venv/bin/python -c "import torch; ..."` printed `2.11.0+cu128 True NVIDIA GeForce RTX 5080`.
- Run it again (an update): **Bug 4**: `error: Failed to create virtual environment ... already exists`. It now keeps an
existing venv and runs the `uv pip install` lines again. After the fix the third run exited 0.
- Tests for 1-4: `crates/summit-cli/tests/install_script.rs` (5 tests, run the script with `--dry-run`).
Not run: `install.sh --uninstall`, `/usr/local` (needs sudo), the release-package path, other distros.
### 2. `summit doctor` (from the installed copy, on Wayland)
```
session: Wayland
desktop: Kde
output DP-2: connected (2560x1600 @ 60 Hz, 13 modes)
output DP-1: connected (1920x1080 @ 239.76 Hz, 13 modes)
output HDMI-A-1: connected (1920x1080 @ 119.98 Hz, 9 modes)
What Summit needs:
[ok ] session Wayland: Enhance reads XWayland games directly and native Wayland ones through the ScreenCast portal ...
[ok ] engine /home/zebratic/summit-test/verify/prefix/share/summit/engine
[ok ] torch 2.11.0+cu128, CUDA on NVIDIA GeForce RTX 5080
[ok ] model .../prefix/share/summit/engine/models/flownet_v4.22.lite.pkl
[ok ] ffmpeg [ok ] xwayland [ok ] screencast
[warn] save key summit.desktop isn't installed, so the GlobalShortcuts portal won't give Summit an app id: ...
[ok ] pipewire [ok ] kwin [ok ] monitors [ok ] gpu NVIDIA GeForce RTX 5080, 615.78.08 [ok ] xdg-open [ok ] file dialog
all set
```
The `warn` is right that no `summit.desktop` is in a folder the portal reads (the installer put it under the scratch
prefix only). But the portal accepted Summit anyway in every run below, so the warning's text was too sure; I made it
say what was seen (see "Claims" below). "all set" with a warn on the list is how doctor reads; left as is.
### 3. The launcher, on Wayland
- `summit-gui` was started from the installed prefix. KWin's window list says it is **not** an XWayland window (the X
server's client list, `window_x11 --list`, had only the game): **the launcher is a native Wayland window**. (The earlier
report did not check.) It opened on **DP-1, the owner's main screen**, at 1608x929; I moved it to HDMI-A-1 with a KWin
script before any screenshot.
- Screenshots (all cropped to the launcher's own window or to HDMI-A-1; the home screen showed his Steam library, so
I looked at it but did not commit it):
![library, search "void"](media/wayland/verify-launcher-library-search.png)
`/` opened the search, `void` left one card, **Voidrunner**. Return, Return opened its page, which after the first run
reads *Played 3 min, Sessions 1, Last played Today* (the session was tracked):
![Voidrunner's page after a run](media/wayland/verify-launcher-detail-after-run.png)
- Keys reached the launcher (Tab to Library and Settings, `/`, text, Esc, Return); Settings said it saves to the
scratch `ui.toml`. Keys were sent with `xdotool` through KWin's input emulation, only while KWin said the target
window was active (I re-activated it first each time; the owner was using his desktop and took focus about every
other attempt: sends that missed were repeated, never sent to another window).
### 4. Voidrunner through Play, with Enhance (profile: HDMI-A-1, 1920x1080 @ 60, FSR, RIFE x2, 60 Hz out)
Set with `summit profile set custom:voidrunner ...`; the launcher's page shows it ("Enhance is on: RIFE x2, 60 Hz out + FSR").
**Run 1 (Return on Play).** The launcher ran `summit run custom:voidrunner --enhance --title=Voidrunner -- .../top_down_shooter`
(`ps` showed that line, the game, `run.py --source window --window=pid:... --scaler fsr --display --hz 60 --fullscreen
--monitor=HDMI-A-1`). Monitor mode 49 -> 51 (`display: ran kscreen-doctor output.HDMI-A-1.mode.51`).
- **Bug 5 seen here.** The log said `[window] a native Wayland window (...): captured through the ScreenCast portal` and
`shared after 3.8 s`, and `gst-launch-1.0 pipewiresrc` was running, but Voidrunner is an **XWayland** game (its own log:
`PLATFORM: DESKTOP (GLFW - X11)`; `xdotool search --pid` finds its X window; `libwayland` is not loaded). The
engine took it for a native window, so the share dialog opened (it was answered within 3.8 s; **not by me**) and the
picture was the portal's: with the window's title bar and frame inside it, fitted with black bars:
![XWayland game taken for a native one: title bar in the picture](media/wayland/verify-misdetected-native-with-titlebar.png)
Cause: KWin 6.8's script API has no `windowId` (it is `undefined` for every window, XWayland ones too: I read
all the properties of the game's window), so the engine's flag "this is an XWayland window" was always false and
*every* KWin window counted as native; the XWayland path only won when the engine's own X list (which skips untitled
or tiny windows) had the game on its first look. Fixed: a KWin window is native only if no X client has its pid.
Unit tests reproduce it (a 1x1 untitled XWayland window) and fail on the old code.
- Overlay, stats line (`60 fps game 60 delay 27 ms`) and watermark (`summit - git.molberg.cloud/alex/summit`, bottom-left)
were there. **Game input**: Down, Down moved the game's menu from PLAY to SETTINGS (seen); Return on CREDITS opened the
credits (seen); Esc went back; Down + Return on QUIT ended the game. All with the picture on top of the game.
- **Bug 6 seen here**: Ctrl+Alt+R saved nothing. The engine was started with no `--replay` (the launcher/CLI added the replay
flags only if `ui.toml` existed, and a new user has none), so the engine's own default, instant replay **off**, ran,
while the Settings page showed "Keep the last: 1 min". Fixed: `summit run`/`summit enhance` always pass the Settings
page's values (60 s / 30 s until changed); unit-tested.
- Exit: `custom:voidrunner exited (exit status: 0) after 191s; tracked`, `the game exited; the engine was stopped`,
`display: ran kscreen-doctor output.HDMI-A-1.mode.49`; no summit/run.py/game/gst process left; modes DP-2 1, DP-1 17,
HDMI-A-1 **49** (as at the start).
**Run 2 (launcher again, rebuilt from the fixed tree: Tab, `/`, `void`, Return, Return, Return).** Log (read after the run):
```
[window] an XWayland window: captured through XWayland
[window] Voidrunner -- top-down arena shooter (xid 0x2c00007, pid 83723): 1280x720 at 320,431, captured as 1280x720
[replay] on: keeping the last 60 s
[keys] global keys (portal): ctrl+alt+r, ctrl+alt+b
[replay] saved 16.1 s -> .../clips/Voidrunner 2026-11-24 18-24-17.mp4 (16 MB, 0.0 s)
[window] 2490 grabs, 15 unchanged (left out); capture restarted 0 time(s) for a resize
custom:voidrunner exited (exit status: 0) after 61s; tracked
```
No `gst-launch` process this time, no share dialog. Picture over HDMI-A-1 with the game in its fullscreen mode;
Down + Return on QUIT (selected, seen) ended the game, exit status 0, mode back to **49**:
![Enhance on XWayland from the launcher: stats line, watermark, QUIT selected with keys](media/wayland/verify-enhance-xwayland-fullscreen.png)
- The clip: `ffprobe`: h264, 1280x720, 964 frames, 16.09 s; `ffmpeg -i ... -f null -` decodes it (only the known
"non monotonically increasing dts" warnings); a frame at 5 s (the credits) was viewed and is right.
- A `Global Shortcuts Requested` window (class `org.freedesktop.impl.portal.desktop.kde`) was active for part of the first
seconds of this run (seen in KWin's window list). I did not answer it; it was gone about 20 s later and the key worked.
**Run 3 (`summit run custom:voidrunner --enhance` from a shell, to test the global part of the key).** XWayland path again,
no dialog, `[keys] global keys (portal)`. With the game running, I made the **launcher (a native Wayland window) the
active window** and sent Ctrl+Alt+R: `Voidrunner 2026-11-24 18-26-06.mp4` appeared (3.2 s, 190 frames, h264 1280x720,
decodes), `[replay] saved 3.2 s`. So the portal key is global: it fired with a window that is not an XWayland game
focused (an X key grab could not do that):
![Enhance via the CLI; the clip was saved while the launcher had the keyboard](media/wayland/verify-enhance-cli-global-key.png)
Ended by `kill` of the game's PID (checked it was the test copy): `exited (signal: 15 (SIGTERM))`, engine stopped, mode **49**.
**Run 4** (final build, same command): `[window] an XWayland window`, the engine's lines were in `last-run.log` while it
ran (a new `PYTHONUNBUFFERED`), killed by PID, nothing left, mode 49.
### 5. Tests
`cargo test --workspace`: all pass (1 + 5 install-script + 104 + 19). The engine's pytest on the desktop's installed venv:
42 passed, 1 skipped, three times in a row. **One earlier full run of the same suite failed once**
(`test_globalkeys.py::test_x11_grab_fires_on_the_key_only`, an Xvfb timing test with 0.6 s sleeps; it passes alone and in
the three later runs): flaky, not looked into.
## Earlier claims against what I saw
| Claim in WAYLAND_REPORT.md | Verdict |
|---|---|
| XWayland game read through XWayland, no dialog, overlay over the monitor, watermark, game keeps keys | **Seen** (run 2, 3, 4) *after* the detection fix; before it, run 1 took the game for a native one. |
| Voidrunner can't run native Wayland | **Consistent** with what I saw (`GLFW - X11`, X window exists). |
| `--monitor` matched by name: the picture covers HDMI-A-1 only | I only looked at HDMI-A-1's crop (the picture covered it, fitted). I did not look at the other monitors. |
| Ctrl+Alt+R through the GlobalShortcuts portal needs the installed `summit.desktop` | **Not reproduced**: portal keys worked with no `summit.desktop` in any applications folder (`ls` of `~/.local/share/applications`, `/usr/share/applications`, `/usr/local/share/applications` found none). Stale state in the portal is possible; I don't know. README/doctor now say "install it, but it worked once without". |
| "the share dialog shows once" | Seen once (run 1, wrongly, for an XWayland game); the dialog was answered by someone else. |
| `install.sh` "installs summit.desktop" | True under the *prefix*; a prefix outside `XDG_DATA_DIRS` is not read by the desktop. Not changed: **listed below**. |
| `install.sh --dry-run`/doctor fine | Dry run had two bugs (above); doctor's save-key text was too certain. |
| Launcher's backend "not checked" | Native Wayland. |
| Measured delay 21-38 ms, FSR 0.06 ms | Consistent: stats line 21-27 ms, `FSR 1 1920x1080 p50 0.06 ms`, 60-61 fps out while the game ran at 54-60. |
| Native Wayland path with a real game | **Still untested by me** (no native game; I did not rerun the stand-in after my detection change; only unit tests cover that branch). |
## Bugs found, fixed (each with a test) and committed
1. `install.sh`: sudo for a prefix the user can write. 2. dry-run showed the venv in the wrong place. 3. binaries looked
for in `<src>/target`. 4. second run died in `uv venv`. (All `crates/summit-cli/tests/install_script.rs`.)
5. XWayland game taken for a native one (`engine/framegen/window_portal.py`, `kwin.py`; `engine/tests/test_window_portal.py`).
6. New user's engine had instant replay off while Settings said 1 min (`engine::ui_clip_args`, test in `engine.rs`).
Also: engine output unbuffered so `last-run.log` is live; doctor wording.
## Not fixed (bigger or not mine to change)
- `summit.desktop` is installed under the install prefix only; with a prefix outside `XDG_DATA_DIRS` the desktop does not
see it. The installer could copy it to `~/.local/share/applications` for a user prefix; I did not do this on the
owner's desktop and did not change the installer for it.
- The launcher opens on whichever monitor KWin picks (here his main one).
- A native Wayland window's picture includes its title bar (KWin's window stream does) and is fitted with bars when
the window is not the monitor's shape.
- Real keyboard input, other desktops, fractional scaling, 90/120 Hz output, VRR, HDR, Proton/Steam games, clip audio,
DMA-BUF: not tested (same as the earlier report).
- The `pacman`/`sudo` part of `install.sh`, `--uninstall`, `/usr/local`: not run.
- Flaky `test_x11_grab_fires_on_the_key_only` (1 failure in 4 runs).
## What is on the owner's machine
- Left: `~/summit-test/verify` (9.3 GB: cargo home, target, the venv with torch, the game copy, logs, clips, screenshots
not committed). `rm -rf ~/summit-test/verify` removes it.
- Dialogs that appeared and that I did not answer: KDE's "xdotool is asking to control input devices" (once, in the
first minutes), the share dialog (run 1) and `Global Shortcuts Requested` (run 2). Whoever answered, answered; the
xdotool permission is still the owner's choice.
- Created by my runs and **removed**: the portal's ScreenCast permission entry for app `summit` (deleted by id from the
permission store; the others were left), the `[summit]` component in `~/.config/kglobalshortcutsrc` (removed through
kglobalaccel's `cleanUp`; every run that used the portal key recreated it, so it was cleaned after runs 1-2, after run 3 and after run 4; last check: 0 `[summit]` sections). No `summit.desktop` was written outside the scratch prefix.
- One Voidrunner process was left running for about 2.5 minutes by a failed test script of mine (a `( ... &)` double
fork); I killed it by PID after checking its executable was the test copy.
- Nothing installed system-wide, no sudo, nothing written under `~/Games`, `~/Projects`, Steam or `~/.local/share/applications`.
+38
View File
@@ -0,0 +1,38 @@
# Agent report: wayland-verify
Independent verification of the Wayland work, on the owner's KDE Plasma 6.8 Wayland desktop (RTX 5080). Verdict and
evidence: [docs/WAYLAND_VERIFY.md](../WAYLAND_VERIFY.md) (`WAYLAND VERIFY: PASS`).
## What changed (commits on `ap/wayland-verify`)
- `install.sh`: no sudo when the prefix is writable by the user; `--no-deps`; binaries taken from cargo's real target
dir (`cargo metadata`); the dry run shows the venv under the prefix; running it again keeps the venv.
Tests: `crates/summit-cli/tests/install_script.rs` (5).
- Engine: an XWayland game is no longer taken for a native Wayland window (KWin 6.8 has no `windowId`;
`window_portal.native_candidates` / `x_client_pids`). Tests in `engine/tests/test_window_portal.py` (4 new; two fail on the old code).
- `summit run` / `summit enhance` always pass the Settings page's replay lengths (a new user had replay off while
Settings showed 1 min). `engine::ui_clip_args`, test in `engine.rs`.
- The engine's stdout is unbuffered under `summit run` (`last-run.log` is live).
- `summit doctor`'s save-key warning no longer overclaims.
- README rows (install, play from the launcher, live enhance, replay key, doctor) and `docs/WAYLAND_REPORT.md`
(a corrections section) corrected; `docs/WAYLAND_VERIFY.md` and five screenshots in `docs/media/wayland/` added.
## What I verified, and how
Fresh folder `~/summit-test/verify`: `install.sh --dry-run`, then real installs (non-root, scratch prefix, `--no-deps`
because I may not use sudo), `summit doctor`, the launcher (native Wayland window) with screenshots, three Play runs of
Voidrunner with Enhance (overlay, stats line, watermark, injected keys reaching the game, clips saved with Ctrl+Alt+R
decoded with ffmpeg and a frame viewed, clean exit by the game's own Quit, monitor mode 49 -> 51 -> 49 each time), and
the portal key fired while the native launcher window had the focus. Details and the exact output in WAYLAND_VERIFY.md.
`cargo test --workspace` passes; the engine's pytest on the desktop: 42 passed, 1 skipped (3 runs; one earlier run had
1 flaky failure in `test_x11_grab_fires_on_the_key_only`).
## What is NOT done
- The `sudo pacman` step of `install.sh`, `--uninstall`, `/usr/local`, release packages: not run.
- A real native Wayland game; the native stand-in was not re-run after my detection change (unit tests only); other
desktops; fractional scaling; 90/120 Hz; real keyboard (all keys injected with xdotool).
- `summit.desktop` is installed only under the install prefix (not seen by the desktop for an out-of-`XDG_DATA_DIRS`
prefix); the launcher opens on whichever monitor KWin picks; the native-window picture includes the title bar.
- I did not answer any desktop dialog (xdotool permission, share dialog, Global Shortcuts Requested): someone else did.
- Cleanup on the owner's machine: see the last section of WAYLAND_VERIFY.md (`rm -rf ~/summit-test/verify` removes the rest).
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

+4 -3
View File
@@ -18,9 +18,10 @@ const out = [];
for (const w of workspace.windowList()) {
if (!w.normalWindow) continue;
const f = w.frameGeometry; // a window's screencast holds its title bar too
// No XWayland flag: KWin 6.8's windows have no windowId (it is undefined for XWayland windows too, checked), so
// the engine tells XWayland windows by the X server's own client list (window_portal.x_client_pids).
out.push({pid: w.pid, caption: w.caption, cls: w.resourceClass, x: f.x, y: f.y, w: f.width, h: f.height,
active: w === workspace.activeWindow, x11: w.windowId !== undefined && w.windowId !== 0,
minimized: w.minimized, output: w.output ? w.output.name : "", id: String(w.internalId)});
active: w === workspace.activeWindow, minimized: w.minimized, output: w.output ? w.output.name : "", id: String(w.internalId)});
}
callDBus("%s", "/summit/kwin", "org.summit.KWinReport", "windows", JSON.stringify(out));
"""
@@ -36,7 +37,7 @@ class KWindow:
w: int
h: int
active: bool
x11: bool # an XWayland window (framegen/window_x11.py reads those directly)
x11: bool # always False: KWin 6.8 can't say (see SCRIPT); window_portal.native_candidates asks the X server
minimized: bool
output: str # the monitor it is on, e.g. "DP-1"
id: str # KWin's own id for it (stays the same while it's open)
+21 -2
View File
@@ -310,6 +310,24 @@ class PortalWindowSource:
print(f"[window] {self.grabs} frames from PipeWire, {self.same} unchanged (left out)")
def x_client_pids(x) -> set[int]:
"""The process ids of every window on the X server's client list, however small or untitled: XWayland's windows.
(KWin 6.8's script API has no 'is this an XWayland window' flag, so a window KWin lists is native only if no
X client has its pid. A game's window may be 1x1 or untitled for its first moments: find_windows() skips those
and the engine used to take such a game for a native Wayland one, with a share dialog and a PipeWire copy.)"""
pids = set()
for xid in x.client_ids():
w = x.describe(xid)
if w is not None and w.pid:
pids.add(w.pid)
return pids
def native_candidates(kwin_windows, xpids: set[int], own_pid: int) -> list:
"""KWin's windows that are not XWayland ones (no X client has the pid) and not this process's."""
return [w for w in kwin_windows if w.pid != own_pid and w.pid not in xpids]
def open_window(query: str, wait_s: float = 0.0, sleep=time.sleep, env=os.environ):
"""--window QUERY on a Wayland session: an XWayland window that matches (window_x11, no dialog), else a native
Wayland one KWin knows (the portal), waiting up to wait_s for either. Without KWin, a window that isn't an
@@ -336,8 +354,9 @@ def open_window(query: str, wait_s: float = 0.0, sleep=time.sleep, env=os.enviro
print("[window] an XWayland window: captured through XWayland")
return X11WindowSource(target, x)
if kw is not None:
try:
native = [w for w in kw.windows() if not w.x11 and w.pid != os.getpid()]
try: # KWin's list first, the X server's second: a window that is on KWin's list is on X's by then
listed = kw.windows()
native = native_candidates(listed, x_client_pids(x) if x is not None else set(), os.getpid())
except Exception as e: # noqa: BLE001
print(f"[window] KWin didn't list its windows ({str(e)[:120]})")
native = []
+69
View File
@@ -1,9 +1,12 @@
"""Wayland window capture (framegen/window_portal.py, framegen/kwin.py): the pure parts. The portal, PipeWire and
KWin themselves were run on a Plasma 6.8 desktop (docs/WAYLAND_REPORT.md), not here."""
import json
import os
import pathlib
import sys
import pytest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from framegen import kwin
from framegen import window_portal as wp
@@ -59,3 +62,69 @@ def test_restore_token_is_kept_private_under_summit_config(tmp_path):
wp.save_token("abc-123", p)
assert wp.load_token(p) == "abc-123"
assert (pathlib.Path(p).stat().st_mode & 0o777) == 0o600
# ---- XWayland or native? (KWin 6.8 gives no flag: found on the owner's desktop, where Voidrunner, an XWayland game,
# ---- was taken for a native Wayland window and shown the share dialog)
class FakeX:
def __init__(self, windows):
self.windows = windows # xid -> XWindow
def client_ids(self):
return list(self.windows)
def describe(self, xid):
return self.windows.get(xid)
def close(self):
pass
class FakeKWin:
def __init__(self, windows):
self._w = windows
def windows(self):
return self._w
def close(self):
pass
def _kw(pid, caption="Voidrunner", w=1288, h=749):
return kwin.KWindow(pid, caption, "game", 0, 0, w, h, False, False, False, "HDMI-A-1", f"{{{pid}}}")
def _wire(monkeypatch, xwins, kwins):
from framegen import window_x11 as wx
monkeypatch.setattr(wx, "session_problem", lambda env: None)
monkeypatch.setattr(wx, "X", lambda: FakeX(xwins))
monkeypatch.setattr(wx, "find_windows", lambda x=None: [w for w in xwins.values() if w.title and w.w >= 100 and w.h >= 100])
monkeypatch.setattr(kwin, "available", lambda env=None: True)
monkeypatch.setattr(kwin, "KWin", lambda: FakeKWin(kwins))
monkeypatch.setattr(wp, "PortalWindowSource", lambda w, kw: ("portal", w.caption))
def test_native_candidates_leave_out_windows_the_x_server_has():
ks = [_kw(42), _kw(43, "native"), _kw(os.getpid(), "me")]
assert [w.pid for w in wp.native_candidates(ks, {42}, os.getpid())] == [43]
def test_a_tiny_untitled_xwayland_window_is_not_taken_for_a_native_one(monkeypatch):
# The X client list has pid 42 as a 1x1 window with no title (the game is still starting): find_windows skips it,
# but KWin already lists it. It must not be offered to the portal.
_wire(monkeypatch, {1: XWindow(1, "", "game", 42, 1, 1)}, [_kw(42)])
with pytest.raises(RuntimeError, match="no window matches"):
wp.open_window("pid:42", wait_s=0.0, sleep=lambda s: None, env={})
def test_a_window_only_kwin_knows_goes_to_the_portal(monkeypatch):
_wire(monkeypatch, {1: XWindow(1, "Editor", "kate", 10, 800, 600)}, [_kw(42)])
assert wp.open_window("pid:42", wait_s=0.0, sleep=lambda s: None, env={}) == ("portal", "Voidrunner")
def test_an_xwayland_game_is_captured_through_x(monkeypatch):
from framegen import window_x11 as wx
_wire(monkeypatch, {1: XWindow(1, "Voidrunner", "game", 42, 1280, 720)}, [_kw(42)])
monkeypatch.setattr(wx, "X11WindowSource", lambda target, x: ("x11", target.title))
assert wp.open_window("pid:42", wait_s=0.0, sleep=lambda s: None, env={}) == ("x11", "Voidrunner")
+57 -15
View File
@@ -12,11 +12,14 @@
# Flags:
# --yes, -y don't ask before sudo steps
# --dry-run print what would happen, change nothing
# --no-deps don't install system packages (no sudo for pacman/apt/dnf/zypper); you have the build tools
# and the runtime tools already
# --uninstall remove what this installer installed
# --help, -h show this message
#
# Environment:
# SUMMIT_PREFIX where to install (default /usr/local)
# SUMMIT_PREFIX where to install (default /usr/local). sudo is used for the copy only when the user can't
# write there; a prefix under your home needs none.
# SUMMIT_SRC_DIR build this checkout as it is (no clone, no git pull)
set -eu
@@ -33,6 +36,7 @@ ICON_DIR="$PREFIX/share/icons/hicolor/64x64/apps"
ASSUME_YES=0
DRY_RUN=0
UNINSTALL=0
NO_DEPS=0
log() { printf '%s\n' "$*"; }
step() { printf '\n==> %s\n' "$*"; }
@@ -63,8 +67,24 @@ run_sudo() {
run sudo "$@"
}
# Copying into the prefix: sudo only when this user can't write there (the /usr/local default), never for a prefix
# in the user's own home.
can_write_prefix() {
d="$PREFIX"
while [ ! -e "$d" ] && [ "$d" != "/" ]; do d="$(dirname "$d")"; done
[ -w "$d" ]
}
run_prefix() {
if [ "$(id -u)" -eq 0 ] || can_write_prefix; then
run "$@"
else
run_sudo "$@"
fi
}
usage() {
sed -n '2,20p' "$0" | sed 's/^# \{0,1\}//'
sed -n '2,/^set -eu/p' "$0" | sed '$d' | sed 's/^# \{0,1\}//'
}
# Tools Summit calls at run time. A missing one only disables a feature, so a failure here warns instead of
@@ -76,6 +96,7 @@ for arg in "$@"; do
case "$arg" in
--yes|-y) ASSUME_YES=1 ;;
--dry-run) DRY_RUN=1 ;;
--no-deps) NO_DEPS=1 ;;
--uninstall) UNINSTALL=1 ;;
--help|-h) usage; exit 0 ;;
*) die "unknown flag: $arg (see --help)" ;;
@@ -158,6 +179,11 @@ detect_session() {
# ---------------------------------------------------------------------------
install_dependencies() {
if [ "$NO_DEPS" -eq 1 ]; then
step "Skipping system packages (--no-deps)"
check_runtime_tools
return
fi
step "Installing build and runtime dependencies for $DISTRO_FAMILY"
case "$DISTRO_FAMILY" in
arch)
@@ -287,6 +313,16 @@ install_native_package() {
esac
}
# Where cargo put the binaries: not $SRC_DIR/target when CARGO_TARGET_DIR or build.target-dir is set.
cargo_target_dir() {
t=""
if [ "$DRY_RUN" -eq 0 ]; then
t="$(cargo metadata --format-version 1 --no-deps --manifest-path "$SRC_DIR/Cargo.toml" 2>/dev/null \
| grep -o '"target_directory":"[^"]*"' | sed 's/^"target_directory":"//; s/"$//' || true)"
fi
printf '%s' "${t:-${CARGO_TARGET_DIR:-$SRC_DIR/target}}"
}
build_from_source() {
step "No usable release package found, building from source"
ensure_rust
@@ -302,14 +338,15 @@ build_from_source() {
run git clone "$REPO_GIT" "$SRC_DIR"
fi
run cargo build --release --manifest-path "$SRC_DIR/Cargo.toml" -p summit -p summit-gui
run_sudo install -Dm755 "$SRC_DIR/target/release/summit" "$BIN_DIR/summit"
run_sudo install -Dm755 "$SRC_DIR/target/release/summit-gui" "$BIN_DIR/summit-gui"
run_sudo mkdir -p "$SHARE_DIR/engine"
run_sudo cp -r "$SRC_DIR/engine/." "$SHARE_DIR/engine/"
target_dir="$(cargo_target_dir)"
run_prefix install -Dm755 "$target_dir/release/summit" "$BIN_DIR/summit"
run_prefix install -Dm755 "$target_dir/release/summit-gui" "$BIN_DIR/summit-gui"
run_prefix mkdir -p "$SHARE_DIR/engine"
run_prefix cp -r "$SRC_DIR/engine/." "$SHARE_DIR/engine/"
install_desktop_entry "$SRC_DIR/packaging"
# The engine's venv is made in there next, without sudo (uv and the Python it downloads live in the user's home),
# so the folder has to belong to the user who runs Summit.
if [ "$(id -u)" -ne 0 ]; then
if [ "$(id -u)" -ne 0 ] && ! can_write_prefix; then
run_sudo chown -R "$(id -u):$(id -g)" "$SHARE_DIR/engine"
fi
}
@@ -318,13 +355,13 @@ install_desktop_entry() {
# The app menu entry, pointing at the installed binary by its full path (a custom SUMMIT_PREFIX is often not
# on the menu's PATH).
pkg="$1"
run_sudo install -Dm644 "$pkg/icons/summit.png" "$ICON_DIR/summit.png"
run_prefix install -Dm644 "$pkg/icons/summit.png" "$ICON_DIR/summit.png"
desktop_tmp="$(mktemp)"
sed "s|^Exec=summit-gui|Exec=$BIN_DIR/summit-gui|" "$pkg/summit.desktop" > "$desktop_tmp"
run_sudo install -Dm644 "$desktop_tmp" "$APPS_DIR/summit.desktop"
run_prefix install -Dm644 "$desktop_tmp" "$APPS_DIR/summit.desktop"
rm -f "$desktop_tmp"
if command -v update-desktop-database >/dev/null 2>&1; then
run_sudo update-desktop-database "$APPS_DIR" || true
run_prefix update-desktop-database "$APPS_DIR" || true
fi
}
@@ -350,14 +387,19 @@ setup_engine_venv() {
step "Setting up the engine's Python environment (uv, Python 3.12)"
ensure_uv
engine_dir="$SHARE_DIR/engine"
if [ ! -d "$engine_dir" ]; then
if [ ! -d "$engine_dir" ] && [ "$DRY_RUN" -eq 0 ]; then
engine_dir="$SRC_DIR/engine"
fi
if [ ! -d "$engine_dir" ]; then
if [ ! -d "$engine_dir" ] && [ "$DRY_RUN" -eq 0 ]; then
log " engine sources not found, skipping venv setup"
return
fi
run uv venv --python 3.12 "$engine_dir/.venv"
if [ -x "$engine_dir/.venv/bin/python" ]; then
# Running the installer again to update: `uv venv` refuses to replace a venv, and torch is already in it.
log " the venv exists: $engine_dir/.venv (kept; the packages below are brought up to date)"
else
run uv venv --python 3.12 "$engine_dir/.venv"
fi
if [ "$GPU_VENDOR" = "nvidia" ]; then
# torch first: requirements.txt only says torch>=2.6, and PyPI's default wheel is built for a newer CUDA than
# many installed drivers support (seen: torch 2.15+cu132 on a driver that stops at CUDA 13.0).
@@ -413,8 +455,8 @@ do_install() {
do_uninstall() {
step "Uninstalling Summit"
run_sudo rm -f "$BIN_DIR/summit" "$BIN_DIR/summit-gui" "$APPS_DIR/summit.desktop" "$ICON_DIR/summit.png"
run_sudo rm -rf "$SHARE_DIR"
run_prefix rm -f "$BIN_DIR/summit" "$BIN_DIR/summit-gui" "$APPS_DIR/summit.desktop" "$ICON_DIR/summit.png"
run_prefix rm -rf "$SHARE_DIR"
log "Left in place: $SRC_DIR (build cache), ~/.config/summit, ~/.local/share/summit (your data)"
}