Merge ap/optimizer

This commit is contained in:
alex committed 2026-11-26 08:25:20 +00:00
commit d5ed3cd6d8
23 files changed
+3270 -5

No files matched your search

+28
View File
@@ -85,6 +85,8 @@ What was really run: see [Status](#status) (a real install into a scratch prefix
| Summit watermark over the picture | **Working** | `summit - git.molberg.cloud/alex/summit` (bottom left) is on screen in the engine's window. `--no-watermark` turns it off. Not drawn into saved clips. |
| Session summary (JSON and text), `--benchmark`, result card | **Working on X11 with a video file; not tried elsewhere** | Written when the engine stops, on key P and from the overlay's Home tab; `--benchmark SECONDS` ran for real on the VM with the countdown and the card. Not checked: other sources, Windows, `--results` beside a test-mode report in a real launcher run. |
| CSV frame log (`--frametime-log`) | **Experimental** | Written and read back here; the columns follow MangoHud's log as I remember it, not checked against MangoHud's own tools or a graphing program. |
| Optimize: find settings for your minimums and one priority (`--optimize`, overlay's Optimize tab) | **Experimental** | New. Ran for real on the GPU test VM (RTX 3090 shared with another service, **software OpenGL** for the window, a 720p recording played as a 30 fps game): `--optimize` on a file measured 5-7 configurations per run, rejected the ones that dropped frames or queued, showed the countdown and the card, and wrote the result file; in a session, started, cancelled (settings back exactly) and applied (saved) through `--control`. The search logic is tested with a fake measurer. **The VM's numbers are not the owner's**: its window paces 60 fps unevenly, so no 60 fps minimum held there, and two runs with the same goal chose differently (2x vs no frame generation). Not run: a real game, Remote Play, RTX VSR, NVIDIA VFG, TensorRT, the keyboard on the card in a live session, Windows. See [Optimize](#optimize-find-my-settings). |
| Headroom check in session summaries | **Experimental** | New. Each session summary gets `headroom` ("uses 41% of a 120 Hz frame budget: 3 changes could improve the picture", or the reverse when falling behind), a one-time message in the overlay, and a note on the Optimize tab. Suggestions only. It is an estimate from the stage timings; seen in a real summary on the VM. |
| 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, **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. 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. **Second real run** (independent verifier, 2026-11-24, an earlier version of the script than the one now here): 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, 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; the merged script (update flow, icons, `--with-remote-play`) was only dry-run, not run for real. Other distros: `--dry-run` only. |
| Steam scan (all library folders, installed or not), Steam playtime, "most played" | **Working** (owner's desktop) / **Tested** | Run against the owner's real Steam install (2026-11-24; Arch, 32 games over three library folders, eight accounts): every game gets a cover. Newer Steam clients cache the covers as `library_capsule.jpg` and `library_header.jpg` (in hash folders), which Summit missed before; it now reads those, and art you set yourself in Steam (`userdata/<user>/config/grid`) comes first. |
@@ -344,6 +346,32 @@ The Overlay tab of the in-game menu (real, over the same run): the stats setting
Headless renders of every style with made-up numbers (labelled on the picture) come from `python engine/devtools/render_stats_samples.py OUT_DIR`; the tests use the same data.
## Optimize: find my settings
Pick your minimums (output resolution, frame rate, optionally the most added delay) and **one** priority: frame rate,
resolution, quality or lowest delay. Optimize starts from the cheapest configuration that meets the minimums, measures it
for a few seconds after a warm-up, then raises your priority one step at a time until a step fails. It then spends the rest
of its time budget on the picture, never giving back the priority. A candidate passes only if its **1% low** (not the
average) holds the minimum with about 10% to spare, it drops no frames, and the queue has drained. Only Summit's own
settings are tried (frame multiplier, model, motion detail, AI engine, upscaler and its level, output resolution,
anti-aliasing). **Summit can't change a game's own graphics options.** "Quality" has no live score: it follows a fixed
ranking, shown on the card: the display's own resolution, then RTX VSR over FSR 1, then Full motion detail, then
anti-aliasing, then supersampling.
```
python run.py game.mp4 --display --optimize "min=1920x1080@60,priority=quality" --optimize-budget 120 --results out/opt.txt
```
In a session: the overlay's **Optimize** tab, then **Find my settings**. A countdown with the current candidate shows at the
top (Esc or the tab stops it and puts every setting back). The card at the end shows the best three with their numbers and
why. Enter (or **Apply the result**) saves #1; Esc (or **Keep my settings**) puts yours back. The results go to
`~/.local/share/smoovplay/optimize/` (format: [docs/optimizer.md](docs/optimizer.md)), for the launcher to offer them.
![Optimize running](docs/media/optimizer/real-cli-countdown.png)
![Optimize result](docs/media/optimizer/real-cli-card.png)
Real engine output on the GPU test VM (software OpenGL window, shared RTX 3090): the numbers there are not a gaming PC's.
## The launcher
```sh
+90
View File
@@ -0,0 +1,90 @@
# Optimizer agent report (branch ap/optimizer)
Task: a benchmark that finds the engine settings for the owner's minimums and one priority, with an overlay entry,
result files the launcher can read, and a cheap headroom check from session stats.
## What changed
| Area | Files |
|---|---|
| Search, verdict, result dict/file/text, measuring a span of the collector, headroom check, live Runner/Control, result card image | new `engine/framegen/optimize.py` |
| Tests (no GPU, no window): parsing, verdict, search order, display ceiling, pruning, time budget, nothing-met report, delay priority, the result file, Runner with the real `Collector` and `Settings` (cancel restores exactly, apply saves, CLI quits), backlog wait, pipeline hook, Optimize tab, headroom | new `engine/tests/test_optimize.py` (24 tests) |
| `Pipeline.driver`: stepped once a tick, may ask for a restart or the end; `optimize*` commands forwarded | `engine/framegen/pipeline.py` (+8 lines) |
| Optimize tab rows (`opt_min_res`, `opt_min_fps`, `opt_max_delay`, `opt_priority`, `opt_budget`), `specs_json()["optimize"]` | `engine/framegen/settings.py` (added block before `_laid_out`, one line in `specs_json`) |
| Optimize tab actions (Find my settings / Stop / Apply / Keep mine) and the headroom note | `engine/framegen/menu.py` (small additions) |
| Countdown banner and result card drawn over the picture; Esc / Enter while it runs or the card is up; `display_mode()` | `engine/framegen/io.py` (+~50 lines) |
| `--optimize`, `--optimize-budget`, Machine from the session, result files, `headroom` in session summaries, `--control` commands `optimize`, `optimize-cancel`, `optimize-apply` | `engine/run.py`, `engine/framegen/remote.py` (doc lines) |
| Format for the launcher | new `docs/optimizer.md` |
| README: status rows and an "Optimize: find my settings" section | `README.md` |
No Rust touched; nothing in compare.py or the launcher crates.
### How it works (short)
* Candidates are engine settings only (`interp`/`hz`, `model`, `motion`, `engine`, `scaler`, `vsr_quality`, `output_res`, `aa`).
Bilinear, no upscaler and CAS are not tried (stated in the result).
* Order: the cheapest configuration that meets the minimums (smallest multiplier, minimum size, FSR 1, Half motion, AA off).
If it fails: 2x when it was "no frame generation", then VFG / TensorRT if available. Then the priority's ladder, one step at a
time until a step fails, then the quality ladder in ranking order. Priority "delay" refuses steps that add more than 2 ms.
A candidate at least as heavy in every dimension as one that failed on performance is skipped, with the reason.
Each step's cost is estimated (7 s live, about 20 s with a restart). The search stops when the budget can't cover the next
step, and says so.
* Restart settings (motion, engine, model) are changed one step at a time. A failed restart step means at most one restart back.
"No frame generation" keeps the session's AI settings, so it needs no restart.
* Pass rule: see `judge()` and docs/optimizer.md. One change from the task's wording: when the display's refresh rate is the minimum,
no frame rate can be 10% above it, so the 1% low must reach 97% of the target and the 10% headroom moves to the frame budget
(at most ~91% busy).
* Live: settings are overrides (never saved) until Apply. Cancel and errors put back exactly the nine engine values as they
were (tested with the real `Settings`, file untouched). At the end the best result is shown live under the card.
## Verified, and how
* `cd engine && env -u PYTHONPATH /root/.cache/summit-venv/bin/python -m pytest tests -q`: **233 passed, 1 skipped**
(main had 207 + 1 skipped). Each commit passed it.
* GPU test VM, my own directory `/home/user/summit-optimizer` (engine venv; Pillow copied from the host venv into `pylib`),
X11 :0, 1920x1080 at 120 Hz monitor, a 1280x720 window, software OpenGL, RTX 3090 shared with another service,
`play60.mp4` (a 720p 60 fps recording) played as a 30 fps game, `--no-graph`:
1. `--optimize "min=1280x720@60,priority=quality"`: **nothing met**. The base (2x, 720p, FSR, Half) measured an average of
59.97 fps, a 1% low of 34-37 fps, 21 ms delay and 20% busy; the 1% low must be 58. Cause: the VM's window paces 60 fps unevenly
(the session's frame-to-frame jitter was 12.6 ms; vsync on did not help, 37 fps). Kept as the real "not met" example.
2. `--optimize "min=1280x720@30,priority=fps"`, three runs. Run A (screen locked, so no usable screenshots): 7 measured in 126 s.
#1 2x + FXAA; 3x rejected (frames dropped); 900p rejected (only 3 frames, then a 10 s queue). Run B: same choice,
6 measured. Run C (screen unlocked; screenshots and `real-result-fps.json`): 2x missed by 3 fps (1% low 30, needs 33),
so #1 is no frame generation + SMAA. **The same goal gave different winners on this shared VM**: noise of the test
machine, reported as measured.
3. In-session path, through `--control` on stdin: `optimize` started a run (banner seen), `optimize-cancel` stopped it
("settings put back", a cancelled result file written), `optimize` again ran to the card, and `optimize-apply` saved #1.
The settings file afterwards had `output_res 1600x900`, `aa off` (was `cas`), `interp false`: exactly #1.
4. Session summaries from these runs contain `headroom` (e.g. state `room`, 41% busy at 120 Hz).
* The first VM run found a real bug: after a restart, a file played in real time keeps a backlog for seconds, and the warm-up
(one capture-wait reading) measured inside it. The fix: wait until no frame queued 50 ms for a whole second. Unsettled
measurements are rejected with the queue length.
## Screenshots (docs/media/optimizer/), all looked at
Real engine output, VM window (1280x720) grabbed from the root window and cropped to 1180 px wide to cut out KDE
"Memory shortage" popups on the right:
* `real-cli-countdown.png`: `--optimize` running; banner "Optimizing: about 2:21 left, 2 tried / 720p, 2x (60 fps)… / settling".
* `real-cli-card.png`: that run's card (run C, `real-result-fps.json`/`.txt`). It still says "card memory 20.9 GB" (all programs).
The card now shows the engine's own memory; this screenshot is older than that change.
* `real-cli-card-not-met.png`: run 1, "your minimums weren't reached" (`real-result-not-met.json`/`.txt`).
* `real-overlay-running.png`, `real-overlay-card.png`: the in-session run started through `--control`
(`real-result-overlay-applied.json`). The stats line shows a 6.5 s delay at that moment: the backlog left by the
rejected 900p+FXAA step was still draining.
* `headless-menu-optimize-tab.png`: the Optimize tab rendered headless by `Menu.render()`. The headroom note on it is sample text.
* `real-session-summary-with-headroom.json`: a real summary with `headroom`. It was written before suggestions got their `set`
field, and its first suggestion ("hz 60" with frame generation off) is the bug that change fixed.
## Not done / untested / to know
* **Not run on a real game, Remote Play, a capture card, Windows or Wayland.** RTX VSR, NVIDIA VFG and TensorRT were not on the VM,
so their steps (and VFG/TensorRT fallbacks) ran only in tests. Restart steps (Full motion) ran live only as the session's
own motion "auto" -> "half" restarts. A climb that restarts to Full was not reached on the VM.
* Keys on the card (Enter/Esc) and the menu rows were **not** pressed live. My first attempt with XTest keys went to the
wrong windows: other agents' engine windows were open on the shared display, and some of my key presses (m, Tab, Down,
Return, Escape, around 07:2x VM time) **probably reached another agent's test window**. I stopped and used `--control` instead.
The menu rows and Enter/Esc handling are covered by tests and the headless render only.
* "Most added delay" uses the pipeline's own real-frame delay (arrival to screen), not end-to-end input lag.
* With frame generation off, the screen still gets 60 presents a second (each game frame twice), so "average 60 fps" shows for a
"30 fps" configuration. The pass rule uses the game's rate there.
* "Load" (pipeline busy) adds up AI-frame wall time and GL timer queries. On software OpenGL the upscaler's time is the CPU's.
* The Optimize rows also appear in the launcher's Settings page (the registry test requires every setting in `specs_json`).
The profiles agent can hide that section or use it to start a run (`set opt_... ` + `optimize` over `--control`).
* The 1% low over 5 s is strict: one 25 ms hitch in 300 frames fails a 60 fps target on a 60 Hz display. That is deliberate (the owner asked for
lows, not averages). If it proves too strict on the owner's PC, `MEASURE_S` or `AT_TARGET` are the knobs.
Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

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: 1.1 MiB

+370
View File
@@ -0,0 +1,370 @@
{
"format": "summit-optimize",
"version": 1,
"created": "2026-11-26T07:21:42",
"created_unix": 1795674102,
"game": null,
"goal": {
"min_resolution": "1280x720",
"min_fps": 30,
"max_delay_ms": null,
"priority": "fps",
"text": "at least 720p at 30 fps; priority frame rate"
},
"machine": {
"display_hz": 120.0,
"src_fps": 30,
"vsr": false,
"vfg": false,
"trt": false,
"max_mult": 10,
"motion_fixed": null,
"model_fixed": null,
"restarts": true,
"display": "1920x1080",
"source": "1280x720",
"text": "display 1080p at 120 Hz, game 1280x720 at 30 fps"
},
"budget_s": 150.0,
"elapsed_s": 70.4,
"restarts": 0,
"cancelled": false,
"error": null,
"met": true,
"top": [
{
"rank": 1,
"label": "720p, no frame generation (30 fps), AMD FSR 1, SMAA-style",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "auto",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "smaa"
},
"measured": {
"fps_avg": 60.03,
"low1": 34.36,
"frames": 301,
"dropped": 0,
"delay_ms": 6.99,
"stages": {
"capture": 0.259,
"upscale": 1.12,
"present": 2.395
},
"load": 0.07,
"vram_mb": 21447.0,
"engine_mb": 455.08,
"seconds": 5.01,
"took_s": 9.06,
"queue_ms": 0.1,
"settled": true
},
"why": "The highest frame rate that held: 30 fps (1% low 34) on this 120 Hz display; then the best picture there."
},
{
"rank": 2,
"label": "720p, no frame generation (30 fps), AMD FSR 1, FXAA",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "auto",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "fxaa"
},
"measured": {
"fps_avg": 60.01,
"low1": 37.63,
"frames": 301,
"dropped": 0,
"delay_ms": 6.86,
"stages": {
"capture": 0.176,
"upscale": 1.257,
"present": 2.577
},
"load": 0.08,
"vram_mb": 21445.0,
"engine_mb": 452.98,
"seconds": 5.02,
"took_s": 14.74,
"queue_ms": 0.1,
"settled": true
},
"why": "Also passed; ranked below #1 for a plainer picture."
},
{
"rank": 3,
"label": "720p, no frame generation (30 fps), AMD FSR 1",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "auto",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "off"
},
"measured": {
"fps_avg": 59.88,
"low1": 32.55,
"frames": 300,
"dropped": 0,
"delay_ms": 8.23,
"stages": {
"capture": 0.622,
"upscale": 1.49,
"present": 3.784
},
"load": 0.09,
"vram_mb": 21969.0,
"engine_mb": 169.87,
"seconds": 5.0,
"took_s": 8.03,
"queue_ms": 1.1,
"settled": true
},
"why": "Also passed; ranked below #1 for a plainer picture."
}
],
"closest": null,
"failures": [],
"tried": [
{
"label": "720p, no frame generation (30 fps), AMD FSR 1",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "auto",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "off"
},
"step": "the cheapest configuration that meets the minimums",
"passed": true,
"rejected": [],
"measured": {
"fps_avg": 59.88,
"low1": 32.55,
"frames": 300,
"dropped": 0,
"delay_ms": 8.23,
"stages": {
"capture": 0.622,
"upscale": 1.49,
"present": 3.784
},
"load": 0.09,
"vram_mb": 21969.0,
"engine_mb": 169.87,
"seconds": 5.0,
"took_s": 8.03,
"queue_ms": 1.1,
"settled": true
}
},
{
"label": "720p, 2x (60 fps), AMD FSR 1, Auto motion",
"settings": {
"interp": true,
"hz": 60,
"model": "4.22.lite",
"motion": "auto",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "off"
},
"step": "a higher frame multiplier",
"passed": false,
"rejected": [
"1% low 30 fps, needs 33 (the minimum plus 10%)"
],
"measured": {
"fps_avg": 60.08,
"low1": 29.85,
"frames": 301,
"dropped": 0,
"delay_ms": 27.58,
"stages": {
"capture": 1.415,
"interp": 6.591,
"upscale": 1.698,
"present": 4.578
},
"load": 0.3,
"vram_mb": 22239.0,
"engine_mb": 450.89,
"seconds": 5.02,
"took_s": 11.57,
"queue_ms": 8.5,
"settled": true
}
},
{
"label": "900p, no frame generation (30 fps), AMD FSR 1",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "auto",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1600x900",
"aa": "off"
},
"step": "output resolution up to the display's",
"passed": false,
"rejected": [
"1% low 22 fps, needs 29",
"frames were still queuing after the warm-up (95th percentile 4903 ms): the pipeline didn't catch up"
],
"measured": {
"fps_avg": 42.34,
"low1": 21.75,
"frames": 212,
"dropped": 0,
"delay_ms": 730.46,
"stages": {
"capture": 1403.581,
"upscale": 12.602,
"present": 4.232
},
"load": 0.53,
"vram_mb": 22239.0,
"engine_mb": 450.89,
"seconds": 5.01,
"took_s": 27.02,
"queue_ms": 4902.9,
"settled": false
}
},
{
"label": "720p, no frame generation (30 fps), AMD FSR 1, FXAA",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "auto",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "fxaa"
},
"step": "anti-aliasing",
"passed": true,
"rejected": [],
"measured": {
"fps_avg": 60.01,
"low1": 37.63,
"frames": 301,
"dropped": 0,
"delay_ms": 6.86,
"stages": {
"capture": 0.176,
"upscale": 1.257,
"present": 2.577
},
"load": 0.08,
"vram_mb": 21445.0,
"engine_mb": 452.98,
"seconds": 5.02,
"took_s": 14.74,
"queue_ms": 0.1,
"settled": true
}
},
{
"label": "720p, no frame generation (30 fps), AMD FSR 1, SMAA-style",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "auto",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "smaa"
},
"step": "anti-aliasing",
"passed": true,
"rejected": [],
"measured": {
"fps_avg": 60.03,
"low1": 34.36,
"frames": 301,
"dropped": 0,
"delay_ms": 6.99,
"stages": {
"capture": 0.259,
"upscale": 1.12,
"present": 2.395
},
"load": 0.07,
"vram_mb": 21447.0,
"engine_mb": 455.08,
"seconds": 5.01,
"took_s": 9.06,
"queue_ms": 0.1,
"settled": true
}
}
],
"skipped": [
{
"label": "900p, no frame generation (30 fps), AMD FSR 1, SMAA-style",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "auto",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1600x900",
"aa": "smaa"
},
"why": "supersampling (bigger than the display)",
"reason": "at least as heavy as 900p, no frame generation (30 fps), AMD FSR 1, which failed"
}
],
"quality_ranking": [
"Output resolution, up to the display's own size: a smaller picture is stretched to the screen and looks softer.",
"Upscaler: NVIDIA RTX VSR (a higher level first) above AMD FSR 1.",
"Motion detail: Full above Half (Half is a little softer on small, fast details).",
"Anti-aliasing: SMAA-style above FXAA above Off.",
"Supersampling: an output bigger than the display, shrunk to it."
],
"not_ranked": "Not ranked: the AI engine (TensorRT and PyTorch draw the same frames), the interpolation model (NVIDIA's licence doesn't allow comparing VFG with RIFE), FSR sharpening and CAS (taste: kept as you set them), and Bilinear or no upscaler (FSR 1 costs about 0.1 ms and looks better, so they aren't tried).",
"rules": {
"headroom": 1.1,
"drop_limit": 0.005,
"avg_share": 0.95,
"at_target": 0.97,
"load_limit": 0.909,
"warm_s": 2.0,
"warm_restart_s": 5.0,
"measure_s": 5.0
},
"notes": [
"Summit changes only its own settings (frame generation, upscaling, anti-aliasing). It can't change the game's own graphics options."
]
}
+30
View File
@@ -0,0 +1,30 @@
Summit optimize: at least 720p at 30 fps; priority frame rate
display 1080p at 120 Hz, game 1280x720 at 30 fps
5 configurations measured in 70 s (budget 150 s, 0 restarts)
#1 720p, no frame generation (30 fps), AMD FSR 1, SMAA-style
avg 60 fps, 1% low 34, delay 7 ms, load 7%
The highest frame rate that held: 30 fps (1% low 34) on this 120 Hz display; then the best picture there.
#2 720p, no frame generation (30 fps), AMD FSR 1, FXAA
avg 60 fps, 1% low 38, delay 7 ms, load 8%
Also passed; ranked below #1 for a plainer picture.
#3 720p, no frame generation (30 fps), AMD FSR 1
avg 60 fps, 1% low 33, delay 8 ms, load 9%
Also passed; ranked below #1 for a plainer picture.
Tried:
pass 720p, no frame generation (30 fps), AMD FSR 1 (the cheapest configuration that meets the minimums)
FAIL 720p, 2x (60 fps), AMD FSR 1, Auto motion (a higher frame multiplier): 1% low 30 fps, needs 33 (the minimum plus 10%)
FAIL 900p, no frame generation (30 fps), AMD FSR 1 (output resolution up to the display's): 1% low 22 fps, needs 29; frames were still queuing after the warm-up (95th percentile 4903 ms): the pipeline didn't catch up
pass 720p, no frame generation (30 fps), AMD FSR 1, FXAA (anti-aliasing)
pass 720p, no frame generation (30 fps), AMD FSR 1, SMAA-style (anti-aliasing)
skip 900p, no frame generation (30 fps), AMD FSR 1, SMAA-style: at least as heavy as 900p, no frame generation (30 fps), AMD FSR 1, which failed
Quality ranking:
1. Output resolution, up to the display's own size: a smaller picture is stretched to the screen and looks softer.
2. Upscaler: NVIDIA RTX VSR (a higher level first) above AMD FSR 1.
3. Motion detail: Full above Half (Half is a little softer on small, fast details).
4. Anti-aliasing: SMAA-style above FXAA above Off.
5. Supersampling: an output bigger than the display, shrunk to it.
Not ranked: the AI engine (TensorRT and PyTorch draw the same frames), the interpolation model (NVIDIA's licence doesn't allow comparing VFG with RIFE), FSR sharpening and CAS (taste: kept as you set them), and Bilinear or no upscaler (FSR 1 costs about 0.1 ms and looks better, so they aren't tried).
Note: Summit changes only its own settings (frame generation, upscaling, anti-aliasing). It can't change the game's own graphics options.
@@ -0,0 +1,143 @@
{
"format": "summit-optimize",
"version": 1,
"created": "2026-11-26T07:11:27",
"created_unix": 1795673487,
"game": null,
"goal": {
"min_resolution": "1280x720",
"min_fps": 60,
"max_delay_ms": null,
"priority": "quality",
"text": "at least 720p at 60 fps; priority quality"
},
"machine": {
"display_hz": 120.0,
"src_fps": 30,
"vsr": false,
"vfg": false,
"trt": false,
"max_mult": 10,
"motion_fixed": null,
"model_fixed": null,
"restarts": true,
"display": "1920x1080",
"source": "1280x720",
"text": "display 1080p at 120 Hz, game 1280x720 at 30 fps"
},
"budget_s": 120.0,
"elapsed_s": 13.2,
"restarts": 0,
"cancelled": false,
"error": null,
"met": false,
"top": [],
"closest": {
"label": "720p, 2x (60 fps), AMD FSR 1, Half motion",
"settings": {
"interp": true,
"hz": 60,
"model": "4.22.lite",
"motion": "half",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "off"
},
"measured": {
"fps_avg": 60.14,
"low1": 36.89,
"frames": 301,
"dropped": 0,
"delay_ms": 20.7,
"stages": {
"capture": 0.16,
"interp": 4.429,
"upscale": 1.043,
"present": 2.313
},
"load": 0.2,
"vram_mb": 22789.0,
"engine_mb": 299.89,
"seconds": 5.01,
"took_s": 13.16,
"queue_ms": 0.2,
"settled": true
}
},
"failures": [
{
"requirement": "low1",
"need": 58.2,
"got": 36.9,
"unit": "fps",
"text": "1% low 37 fps, needs 58",
"short_by": 21.3,
"short_pct": 36.6
}
],
"tried": [
{
"label": "720p, 2x (60 fps), AMD FSR 1, Half motion",
"settings": {
"interp": true,
"hz": 60,
"model": "4.22.lite",
"motion": "half",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "off"
},
"step": "the cheapest configuration that meets the minimums",
"passed": false,
"rejected": [
"1% low 37 fps, needs 58"
],
"measured": {
"fps_avg": 60.14,
"low1": 36.89,
"frames": 301,
"dropped": 0,
"delay_ms": 20.7,
"stages": {
"capture": 0.16,
"interp": 4.429,
"upscale": 1.043,
"present": 2.313
},
"load": 0.2,
"vram_mb": 22789.0,
"engine_mb": 299.89,
"seconds": 5.01,
"took_s": 13.16,
"queue_ms": 0.2,
"settled": true
}
}
],
"skipped": [],
"quality_ranking": [
"Output resolution, up to the display's own size: a smaller picture is stretched to the screen and looks softer.",
"Upscaler: NVIDIA RTX VSR (a higher level first) above AMD FSR 1.",
"Motion detail: Full above Half (Half is a little softer on small, fast details).",
"Anti-aliasing: SMAA-style above FXAA above Off.",
"Supersampling: an output bigger than the display, shrunk to it."
],
"not_ranked": "Not ranked: the AI engine (TensorRT and PyTorch draw the same frames), the interpolation model (NVIDIA's licence doesn't allow comparing VFG with RIFE), FSR sharpening and CAS (taste: kept as you set them), and Bilinear or no upscaler (FSR 1 costs about 0.1 ms and looks better, so they aren't tried).",
"rules": {
"headroom": 1.1,
"drop_limit": 0.005,
"avg_share": 0.95,
"at_target": 0.97,
"load_limit": 0.909,
"warm_s": 2.0,
"warm_restart_s": 5.0,
"measure_s": 5.0
},
"notes": [
"Summit changes only its own settings (frame generation, upscaling, anti-aliasing). It can't change the game's own graphics options."
]
}
@@ -0,0 +1,19 @@
Summit optimize: at least 720p at 60 fps; priority quality
display 1080p at 120 Hz, game 1280x720 at 30 fps
1 configurations measured in 13 s (budget 120 s, 0 restarts)
Nothing met the minimums.
1% low 37 fps, needs 58 (short by 36.6%)
Closest: 720p, 2x (60 fps), AMD FSR 1, Half motion
Tried:
FAIL 720p, 2x (60 fps), AMD FSR 1, Half motion (the cheapest configuration that meets the minimums): 1% low 37 fps, needs 58
Quality ranking:
1. Output resolution, up to the display's own size: a smaller picture is stretched to the screen and looks softer.
2. Upscaler: NVIDIA RTX VSR (a higher level first) above AMD FSR 1.
3. Motion detail: Full above Half (Half is a little softer on small, fast details).
4. Anti-aliasing: SMAA-style above FXAA above Off.
5. Supersampling: an output bigger than the display, shrunk to it.
Not ranked: the AI engine (TensorRT and PyTorch draw the same frames), the interpolation model (NVIDIA's licence doesn't allow comparing VFG with RIFE), FSR sharpening and CAS (taste: kept as you set them), and Bilinear or no upscaler (FSR 1 costs about 0.1 ms and looks better, so they aren't tried).
Note: Summit changes only its own settings (frame generation, upscaling, anti-aliasing). It can't change the game's own graphics options.
@@ -0,0 +1,280 @@
{
"format": "summit-optimize",
"version": 1,
"created": "2026-11-26T07:33:15",
"created_unix": 1795674795,
"game": null,
"goal": {
"min_resolution": "1280x720",
"min_fps": 30,
"max_delay_ms": null,
"priority": "quality",
"text": "at least 720p at 30 fps; priority quality"
},
"machine": {
"display_hz": 120.0,
"src_fps": 30,
"vsr": false,
"vfg": false,
"trt": false,
"max_mult": 10,
"motion_fixed": null,
"model_fixed": null,
"restarts": true,
"display": "1920x1080",
"source": "1280x720",
"text": "display 1080p at 120 Hz, game 1280x720 at 30 fps"
},
"budget_s": 60.0,
"elapsed_s": 70.1,
"restarts": 0,
"cancelled": false,
"error": null,
"met": true,
"top": [
{
"rank": 1,
"label": "900p, no frame generation (the game's 30 fps), AMD FSR 1",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "full",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1600x900",
"aa": "off"
},
"measured": {
"fps_avg": 59.9,
"low1": 45.76,
"frames": 300,
"dropped": 0,
"delay_ms": 29.9,
"stages": {
"capture": 15.643,
"upscale": 7.489,
"present": 2.193
},
"load": 0.45,
"vram_mb": 21443.0,
"engine_mb": 450.89,
"seconds": 5.01,
"took_s": 8.02,
"queue_ms": 22.2,
"settled": true
},
"why": "The best picture by the ranking that held the minimums (1% low 46 fps)."
},
{
"rank": 2,
"label": "720p, no frame generation (the game's 30 fps), AMD FSR 1",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "full",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "off"
},
"measured": {
"fps_avg": 60.02,
"low1": 47.82,
"frames": 300,
"dropped": 0,
"delay_ms": 5.02,
"stages": {
"capture": 0.107,
"upscale": 1.154,
"present": 2.89
},
"load": 0.07,
"vram_mb": 21443.0,
"engine_mb": 450.89,
"seconds": 5.0,
"took_s": 8.02,
"queue_ms": 0.1,
"settled": true
},
"why": "Also passed; ranked below #1 for a plainer picture."
}
],
"closest": null,
"failures": [],
"tried": [
{
"label": "720p, no frame generation (the game's 30 fps), AMD FSR 1",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "full",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1280x720",
"aa": "off"
},
"step": "the cheapest configuration that meets the minimums",
"passed": true,
"rejected": [],
"measured": {
"fps_avg": 60.02,
"low1": 47.82,
"frames": 300,
"dropped": 0,
"delay_ms": 5.02,
"stages": {
"capture": 0.107,
"upscale": 1.154,
"present": 2.89
},
"load": 0.07,
"vram_mb": 21443.0,
"engine_mb": 450.89,
"seconds": 5.0,
"took_s": 8.02,
"queue_ms": 0.1,
"settled": true
}
},
{
"label": "900p, no frame generation (the game's 30 fps), AMD FSR 1",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "full",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1600x900",
"aa": "off"
},
"step": "output resolution up to the display's",
"passed": true,
"rejected": [],
"measured": {
"fps_avg": 59.9,
"low1": 45.76,
"frames": 300,
"dropped": 0,
"delay_ms": 29.9,
"stages": {
"capture": 15.643,
"upscale": 7.489,
"present": 2.193
},
"load": 0.45,
"vram_mb": 21443.0,
"engine_mb": 450.89,
"seconds": 5.01,
"took_s": 8.02,
"queue_ms": 22.2,
"settled": true
}
},
{
"label": "1080p, no frame generation (the game's 30 fps), AMD FSR 1",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "full",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1920x1080",
"aa": "off"
},
"step": "output resolution up to the display's",
"passed": false,
"rejected": [
"frames were still queuing after the warm-up (95th percentile 1024 ms): the pipeline didn't catch up"
],
"measured": {
"fps_avg": 58.07,
"low1": 40.03,
"frames": 291,
"dropped": 0,
"delay_ms": 964.0,
"stages": {
"capture": 944.55,
"upscale": 10.51,
"present": 2.475
},
"load": 0.61,
"vram_mb": 21443.0,
"engine_mb": 450.89,
"seconds": 5.01,
"took_s": 27.02,
"queue_ms": 1024.4,
"settled": false
}
},
{
"label": "900p, no frame generation (the game's 30 fps), AMD FSR 1, FXAA",
"settings": {
"interp": false,
"hz": 60,
"model": "4.22.lite",
"motion": "full",
"engine": "auto",
"scaler": "fsr",
"vsr_quality": 2,
"output_res": "1600x900",
"aa": "fxaa"
},
"step": "anti-aliasing",
"passed": false,
"rejected": [
"frames were still queuing after the warm-up (95th percentile 6940 ms): the pipeline didn't catch up"
],
"measured": {
"fps_avg": 43.55,
"low1": 29.68,
"frames": 218,
"dropped": 0,
"delay_ms": 6447.11,
"stages": {
"capture": 6381.425,
"upscale": 10.772,
"present": 2.526
},
"load": 0.47,
"vram_mb": 21543.0,
"engine_mb": 452.98,
"seconds": 5.01,
"took_s": 27.03,
"queue_ms": 6940.3,
"settled": false
}
}
],
"skipped": [],
"quality_ranking": [
"Output resolution, up to the display's own size: a smaller picture is stretched to the screen and looks softer.",
"Upscaler: NVIDIA RTX VSR (a higher level first) above AMD FSR 1.",
"Motion detail: Full above Half (Half is a little softer on small, fast details).",
"Anti-aliasing: SMAA-style above FXAA above Off.",
"Supersampling: an output bigger than the display, shrunk to it."
],
"not_ranked": "Not ranked: the AI engine (TensorRT and PyTorch draw the same frames), the interpolation model (NVIDIA's licence doesn't allow comparing VFG with RIFE), FSR sharpening and CAS (taste: kept as you set them), and Bilinear or no upscaler (FSR 1 costs about 0.1 ms and looks better, so they aren't tried).",
"rules": {
"headroom": 1.1,
"drop_limit": 0.005,
"avg_share": 0.95,
"at_target": 0.97,
"load_limit": 0.909,
"warm_s": 2.0,
"warm_restart_s": 5.0,
"measure_s": 5.0
},
"notes": [
"Summit changes only its own settings (frame generation, upscaling, anti-aliasing). It can't change the game's own graphics options."
]
}
@@ -0,0 +1,530 @@
{
"format": 1,
"started": "2026-11-26T07:31:21",
"ended": "2026-11-26T07:33:26",
"ended_unix": 1795674806,
"game": null,
"reason": "Summit being stopped",
"duration_s": 124.6,
"benchmark": null,
"config": {
"source": "1280x720",
"model": "RIFE 4.22.lite",
"frame_generation": false,
"hz": 60,
"multiplier": "2x",
"upscaler": "FSR 1",
"look": "none",
"output": "1600x900",
"quality": "sharpness 0.5",
"settings": {
"interp": false,
"hz": 60,
"game_fps": "auto",
"model": "4.22.lite",
"vfg_quality": "medium",
"motion": "full",
"engine": "auto",
"even_out": true,
"even_dips": false,
"steady_hud": false,
"scaler": "fsr",
"fsr_sharpness": 0.5,
"vsr_quality": 2,
"aa": "off",
"output_res": "1600x900",
"fill": "fit",
"fullscreen": false,
"vsync": false,
"present": "gl",
"hdr": "off",
"look_on": false,
"look": "cinematic",
"overlay": true,
"overlay_style": "minimal",
"bar_position": "top",
"overlay_corner": "top-left",
"overlay_scale": 1.0,
"overlay_opacity": 0.8,
"overlay_colours": true,
"stats_window": 30,
"stat_fps": "auto",
"stat_game": "auto",
"stat_share": "auto",
"stat_frametime": "auto",
"stat_lows": "auto",
"stat_worst": "auto",
"stat_jitter": "auto",
"stat_drops": "auto",
"stat_stages": "auto",
"stat_delay": "auto",
"stat_gpu": "auto",
"stat_vram": "auto",
"stat_temp": "auto",
"stat_power": "auto",
"stat_cpu": "auto",
"stat_config": "auto",
"stat_cost": "auto",
"graph_frametime": true,
"graph_pipeline": true,
"graph_delay": true,
"graph_gpu": true,
"session_summary": true,
"frametime_log": false,
"ui_scale": 1.0,
"ui_opacity": 0.9,
"watermark": false,
"replay": 0,
"replay_clip": 30,
"replay_save": "smoovplay",
"replay_layout": "split",
"look_clips": false,
"capture_size": "1080p",
"minimize_chiaki": true,
"audio_sync": true,
"simulate_30": false,
"compare": false,
"compare_dim": "aa",
"compare_strips": 4,
"compare_aa_1": "off",
"compare_aa_2": "fxaa",
"compare_aa_3": "smaa",
"compare_aa_4": "cas",
"compare_scaler_1": "off",
"compare_scaler_2": "bilinear",
"compare_scaler_3": "fsr",
"compare_scaler_4": "vsr",
"compare_framegen_1": "off",
"compare_framegen_2": "on",
"compare_framegen_3": "2x",
"compare_framegen_4": "4x",
"compare_look_1": "off",
"compare_look_2": "on",
"compare_layout": "columns",
"compare_labels": true,
"compare_timings": true,
"compare_clips": false,
"opt_min_res": "1280x720",
"opt_min_fps": 30,
"opt_max_delay": 0,
"opt_priority": "quality",
"opt_budget": 60
}
},
"frames": {
"presented": 6864,
"generated": 776,
"real": 6088,
"generated_share_pct": 11.3,
"dropped": 0,
"repeated": 0,
"late": 423,
"stalls": 0,
"game_frames": 3432,
"game_fps_avg": 30.0
},
"fps_avg": 55.1,
"frametime": {
"avg_ms": 18.16,
"p99_ms": 40.17,
"worst_ms": 1165.4,
"low1_fps": 12.7,
"low01_fps": 3.0,
"jitter_ms": 5.13
},
"stages": {
"capture": {
"avg_ms": 1450.357,
"p95_ms": 7848.541,
"worst_ms": 10712.833,
"n": 6863
},
"interp": {
"avg_ms": 6.274,
"p95_ms": 5.992,
"worst_ms": 28.403,
"n": 776
},
"upscale": {
"avg_ms": 6.721,
"p95_ms": 13.761,
"worst_ms": 52.709,
"n": 6863
},
"present": {
"avg_ms": 2.628,
"p95_ms": 3.743,
"worst_ms": 42.424,
"n": 6863
}
},
"delay": {
"median_ms": 65.7,
"p95_ms": 7888.3,
"max_ms": 10730.3,
"n": 3433
},
"system": {
"cpu_avg_pct": 47.3,
"cpu_max_pct": 92.4,
"gpu_util_avg_pct": 18.4,
"gpu_util_max_pct": 100.0,
"gpu_temp_max_c": 57.0,
"gpu_power_avg_w": 140.8,
"vram_max_mb": 21543.0,
"vram_total_mb": 24576.0,
"samples": 134
},
"changes": [
{
"key": "interp",
"label": "Frame generation",
"from": "On",
"to": "Off",
"before": {
"fps": 60.0,
"frametime_ms": 16.67,
"low1_fps": 34.5,
"worst_ms": 37.4,
"late": 17,
"frames": 360
},
"after": {},
"at_s": 13.1
},
{
"key": "output_res",
"label": "Output resolution",
"from": "Same as the screen",
"to": "720p",
"before": {
"fps": 60.0,
"frametime_ms": 16.67,
"low1_fps": 34.5,
"worst_ms": 37.4,
"late": 17,
"frames": 360
},
"after": {},
"at_s": 13.1
},
{
"key": "aa",
"label": "Anti-aliasing",
"from": "CAS sharpen",
"to": "Off",
"before": {
"fps": 60.0,
"frametime_ms": 16.67,
"low1_fps": 34.5,
"worst_ms": 37.4,
"late": 17,
"frames": 360
},
"after": {
"fps": 60.0,
"frametime_ms": 16.67,
"low1_fps": 49.5,
"worst_ms": 20.9,
"late": 0,
"frames": 360
},
"at_s": 13.1
},
{
"key": "output_res",
"label": "Output resolution",
"from": "720p",
"to": "900p",
"before": {
"fps": 60.0,
"frametime_ms": 16.67,
"low1_fps": 49.5,
"worst_ms": 20.9,
"late": 0,
"frames": 360
},
"after": {
"fps": 59.9,
"frametime_ms": 16.7,
"low1_fps": 47.7,
"worst_ms": 22.1,
"late": 0,
"frames": 359
},
"at_s": 21.1
},
{
"key": "output_res",
"label": "Output resolution",
"from": "900p",
"to": "1080p",
"before": {
"fps": 59.9,
"frametime_ms": 16.7,
"low1_fps": 48.7,
"worst_ms": 21.0,
"late": 0,
"frames": 360
},
"after": {
"fps": 56.0,
"frametime_ms": 17.85,
"low1_fps": null,
"worst_ms": 39.5,
"late": 2,
"frames": 68
},
"at_s": 29.2
},
{
"key": "interp",
"label": "Frame generation",
"from": "Off",
"to": "On",
"before": {
"fps": 58.8,
"frametime_ms": 17.01,
"low1_fps": 31.3,
"worst_ms": 39.5,
"late": 3,
"frames": 353
},
"after": {},
"at_s": 31.4
},
{
"key": "output_res",
"label": "Output resolution",
"from": "1080p",
"to": "Same as the screen",
"before": {
"fps": 58.8,
"frametime_ms": 17.01,
"low1_fps": 31.3,
"worst_ms": 39.5,
"late": 3,
"frames": 353
},
"after": {},
"at_s": 31.4
},
{
"key": "aa",
"label": "Anti-aliasing",
"from": "Off",
"to": "CAS sharpen",
"before": {
"fps": 58.8,
"frametime_ms": 17.01,
"low1_fps": 31.3,
"worst_ms": 39.5,
"late": 3,
"frames": 353
},
"after": {
"fps": 60.0,
"frametime_ms": 16.67,
"low1_fps": 18.1,
"worst_ms": 62.1,
"late": 19,
"frames": 360
},
"at_s": 31.4
},
{
"key": "interp",
"label": "Frame generation",
"from": "On",
"to": "Off",
"before": {
"fps": 62.3,
"frametime_ms": 16.05,
"low1_fps": 36.1,
"worst_ms": 30.0,
"late": 12,
"frames": 374
},
"after": {},
"at_s": 43.6
},
{
"key": "output_res",
"label": "Output resolution",
"from": "Same as the screen",
"to": "720p",
"before": {
"fps": 62.3,
"frametime_ms": 16.05,
"low1_fps": 36.1,
"worst_ms": 30.0,
"late": 12,
"frames": 374
},
"after": {},
"at_s": 43.6
},
{
"key": "aa",
"label": "Anti-aliasing",
"from": "CAS sharpen",
"to": "Off",
"before": {
"fps": 62.3,
"frametime_ms": 16.05,
"low1_fps": 36.1,
"worst_ms": 30.0,
"late": 12,
"frames": 374
},
"after": {
"fps": 60.0,
"frametime_ms": 16.67,
"low1_fps": 47.8,
"worst_ms": 21.2,
"late": 0,
"frames": 360
},
"at_s": 43.6
},
{
"key": "output_res",
"label": "Output resolution",
"from": "720p",
"to": "900p",
"before": {
"fps": 60.0,
"frametime_ms": 16.67,
"low1_fps": 47.6,
"worst_ms": 21.2,
"late": 0,
"frames": 360
},
"after": {
"fps": 59.8,
"frametime_ms": 16.72,
"low1_fps": 44.3,
"worst_ms": 24.8,
"late": 0,
"frames": 359
},
"at_s": 51.6
},
{
"key": "output_res",
"label": "Output resolution",
"from": "900p",
"to": "1080p",
"before": {
"fps": 59.9,
"frametime_ms": 16.7,
"low1_fps": 46.3,
"worst_ms": 23.5,
"late": 0,
"frames": 360
},
"after": {
"fps": 57.5,
"frametime_ms": 17.38,
"low1_fps": 36.1,
"worst_ms": 30.4,
"late": 5,
"frames": 346
},
"at_s": 59.6
},
{
"key": "output_res",
"label": "Output resolution",
"from": "1080p",
"to": "900p",
"before": {
"fps": 58.0,
"frametime_ms": 17.23,
"low1_fps": 39.9,
"worst_ms": 27.5,
"late": 1,
"frames": 349
},
"after": {},
"at_s": 86.6
},
{
"key": "aa",
"label": "Anti-aliasing",
"from": "Off",
"to": "FXAA",
"before": {
"fps": 58.0,
"frametime_ms": 17.23,
"low1_fps": 39.9,
"worst_ms": 27.5,
"late": 1,
"frames": 349
},
"after": {
"fps": 46.3,
"frametime_ms": 21.61,
"low1_fps": 2.0,
"worst_ms": 1165.4,
"late": 4,
"frames": 292
},
"at_s": 86.6
},
{
"key": "aa",
"label": "Anti-aliasing",
"from": "FXAA",
"to": "Off",
"before": {
"fps": 42.4,
"frametime_ms": 23.58,
"low1_fps": 27.6,
"worst_ms": 37.5,
"late": 87,
"frames": 255
},
"after": {
"fps": 35.6,
"frametime_ms": 28.09,
"low1_fps": 11.6,
"worst_ms": 130.4,
"late": 104,
"frames": 214
},
"at_s": 113.7
}
],
"stats_cost": {
"per_frame_us": 6.8,
"per_snapshot_ms": 0.983
},
"notes": [],
"headroom": {
"state": "room",
"load_pct": 41,
"display_hz": 120.0,
"output_fps": 30,
"suggestions": [
{
"key": "hz",
"value": 60,
"text": "A higher multiplier: 60 fps on this 120 Hz display."
},
{
"key": "output_res",
"value": "1920x1080",
"text": "Output at the display's own size (1080p) instead of stretching 900p."
},
{
"key": "aa",
"value": "smaa",
"text": "SMAA-style anti-aliasing: smoother edges."
}
],
"line": "This display is 120 Hz and the pipeline uses 41% of its frame budget: 3 changes could improve the picture (Optimize tab).",
"short": "41% busy at 120 Hz: room for a better picture",
"note": "Suggestions only; nothing is changed without you. Estimates: Optimize measures."
}
}
+85
View File
@@ -0,0 +1,85 @@
# Optimize: result file format (for the launcher)
The engine's Optimize (`engine/framegen/optimize.py`) writes one JSON file per run:
* `<data dir>/optimize/summit-optimize-<YYYYmmdd-HHMMSS>.json`, and the same content as `<data dir>/optimize/latest.json`.
`<data dir>` is `oslayer.data_dir()`: `$XDG_DATA_HOME/smoovplay` (`~/.local/share/smoovplay`) on Linux, the settings folder on
Windows. The folder sits next to `sessions/`, not inside it, because the launcher reads every `.json` in `sessions/` as a
session summary.
* With `--results FILE`: the same JSON also as `FILE` with a `.json` suffix, and the text report (`format_text`) in `FILE`.
* `python -m framegen.settings` prints, under `"optimize"`: the `--optimize` grammar, the priorities, `format`, `version`,
`dir` and `latest` (the paths on this machine) and the quality ranking.
A run that was cancelled also writes a file (`"cancelled": true`).
## Starting a run
* Command line: `run.py <file or source> --display --optimize "min=1920x1080@60,priority=quality[,delay=50][,display=2560x1440@144]" [--optimize-budget SECONDS] [--results FILE]`.
Priorities: `fps`, `resolution`, `quality`, `delay`. `display=` stands in for the real screen (its size and refresh rate set the
ceiling). The engine shows the countdown, then the card for `--result-card` seconds (default 8), then exits.
Enter on the card applies and saves #1; Esc closes it.
* In a session: the overlay's **Optimize** tab (its settings `opt_min_res`, `opt_min_fps`, `opt_max_delay`, `opt_priority`,
`opt_budget` are in the registry like any other), row **Find my settings**. Through `--control` (stdin): `optimize`,
`optimize-cancel`, `optimize-apply`, plus `set opt_... <value>` to choose the inputs first. When a run ends, the engine prints
`[optimize] result -> <path>`.
## The file (`format: "summit-optimize"`, `version: 1`)
```jsonc
{
"format": "summit-optimize", "version": 1, // check both; a later version adds fields, never renames
"created": "2026-11-26T07:21:42", "created_unix": 1795670502,
"game": "Voidrunner" | null, // SUMMIT_GAME, as the launcher sets it
"goal": {"min_resolution": "1280x720", "min_fps": 30, "max_delay_ms": null, "priority": "fps", "text": "..."},
"machine": {"display": "1920x1080", "display_hz": 120.0, "source": "1280x720", "src_fps": 30,
"vsr": false, "vfg": false, "trt": false, "max_mult": 10, "motion_fixed": null, "model_fixed": null,
"restarts": true, "text": "..."},
"budget_s": 150.0, "elapsed_s": 70.4, "restarts": 0, "cancelled": false, "error": null,
"met": true, // false: nothing held the minimums (see failures, closest)
"top": [ // best first, at most 3; [] when met is false
{"rank": 1, "label": "720p, 2x (60 fps), AMD FSR 1, ...",
"settings": {"interp": true, "hz": 60, "model": "4.22.lite", "motion": "half", "engine": "auto",
"scaler": "fsr", "vsr_quality": 2, "output_res": "1280x720", "aa": "off"},
"measured": {"fps_avg": 60.0, "low1": 37.1, "frames": 300, "dropped": 0, "delay_ms": 22.0,
"stages": {"capture": 0.2, "interp": 4.5, "upscale": 1.1, "present": 2.4}, // average ms
"load": 0.24, // share of the time the pipeline worked (AI frames + upscaler + look)
"vram_mb": 22789, // the whole card's memory in use, all programs (nvidia-smi), or null
"engine_mb": 300, // what this engine had reserved (PyTorch), or null
"seconds": 5.0, "took_s": 13.3, "queue_ms": 0.1, "settled": true},
"why": "The highest frame rate that held: ..."}
],
"closest": null | {"label": "...", "settings": {...}, "measured": {...}}, // when met is false
"failures": [ {"requirement": "low1", "need": 58.2, "got": 37.0, "unit": "fps", "text": "1% low 37 fps, needs 58",
"short_by": 21.2, "short_pct": 36.4} ], // the closest one's, when met is false
"tried": [ {"label": "...", "settings": {...}, "step": "a higher frame multiplier", "passed": false,
"rejected": ["dropped 4 frames (0.9%)"], "measured": {...}} ], // in the order measured
"skipped": [ {"label": "...", "settings": {...}, "why": "...", "reason": "at least as heavy as ..., which failed"} ],
"quality_ranking": ["Output resolution, up to the display's own size ...", "..."], "not_ranked": "...",
"rules": {"headroom": 1.1, "drop_limit": 0.005, "avg_share": 0.95, "at_target": 0.97, "load_limit": 0.909,
"warm_s": 2.0, "warm_restart_s": 5.0, "measure_s": 5.0},
"notes": ["...", "Summit changes only its own settings ... can't change the game's own graphics options."]
}
```
**Applying a result**: `top[i].settings` holds all nine engine settings Optimize chooses (`interp`, `hz`, `model`, `motion`,
`engine`, `scaler`, `vsr_quality`, `output_res`, `aa`), each a valid registry value (`run.py --set KEY=VALUE` takes them, and so
does a profile's `[engine]` table). Every other setting stays as the user has it. `model`, `motion` and `engine` take effect after a
restart of the pipeline. Values that don't apply in that configuration are copied from the settings in use when the run started
(e.g. `hz` with `interp: false`, `vsr_quality` with FSR).
## How a candidate passes (`judge`)
* The 1% low (mean of the slowest 1% of frametimes, at least 100 frames) clears the minimum by 10%. When the display's
refresh rate leaves no room for that (a 60 Hz screen and 60 fps asked for), the 1% low must reach 97% of the target and
the pipeline must be at most ~91% busy.
* The average reaches 95% of the rate the multiplier makes; at most 0.5% of frames dropped.
* The added delay (median, Summit's own) is under `max_delay_ms` when one is given.
* The queue had drained before measuring (`settled`). After a change the engine waits 2 s (5 s after a restart), and then until
no frame has queued 50 ms for a whole second (at most 20 s more). Each candidate is then measured for 5 s.
## Headroom (no run)
Session summaries (`sessions/summit-session-*.json`) get a `"headroom"` object: `state` (`room`, `fits`, `behind`, `unknown`),
`load_pct`, `display_hz`, `output_fps`, `suggestions` (each `{"key", "value", "text", "set": {every setting the change needs}}`),
`line` (the overlay's message), `short` and `note`. These are suggestions only: nothing is applied. The `load` is worked out from the stage
times, so it is an estimate. Optimize is what measures.
+47
View File
@@ -713,6 +713,8 @@ class GLWindowSink:
print(f"[display] upscaling with {self._name(self.mode)}{details[self.mode]}; u cycles "
+ " / ".join(self._name(m) for m in self.modes))
self.collector = None # framegen.stats.Collector (run.py sets it): the stage times go there
self.optimizer = None # framegen/optimize.py Control (run.py sets it): its countdown and result card are drawn
self._opt_panel, self._opt_state = None, None
self._cfg_seen, self._vsr_seen = None, 0
self.timer = GpuTimer(GL, on_sample=self._gl_sample) # GPU time of the scale/draw step, reported on close
self.look_timer = GpuTimer(GL, on_sample=lambda label, ms: self._stage("look", ms)) # ...and of the look
@@ -1499,6 +1501,14 @@ class GLWindowSink:
time.sleep(0.03)
panel.close()
def display_mode(self) -> tuple[int, int, float] | None:
"""The monitor fullscreen goes to (pick_monitor): its own width, height and refresh rate. None if unknown."""
try:
mode = self.glfw.get_video_mode(pick_monitor(self.glfw))
return mode.size.width, mode.size.height, float(mode.refresh_rate)
except Exception: # noqa: BLE001
return None
def toast(self, text: str, seconds: float = 2.0) -> None:
"""A short message in the top-right corner."""
self._toast_text, self._toast_until = text, time.perf_counter() + seconds
@@ -1515,6 +1525,9 @@ class GLWindowSink:
self.cmd = r
elif r in ("save_replay", "save_summary"):
self.cmd = r
elif r and r.startswith("optimize"): # the Optimize tab (framegen/optimize.py, through the pipeline)
self.menu.open = False
self.cmd = r
def _do(self, action: str) -> None:
"""What the keys do, by name: the window's own (_on_key) and the system-wide ones over a game (_events)."""
@@ -1557,6 +1570,13 @@ class GLWindowSink:
if action == glfw.PRESS:
self._do("menu")
return
o = self.optimizer.state() if self.optimizer is not None and not self.menu.open else "idle"
if o != "idle" and key in (glfw.KEY_ESCAPE, glfw.KEY_BACKSPACE): # Optimize: stop, or keep my settings
self.cmd = "optimize_cancel"
return
if o == "card" and key in (glfw.KEY_ENTER, glfw.KEY_KP_ENTER): # Optimize's card: Apply
self.cmd = "optimize_apply"
return
if in_menu:
name = ("prev_tab" if mods & glfw.MOD_SHIFT else "next_tab") if key == glfw.KEY_TAB else nav[key]
self._menu_result(self.menu.key(name))
@@ -1691,6 +1711,33 @@ class GLWindowSink:
self._toast_state = state
p = self.toast_panel
p.blit(x0 + max(0, (dw - p.w) // 2), y0 + dh - int(16 * ui), self._target())
self._draw_optimizer(x0, y0, dw, dh, ui, op)
def _draw_optimizer(self, x0: int, y0: int, dw: int, dh: int, ui: float, op: float) -> None:
"""Optimize (framegen/optimize.py): its countdown and candidate at the top while it runs; its result card in
the middle once done (Enter applies, Esc keeps the player's settings; also on the overlay's Optimize tab)."""
o = self.optimizer
if o is None or self.menu.open:
return
banner, result = o.banner(), o.result()
if banner is None and result is None:
return
from . import optimize as opt
state = (banner, id(result), round(ui, 3), op)
if self._opt_panel is None:
self._opt_panel = _Panel(self.GL, self.hdr10)
if state != self._opt_state:
if banner is not None:
from .hud import toast
self._opt_panel.update_rgba(toast(banner, ui, op))
else:
self._opt_panel.update_rgba(opt.card_image(result, ui, max(op, 0.92), o.runner.saved_to))
self._opt_state = state
p = self._opt_panel
if banner is not None: # top middle, below where messages go
p.blit(x0 + max(0, (dw - p.w) // 2), y0 + dh - int(96 * ui), self._target())
else: # in the middle (its top kept in the picture)
p.blit(x0 + max(0, (dw - p.w) // 2), y0 + min(dh, (dh + p.h) // 2), self._target())
def busy(self, fn, text: str):
"""Run fn() on a worker thread while the window stays responsive, showing the last frame and `text`.
+19 -1
View File
@@ -45,7 +45,16 @@ ACTION_HELP = {
"summary": "Writes this session's numbers so far (averages, lows, the time of each stage, the settings and what "
"changed) to a .json and a .txt file in Summit's data folder, and shows where. Summit also does it when "
"it stops.",
# framegen/optimize.py, on the Optimize tab
"optimize": "Tries Summit's own settings one after another for a few seconds each (with a countdown at the top) and "
"keeps the best that holds your minimums, by your priority. Only Summit's settings change, never the "
"game's own graphics options. Your settings come back exactly if you stop it.",
"optimize_cancel": "Stops and puts your settings back exactly as they were.",
"optimize_apply": "Keeps the best result shown on the card and saves it as your settings.",
}
OPTIMIZE_ROWS = {"idle": (("optimize", "Find my settings"),),
"running": (("optimize_cancel", "Stop optimizing"),),
"card": (("optimize_apply", "Apply the result"), ("optimize_cancel", "Keep my settings"))}
QUIT_HELP = "Closes Summit's picture. A game started from Summit's launcher is closed with it."
@@ -100,6 +109,8 @@ class Menu:
self._hover: tuple | None = None # ("tab", i), ("close",): what the mouse is over, besides rows
self._hit: dict = {} # render()'s layout in the image's pixels, for the mouse
self._drawn: tuple = (None, None) # render()'s last picture and what it showed (see there)
self.optimizer_state: Callable[[], str] | None = None # framegen/optimize.py Control.state, when it can run
self.optimizer_note: Callable[[], str] = lambda: "" # its headroom line, beside Find my settings
@property
def open(self) -> bool:
@@ -142,6 +153,8 @@ class Menu:
rows.append(Row("header", "#" + s.sub, s.sub))
sub = s.sub
rows.append(Row("setting", s.key, s.label, s))
if tab == "Optimize" and self.optimizer_state is not None:
rows += [Row("action", k, label) for k, label in OPTIMIZE_ROWS.get(self.optimizer_state(), ())]
if self.restart_reasons():
rows.append(Row("action", "restart", "Restart now"))
if tab is None:
@@ -273,6 +286,8 @@ class Menu:
return "save_replay"
if row.key == "summary":
return "save_summary"
if row.key.startswith("optimize"):
return row.key
if self.armed:
self.armed = False
return "quit"
@@ -557,7 +572,8 @@ class Menu:
return (self.tab, self.focus, self.index, self._scroll, self.armed, self._hover, self.title, self.toggle_key,
self._drop, self._drop_index, self._drop_scroll, self._drag and self._drag[0],
tuple(self.settings.values().items()), tuple(self.restart_reasons()),
tuple(self.disabled(s.key) for s in self.specs))
tuple(self.disabled(s.key) for s in self.specs),
self.optimizer_state and self.optimizer_state(), self.optimizer_note())
def state(self) -> tuple:
"""Everything the drawing depends on (the window redraws only when this changes)."""
@@ -655,6 +671,8 @@ class Menu:
label = again if danger and self.armed else row.label
colour = U.BAD if danger else U.ACCENT
c.text(pad + px(8), mid, label, f_label, colour)
if row.key == "optimize" and self.optimizer_note():
c.text(xr, mid, U.fit(self.optimizer_note(), f_small, px(430)), f_small, U.DIM, "rm")
if row.key == "restart":
note = "Applies: " + ", ".join(self.restart_reasons())
c.text(xr, mid, U.fit(note, f_small, px(430)), f_small, U.DIM, "rm")
File diff suppressed because it is too large. Load diff
+8
View File
@@ -353,6 +353,7 @@ class Pipeline:
self.stats: Stats | None = None # the running session's, for reports written while it plays
self.beat = time.perf_counter() # when run()'s loop last went round (run.py's watchdog reads it)
self.waiting = None # the source's Waiting while no frame is coming, else None (the watchdog reads it too)
self.driver = None # framegen/optimize.py Control: stepped once a tick; it may ask for a restart or the end
def run(self, source, sink=None, enabled: bool = True, score: bool = False, label: str = "",
on_tick=None, hz: int = 60, settings=None, gt=None, remote=None, replay=None,
@@ -550,6 +551,11 @@ class Pipeline:
if tick.t_arrival < t_start: # queued while the previous session was restarting: show live frames only
st.stale += 1
continue
if self.driver is not None: # Optimize (framegen/optimize.py): may change settings, picked up just below
d_cmd = self.driver.step(time.perf_counter())
if d_cmd in ("quit", "restart"):
st.exit = d_cmd
break
if settings is not None: # changed in the menu (or by a hotkey) since the last tick?
# The multiplier N is settings.hz / 30: N frames for each real one, so a 60 fps game shows 60 x N
want_hz = min(600, settings.hz * (2 if game60 else 1)) if sink is not None else 60
@@ -878,6 +884,8 @@ class Pipeline:
st.exit = "end"
break
if sink is not None:
if cmd and cmd.startswith("optimize") and self.driver is not None: # the overlay's Optimize tab
cmd = self.driver.command(cmd)
if cmd in ("quit", "restart"):
st.exit = cmd
break
+3
View File
@@ -9,6 +9,9 @@ The launcher writes one command per line to our stdin:
look-show <look JSON> show this look (the Looks page is editing it), whatever the Look settings say
look-hide back to the Look settings' look
looks-reload the user's looks changed on disk: read them again (the list of looks is in the state)
optimize start Optimize with the Optimize tab's settings (framegen/optimize.py; run.py adds it)
optimize-cancel stop it, or close its result, putting the settings back
optimize-apply keep its best result and save it
and reads a `[settings-state] {json}` line on our stdout at the start of every session and after every change,
whoever made it (this link, the menu or a hotkey): the current values, which choices can be picked right now,
+30
View File
@@ -585,6 +585,30 @@ def _laid_out(specs: tuple[Spec, ...]) -> tuple[Spec, ...]:
return tuple(out) + tuple(s for s in specs if s.key not in placed)
# framegen/optimize.py: what the overlay's Optimize tab asks for (its run itself is the "Find my settings" row). Kept
# in specs_json too (the launcher may start a run with them); the --optimize grammar is under "optimize" there.
OPTIMIZE_SPECS = (
Spec("opt_min_res", "Minimum resolution", ("1280x720", "1600x900", "1920x1080", "2560x1440", "3840x2160"),
"1920x1080", OUTPUT_NAMES, group="Optimize", sub="Your minimums",
help="The smallest output Optimize may pick. It never goes below this, whatever your priority."),
Spec("opt_min_fps", "Minimum frame rate", (30, 60, 90, 120, 144, 165, 240), 60,
{v: f"{v} fps" for v in (30, 60, 90, 120, 144, 165, 240)}, group="Optimize", sub="Your minimums",
help="Frames a second on screen that Optimize must hold, judged by the 1% low (the slowest frames) with "
"about 10% to spare, not the average. More than your display's refresh rate can't be shown."),
Spec("opt_max_delay", "Most added delay", (0, 30, 40, 50, 70, 100), 0,
{0: "No limit", **{v: f"{v} ms" for v in (30, 40, 50, 70, 100)}}, group="Optimize", sub="Your minimums",
help="The most delay Summit itself may add (frame generation adds some). No limit: not checked."),
Spec("opt_priority", "Priority", ("fps", "resolution", "quality", "delay"), "quality",
{"fps": "Frame rate", "resolution": "Resolution", "quality": "Quality", "delay": "Lowest delay"},
group="Optimize", sub="Then improve",
help="Once your minimums hold, what Optimize raises as far as it goes. Quality follows a fixed ranking: the "
"display's own resolution, then RTX VSR over FSR 1, then Full motion detail, then anti-aliasing. Only "
"Summit's settings are tried: Summit can't change the game's own graphics options."),
Spec("opt_budget", "Time to spend", (60, 120, 180, 300), 120,
{60: "1 minute", 120: "2 minutes", 180: "3 minutes", 300: "5 minutes"}, group="Optimize", sub="Then improve",
help="How long Optimize may take. Each try takes about 7 seconds, one that restarts the pipeline about 20."),
)
SPECS = SPECS + OPTIMIZE_SPECS
SPECS = _laid_out(SPECS)
BY_KEY = {s.key: s for s in SPECS}
@@ -669,6 +693,11 @@ class Settings:
print(f"[settings] couldn't save {self.path}: {e}")
def _optimize_registry() -> dict:
from . import optimize
return optimize.registry()
def specs_json(specs: tuple[Spec, ...] = SPECS) -> dict:
"""The registry for the launcher's Settings page: every setting with its choices in display order, and where the
saved file is. Values are JSON types; the launcher sends a choice back exactly as given here."""
@@ -685,6 +714,7 @@ def specs_json(specs: tuple[Spec, ...] = SPECS) -> dict:
"choices": [{"value": v, "name": s.name(v), "hint": s.hints.get(v, "")} for v in s.choices]}
for s in specs],
"compare": compare.registry(), # --compare's dimensions and choices (framegen/compare.py)
"optimize": _optimize_registry(), # --optimize's grammar and where its results go (framegen/optimize.py)
}
+101 -4
View File
@@ -379,6 +379,14 @@ def main() -> int:
"write the session summary (JSON and a text table, in Summit's data folder, or beside --results) "
"and show a result card for a few seconds. A video file is played in real time and repeated if "
"it is shorter.")
ap.add_argument("--optimize", metavar="GOAL", default=None,
help='find settings: "min=1920x1080@60,priority=quality" (priority: fps, resolution, quality or '
'delay; optional delay=MS, the most added delay, and display=WxH@HZ instead of the real '
"screen). Tries Summit's own settings a few seconds each, then shows the best 3 on a card and "
"writes them to Summit's data folder (optimize/, docs/optimizer.md), and beside --results. "
"Needs --display (or --out, 60 fps only). A video file is played in real time and repeated")
ap.add_argument("--optimize-budget", metavar="SECONDS", type=float, default=None,
help="how long --optimize may take (default 120)")
ap.add_argument("--result-card", metavar="SECONDS", type=float, default=8.0,
help="how long --benchmark's result card stays on screen (default 8; 0 for none)")
ap.add_argument("--frametime-log", metavar="CSV", nargs="?", const="auto", default=None,
@@ -392,6 +400,17 @@ def main() -> int:
ap.error("--benchmark SECONDS: more than 0")
if a.benchmark and not (a.display or a.display_cv or a.out):
ap.error("--benchmark counts frames as they are shown: add --display (or --out FILE to run without a window)")
opt_goal = None
if a.optimize is not None:
from framegen import optimize as opt_lib
try:
opt_goal = opt_lib.parse_goal(a.optimize)
except ValueError as e:
ap.error(f"--optimize: {e}")
if not (a.display or a.out) or a.display_cv:
ap.error("--optimize measures frames as they are shown: add --display (or --out FILE, 60 fps only)")
if a.benchmark:
ap.error("--optimize and --benchmark: one at a time")
if a.output_res is not None and a.output_res != "screen" and parse_res(a.output_res) is None:
ap.error(f"--output-res {a.output_res}: a size like 2560x1440 (320x240 to 7680x4320), or 'screen'")
if a.hz is not None and not valid_hz(a.hz):
@@ -419,7 +438,7 @@ def main() -> int:
a.chiaki_decoder = "d3d11va"
kind = a.source or ("chiaki" if a.chiaki else "capture" if a.capture is not None else "file" if a.video else None)
if a.benchmark and kind == "file":
if (a.benchmark or a.optimize) and kind == "file":
a.realtime = True # a benchmark plays a file the way a game would arrive, not as fast as it can be read
picked = kind # as asked for: an app's compressed frames on the tap become "chiaki" below, without chiaki-ng
# Test mode ("Simulate a 30 fps game") works with any 60 Hz source; a video file simulates a PS5 by itself
@@ -782,7 +801,12 @@ def main() -> int:
def save_summary(reason: str) -> str:
"""The session so far as summit-session-<time>.json and .txt (the same two files each time this run)."""
try:
j, t = stat_lib.write_summary(coll.summary(reason=reason, settings=settings.values()), stats_dir, session_base)
summ = coll.summary(reason=reason, settings=settings.values())
try: # framegen/optimize.py: room to spare, or falling behind (suggestions only)
summ["headroom"] = opt_headroom(summ)
except Exception as e: # noqa: BLE001
print(f"[optimize] no headroom check: {e}")
j, t = stat_lib.write_summary(summ, stats_dir, session_base)
except OSError as e:
print(f"[stats] couldn't write the summary: {e}")
return f"Couldn't save the summary: {e}"
@@ -792,11 +816,83 @@ def main() -> int:
coll.save_hook = save_summary
settings.watch(model_rows) # before Remote's own watcher, so what it publishes is already up to date
model_rows()
# Optimize (framegen/optimize.py): --optimize, or the overlay's Optimize tab. The machine as this session sees it.
from framegen import optimize as opt_lib
def opt_machine():
shown = window.display_mode() if isinstance(window, GLWindowSink) else None
if opt_goal is not None and opt_goal[1] is not None:
(dw, dh), dhz = opt_goal[1]
elif shown is not None:
dw, dh, dhz = shown
else:
dw, dh, dhz = 1920, 1080, 60.0
if settings.game_fps in ("30", "60"):
game = int(settings.game_fps)
elif kind == "file" and not a.raw:
game = 60 if a.sim60 else 30 # Ps5SimSource plays the file as a 30 (or 60) fps game
else: # as measured so far (the game's new frames in 60 ticks a second)
g = coll.real_input / (coll.ticks_input / 60.0) if coll.ticks_input > 120 else 30.0
game = 60 if g > 45 else 30
return opt_lib.Machine(
display=(int(dw), int(dh)), display_hz=float(dhz), source=(src.w, src.h), src_fps=game,
vsr=isinstance(window, GLWindowSink) and "vsr" in window.modes,
vfg=not vfg_why[0] and not dml_mode and test_model is None, trt=has_trt and not dml_mode,
max_mult=2 if a.out else 10, motion_fixed=settings.motion if a.scale is not None else None,
model_fixed=settings.model if test_model else None)
def opt_headroom(summ: dict) -> dict:
return opt_lib.headroom_of_summary(summ, opt_machine())
def opt_saved(result: dict) -> str:
path = opt_lib.write_result(result)
print(opt_lib.format_text(result), flush=True)
print(f"[optimize] result -> {path}", flush=True)
if a.results:
try:
Path(a.results).with_suffix(".json").write_text(json.dumps(result, indent=2), encoding="utf-8")
Path(a.results).write_text(opt_lib.format_text(result) + "\n", encoding="utf-8")
print(f"[optimize] result -> {a.results} and its .json", flush=True)
except OSError as e:
print(f"[optimize] couldn't write {a.results}: {e}")
return str(path)
def opt_engine_mb():
return torch.cuda.memory_reserved() / 1e6 if torch.cuda.is_available() else None
def opt_runner():
if opt_goal is not None and opt_control.cli:
goal = opt_goal[0]
budget = a.optimize_budget or opt_lib.DEFAULT_BUDGET_S
else:
goal = opt_lib.Goal(parse_res(settings.opt_min_res), settings.opt_min_fps,
float(settings.opt_max_delay) or None, settings.opt_priority)
budget = float(settings.opt_budget)
m = opt_machine()
print(f"[optimize] {goal.text()}; {m.text()}; budget {budget:.0f} s", flush=True)
return opt_lib.Runner(opt_lib.Search(goal, m, budget), settings, coll, lambda: bool(restart_reasons()),
engine_mb=opt_engine_mb, on_result=opt_saved,
card_s=max(0.0, a.result_card) if opt_control.cli else None)
opt_control = opt_lib.Control(
opt_runner, (lambda now: opt_lib.headroom_live(coll, now, settings.values(), opt_machine()))
if sink.sinks else None)
opt_control.cli = opt_goal is not None
if opt_control.cli:
opt_control.start_pending = True
if isinstance(window, GLWindowSink):
window.optimizer = opt_control
opt_control.toast = window.toast
window.menu.optimizer_state = opt_control.state
window.menu.optimizer_note = lambda: (opt_control.head or {}).get("short", "")
remote = None
if a.control and isinstance(window, GLWindowSink):
from framegen.remote import Remote
window.remote = remote = Remote(settings, window.allowed, window.disabled, restart_reasons,
handlers=window.remote_commands())
handlers={**window.remote_commands(), **{ # Optimize (framegen/optimize.py)
c: (lambda _t, c=c: setattr(window, "cmd", c.replace("-", "_")))
for c in ("optimize", "optimize-cancel", "optimize-apply")}})
hidden: list[int] = []
# Outside Windows a program can't minimise another's windows (Wayland forbids it), so chiaki-ng is asked through
@@ -947,7 +1043,7 @@ def main() -> int:
if sink.sinks:
threading.Thread(target=watchdog, name="watchdog", daemon=True).start()
if a.benchmark and kind == "file": # a clip shorter than the benchmark plays again
if (a.benchmark or a.optimize) and kind == "file": # a clip shorter than the benchmark plays again
def looped(first):
cur = first
while True:
@@ -993,6 +1089,7 @@ def main() -> int:
coll.notes.append(PRIVATE_RESULTS)
pipe = Pipeline(interp, make_detector(src.info, a.dup_threshold))
pipe.compare = compare_live
pipe.driver = opt_control
live[:] = [pipe, cfg]
stats = pipe.run(ticks, sink if sink.sinks else None, score=a.score, label=label,
on_tick=getattr(src, "log_tick", None), settings=settings,
+377
View File
@@ -0,0 +1,377 @@
"""framegen/optimize.py: the search, the verdict, the result file, the live runner and the headroom check, with a fake
measurer (a made-up cost model, no GPU, no window)."""
from __future__ import annotations
import json
import pytest
from framegen import optimize as O
from framegen import stats as S
from framegen.settings import BY_KEY, Settings
# ---- a fake PC: cost of a configuration in ms of work per second --------------------------------------------------------
def fake_cost(c: O.Candidate, m: O.Machine, speed: float = 1.0) -> float:
target = c.fps(m.src_fps)
gen_per_s = m.src_fps * (c.mult - 1)
ai = {"vfg": 7.0}.get(c.model, 10.0 if c.motion == "full" else 6.0) * (0.88 if c.engine == "trt" else 1.0)
mp = O.px(c.out) / 2.07e6
up = (0.1 if c.scaler == "fsr" else 0.8 + 0.4 * c.vsr_q) * mp
aa = {"off": 0.0, "fxaa": 0.3, "smaa": 0.8}[c.aa] * mp
return (ai * gen_per_s + (up + aa) * target) / speed
def fake_measure(m: O.Machine, speed: float = 1.0, log: list | None = None, seconds: float = 7.0):
def measure(c: O.Candidate) -> O.Measurement:
if log is not None:
log.append(c)
target = c.fps(m.src_fps)
load = fake_cost(c, m, speed) / 1000.0
avg = target if load <= 1 else target / load
low1 = avg * max(0.1, 1 - max(0.0, load - 0.7))
frames = int(avg * 5)
dropped = 0 if load < 0.95 else int(frames * (load - 0.9))
delay = 20 + (15 if c.mult > 2 else 0) + 4 * load + (5 if c.motion == "full" else 0)
return O.Measurement(fps_avg=avg, low1=low1, frames=frames, dropped=dropped, delay_ms=delay, load=load,
stages={"interp": 6.0}, vram_mb=1200.0, seconds=5.0, took_s=seconds)
return measure
PC = O.Machine(display=(2560, 1440), display_hz=144, source=(1920, 1080), src_fps=30, vsr=True, trt=True)
def search(goal: str, machine: O.Machine = PC, budget: float = 300, speed: float = 1.0, log=None, took: float = 7.0):
g, _ = O.parse_goal(goal)
s = O.Search(g, machine, budget)
return s, O.run_search(s, fake_measure(machine, speed, log, took))
# ---- parsing -------------------------------------------------------------------------------------------------------------
def test_the_goal_is_read_from_the_command_line_text():
g, d = O.parse_goal("min=1920x1080@60,priority=quality")
assert g == O.Goal((1920, 1080), 60, None, "quality") and d is None
g, d = O.parse_goal("min=1440p@90, priority=frame-rate, delay=50, display=2560x1440@144")
assert (g.min_res, g.min_fps, g.max_delay_ms, g.priority) == ((2560, 1440), 90, 50.0, "fps")
assert d == ((2560, 1440), 144.0)
for bad in ("min=huge", "priority=speed", "colour=red", "min", "min=1080p@5"):
with pytest.raises(ValueError):
O.parse_goal(bad)
# ---- the verdict ---------------------------------------------------------------------------------------------------------
def test_the_average_alone_is_not_enough_the_1pct_low_needs_headroom():
g = O.Goal((1920, 1080), 60)
c = O.Candidate(mult=3, out=(1920, 1080)) # 90 fps: room above 60 + 10%
good = O.Measurement(fps_avg=90, low1=70, frames=450)
assert O.judge(g, PC, c, good) == []
low = O.Measurement(fps_avg=90, low1=64, frames=450) # over 60 but not 66
assert [f["requirement"] for f in O.judge(g, PC, c, low)] == ["low1"]
drops = O.Measurement(fps_avg=90, low1=80, frames=450, dropped=20)
assert [f["requirement"] for f in O.judge(g, PC, c, drops)] == ["dropped"]
few = O.Measurement(fps_avg=90, low1=80, frames=20)
assert O.judge(g, PC, c, few)[0]["requirement"] == "frames"
def test_a_display_at_the_minimum_moves_the_headroom_to_the_frame_budget():
m60 = O.Machine(display=(1920, 1080), display_hz=60, src_fps=30)
g = O.Goal((1920, 1080), 60)
c = O.Candidate(mult=2, out=(1920, 1080))
assert O.judge(g, m60, c, O.Measurement(fps_avg=60, low1=59, frames=300, load=0.5)) == []
busy = O.judge(g, m60, c, O.Measurement(fps_avg=60, low1=59, frames=300, load=0.95))
assert [f["requirement"] for f in busy] == ["load"]
def test_delay_limit():
g = O.Goal((1920, 1080), 60, 30.0)
c = O.Candidate(mult=3, out=(1920, 1080))
fails = O.judge(g, PC, c, O.Measurement(fps_avg=90, low1=80, frames=450, delay_ms=41))
assert fails[0]["requirement"] == "delay" and "41" in fails[0]["text"]
# ---- the search ----------------------------------------------------------------------------------------------------------
def test_quality_starts_cheap_then_climbs_the_ranking_in_order():
log: list = []
s, r = search("min=1920x1080@60,priority=quality", log=log)
assert log[0] == O.Candidate(mult=2, out=(1920, 1080), scaler="fsr", motion="half") # the cheapest that meets it
best = r["top"][0]
assert r["met"] and best["settings"]["output_res"] == "2560x1440" # the display's own size first
assert best["settings"]["scaler"] == "vsr" and best["settings"]["motion"] == "full"
assert best["settings"]["hz"] == 60 # quality never raises the multiplier
assert s.restarts <= 2 # motion detail is the only restart setting climbed
assert len(r["top"]) <= 3 and r["quality_ranking"] == list(O.QUALITY_RANKING)
for t in r["top"]: # every settings dict is one the engine takes
for k, v in t["settings"].items():
assert BY_KEY[k].accepts(v), (k, v)
def test_frame_rate_stops_at_the_display_refresh_rate():
m60 = O.Machine(display=(1920, 1080), display_hz=60, source=(1920, 1080), src_fps=30)
log: list = []
s, r = search("min=1920x1080@60,priority=fps", m60, log=log)
assert max(c.mult for c in log) == 2 # 90 fps would be more than a 60 Hz display shows
m144 = O.Machine(display=(1920, 1080), display_hz=144, source=(1920, 1080), src_fps=30)
s, r = search("min=1920x1080@60,priority=fps", m144)
assert r["top"][0]["settings"]["hz"] == 120 # 4x = 120; 5x = 150 > 144 Hz
def test_frame_rate_stops_where_the_card_can_not_keep_up():
m = O.Machine(display=(1920, 1080), display_hz=240, source=(1920, 1080), src_fps=30)
s, r = search("min=1920x1080@60,priority=fps", m, speed=1.0)
top = r["top"][0]["settings"]["hz"]
assert 60 < top < 240
assert any(not t["passed"] and t["settings"]["hz"] == top + 30 for t in r["tried"])
def test_a_heavier_candidate_than_a_failure_is_skipped_without_measuring():
s = O.Search(O.Goal((1920, 1080), 60), PC)
bad = O.Candidate(mult=4, out=(1920, 1080))
s.tried.append(O.Tried(bad, O.Measurement(frames=500), [{"requirement": "low1", "text": "x"}]))
gen = s._try(O.Candidate(mult=5, out=(2560, 1440)), "test")
with pytest.raises(StopIteration) as e:
next(gen)
assert e.value.value is None and "at least as heavy" in s.skipped[-1]["reason"]
gen = s._try(O.Candidate(mult=3, out=(2560, 1440)), "test") # lighter in one dimension: measured
assert next(gen) == O.Candidate(mult=3, out=(2560, 1440))
def test_nothing_meets_the_minimum_says_what_fails_and_by_how_much():
s, r = search("min=3840x2160@120,priority=quality", O.Machine(display=(3840, 2160), display_hz=120, src_fps=30),
speed=0.2)
assert not r["met"] and r["top"] == []
assert r["closest"] is not None and r["failures"]
f = r["failures"][0]
assert f["requirement"] == "low1" and f["short_pct"] > 0 and f["text"]
def test_a_display_slower_than_the_minimum_is_said_up_front():
s, r = search("min=1920x1080@120", O.Machine(display=(1920, 1080), display_hz=60, src_fps=30))
assert not r["met"] and any("60 Hz" in n for n in r["notes"])
assert any(f["requirement"] == "fps" for f in r["failures"])
def test_the_time_budget_is_kept_and_what_was_left_out_is_said():
s, r = search("min=1920x1080@60,priority=quality", budget=20, took=7.0)
assert s.elapsed <= 20 + 0.01 and len(r["tried"]) == 2
assert any("time" in x["reason"] for x in r["skipped"])
def test_lowest_delay_turns_frame_generation_off_when_the_game_is_fast_enough():
m = O.Machine(display=(1920, 1080), display_hz=60, source=(1920, 1080), src_fps=60)
s, r = search("min=1920x1080@60,priority=delay", m)
assert r["top"][0]["settings"]["interp"] is False
def test_lowest_delay_refuses_picture_changes_that_add_delay():
s, r = search("min=1920x1080@60,priority=delay")
full = [t for t in r["tried"] if t["settings"]["motion"] == "full"]
assert full and all(not t["passed"] for t in full) # +5 ms in the fake model
def test_the_result_file_has_a_version_and_is_json(tmp_path):
s, r = search("min=1920x1080@60,priority=resolution")
p = O.write_result(r, tmp_path)
back = json.loads(p.read_text())
assert back["format"] == "summit-optimize" and back["version"] == 1
assert json.loads((tmp_path / "latest.json").read_text()) == back
assert back["top"][0]["settings"]["output_res"] == "2560x1440"
assert {"fps_avg", "low1", "delay_ms", "stages", "vram_mb", "load"} <= set(back["top"][0]["measured"])
assert "Tried:" in O.format_text(back)
# ---- the live runner, with the real collector and settings --------------------------------------------------------------
class FakeSession:
"""Feeds the real stats.Collector 60 frames a second, at a frame rate that depends on the settings."""
def __init__(self, settings: Settings) -> None:
self.settings, self.coll, self.t = settings, S.Collector(window_s=30), 100.0
self.started = {k: settings.values()[k] for k in O.RESTART_KEYS}
self.restarts = 0
def restart_needed(self) -> bool:
return any(self.settings.values()[k] != v for k, v in self.started.items())
def run(self, runner: O.Runner, seconds: float, until=None) -> list:
cmds = []
end = self.t + seconds
while self.t < end:
fps = 30 * (self.settings.hz // 30 if self.settings.interp else 1)
self.t += 1.0 / fps
self.coll.present(self.t, False)
self.coll.stage("capture", 1.0, self.t)
cmd = runner.step(self.t)
if cmd:
cmds.append(cmd)
if cmd == "restart":
self.restarts += 1
self.started = {k: self.settings.values()[k] for k in O.RESTART_KEYS}
self.t += 3.0
if until is not None and until(runner):
break
return cmds
def make_runner(sess: FakeSession, goal="min=1920x1080@60,priority=quality", budget=60.0, card_s=None, saved=None):
g, _ = O.parse_goal(goal)
m = O.Machine(display=(1920, 1080), display_hz=60, source=(1920, 1080), src_fps=30)
return O.Runner(O.Search(g, m, budget), sess.settings, sess.coll, sess.restart_needed,
on_result=lambda r: saved.append(r) or "here" if saved is not None else "here", card_s=card_s,
clock=lambda: sess.t)
def test_cancel_puts_every_setting_back_exactly(tmp_path):
st = Settings({"scaler": "bilinear", "motion": "full", "hz": 90, "aa": "cas", "output_res": "screen"},
tmp_path / "s.json")
st.override("interp", False)
before, saved_file = st.values(), st._saved.copy()
sess = FakeSession(st)
r = make_runner(sess)
sess.run(r, 20)
assert st.values() != before and r.state in ("warm", "measure", "restarting")
r.command("optimize_cancel")
sess.run(r, 1)
assert st.values() == before and st._saved == saved_file # nothing was saved either
assert r.result["cancelled"] and r.state == "done"
def test_a_full_run_shows_the_best_and_apply_saves_it(tmp_path):
st = Settings({}, tmp_path / "s.json")
sess, saved = FakeSession(st), []
r = make_runner(sess, saved=saved)
cmds = sess.run(r, 200, until=lambda x: x.state == "card")
assert r.state == "card" and saved and saved[0]["tried"]
assert all(t["measured"]["frames"] >= O.MIN_FRAMES for t in saved[0]["tried"])
top = r.result["top"][0]["settings"]
assert all(st.values()[k] == v for k, v in top.items()) # previewed
r.command("optimize_apply")
on_disk = json.loads((tmp_path / "s.json").read_text())
assert all(on_disk[k] == v for k, v in top.items())
assert "restart" in cmds or sess.restarts == 0
def test_a_command_line_run_quits_after_its_card():
st = Settings({})
sess = FakeSession(st)
r = make_runner(sess, card_s=3.0)
cmds = sess.run(r, 300, until=lambda x: x.state == "done")
assert cmds[-1] == "quit"
# ---- headroom ------------------------------------------------------------------------------------------------------------
def test_headroom_on_a_60hz_display_suggests_a_better_picture():
m = O.Machine(display=(2560, 1440), display_hz=60, src_fps=30, vsr=True)
h = O.headroom(60.0, 0.4, 0.0, {"interp": True, "hz": 60, "output_res": "1920x1080", "scaler": "fsr",
"motion": "half", "aa": "off"}, m)
assert h["state"] == "room" and "60 Hz" in h["line"] and "40%" in h["line"]
keys = [s["key"] for s in h["suggestions"]]
assert "hz" not in keys # 90 fps can't be shown at 60 Hz
assert {"output_res", "scaler", "motion", "aa"} <= set(keys)
def test_headroom_when_falling_behind_suggests_lighter_settings():
m = O.Machine(display=(1920, 1080), display_hz=144, src_fps=30)
h = O.headroom(90.0, 0.97, 0.05, {"interp": True, "hz": 120, "output_res": "1920x1080", "scaler": "vsr",
"motion": "full", "aa": "smaa"}, m)
assert h["state"] == "behind"
assert [s["key"] for s in h["suggestions"]][:2] == ["motion", "scaler"]
def test_headroom_says_when_the_multiplier_is_more_than_the_display_shows():
m = O.Machine(display=(1920, 1080), display_hz=60, src_fps=30)
h = O.headroom(119.0, 0.5, 0.0, {"interp": True, "hz": 120, "output_res": "1920x1080", "scaler": "fsr"}, m)
assert h["suggestions"][0]["key"] == "hz" and h["suggestions"][0]["value"] == 60
def test_headroom_reads_a_real_session_summary():
from pathlib import Path
p = Path(__file__).resolve().parents[2] / "docs/media/stats/real-session-summary.json"
summ = json.loads(p.read_text())
h = O.headroom_of_summary(summ, O.Machine(display=(1280, 720), display_hz=60, src_fps=30))
assert h["state"] in ("room", "fits", "behind") and h["load_pct"] is not None
# ---- wiring: the pipeline steps the driver, the overlay's Optimize tab ------------------------------------------------------
def test_the_pipeline_steps_the_driver_and_forwards_optimize_commands():
from test_stats_pipeline import FakeInterp, FakeSink, FakeSource
from framegen.pipeline import Pipeline
from framegen.sources import make_detector
class Driver:
def __init__(self, restart_at):
self.n, self.at, self.cmds = 0, restart_at, []
def step(self, now):
self.n += 1
return "restart" if self.n == self.at else None
def command(self, cmd):
self.cmds.append(cmd)
return None
pipe = Pipeline(FakeInterp(), make_detector(FakeSource.info))
pipe.driver = d = Driver(restart_at=20)
st = pipe.run(FakeSource(60), FakeSink(cmds=[None, "optimize_cancel"]), settings=Settings(), label="X",
collector=S.Collector())
assert st.exit == "restart" and d.n == 20 and d.cmds == ["optimize_cancel"]
def test_the_optimize_tab_has_its_rows_and_actions():
from framegen.menu import ACTION_HELP, Menu
st = Settings()
menu = Menu(st)
assert "Optimize" in menu.sections()
assert not any(r.kind == "action" for r in menu.tab_rows("Optimize")) # no Control: no run offered
state = ["idle"]
menu.optimizer_state = lambda: state[0]
rows = menu.tab_rows("Optimize")
keys = [r.key for r in rows]
assert {"opt_min_res", "opt_min_fps", "opt_max_delay", "opt_priority", "opt_budget"} <= set(keys)
assert keys[-1] == "optimize" and all(k in ACTION_HELP for k in ("optimize", "optimize_cancel", "optimize_apply"))
menu.show("Optimize")
menu.index = len(rows) - 1
assert menu.key("enter") == "optimize"
state[0] = "card"
assert [r.key for r in menu.tab_rows("Optimize") if r.kind == "action"] == ["optimize_apply", "optimize_cancel"]
assert list(S_PRIORITIES()) == list(O.PRIORITIES)
def S_PRIORITIES():
return BY_KEY["opt_priority"].choices
def test_the_warm_up_waits_for_a_backlog_to_drain():
st = Settings({})
sess = FakeSession(st)
r = make_runner(sess)
sess.run(r, 4.0, until=lambda x: x.state == "warm")
assert r.state == "warm"
for _ in range(int(60 * O.WARM_RESTART_S) + 30): # long past the warm-up, but frames still queue 300 ms
sess.t += 1 / 60
sess.coll.present(sess.t, False)
sess.coll.stage("capture", 300.0, sess.t)
r.step(sess.t)
assert r.state == "warm"
for _ in range(90): # the queue drains: a second of short waits and it measures
sess.t += 1 / 60
sess.coll.present(sess.t, False)
sess.coll.stage("capture", 2.0, sess.t)
r.step(sess.t)
assert r.state == "measure"
def test_frame_generation_off_keeps_the_ai_settings_and_is_followed_by_2x_if_it_fails():
m = O.Machine(display=(1920, 1080), display_hz=120, source=(1920, 1080), src_fps=30)
s = O.Search(O.Goal((1920, 1080), 30, None, "fps"), m, 300, current={"motion": "full", "engine": "torch"})
gen = s.steps()
base = next(gen)
assert base.mult == 1 and base.motion == "full" and base.engine == "torch" # no restart for unused settings
nxt = gen.send(O.Measurement(fps_avg=30, low1=9, frames=150, took_s=7)) # stalls: fails
assert nxt.mult == 2 and nxt.motion == "half"
def test_headroom_with_frame_generation_off_suggests_turning_it_on_whole():
m = O.Machine(display=(1920, 1080), display_hz=120, src_fps=30)
h = O.headroom(30.0, 0.2, 0.0, {"interp": False, "hz": 60, "output_res": "1920x1080", "scaler": "fsr"}, m)
first = h["suggestions"][0]
assert first["set"] == {"interp": True, "hz": 60}
assert all(BY_KEY[k].accepts(v) for x in h["suggestions"] for k, v in x["set"].items())