Optimize: offer check, store identity, funnel events and card redesign

Merged
UT
12d ago
+13039-1007

Description

Client side of Optimize, on top of utkarshdalal/GameNative#2363: the first card is only offered when the server says it can help, games with nothing yet get a waiting state, store identity and engine hints are sent, a funnel of events is reported, every Optimize surface is redesigned, and more session measurements are sent. It also carries what was utkarshdalal/GameNative#2381 and utkarshdalal/GameNative#2385.

What the user sees

  • The post-session card appears only after the server confirmed it has something for the game; offline, the card still shows and is marked unverified.
  • A waiting card and status ("No safe change for this game yet. We will check again later.") for games the server has nothing for.
  • The cap question is asked before any frame-rate cap is applied.
  • Redesigned card, goal chooser, Optimize dialog, game options row and sign-in sheet (see utkarshdalal/GameNative#2381).
  • The worse card reads "That change did not agree with , so it was undone."

What the client does

  • Asks the server at exit (dry_run: true) before writing a first card, and stores the server's hold when it says not now.
  • Sends game.store_id, game.build, an engine hint and game.engine_meta on requests and outcomes.
  • Sends session measurements (metrics, samples) and signals such as gpu_busy_p95, hot_thread_p95, fps_ceiling_reason, gpu_work_per_frame, hot_thread_core_share, device.cpu_clusters, pipeline_compiles_by_5min, tessellation_pipelines, major_faults_by_5min, mem_reclaim_by_5min and gpu_work_scaling, all from data the sampler already reads (no per-frame work, nothing inside the game).
  • Shows the server's verdict and judgement when present (verdict_server, judgement_server), and falls back to the existing path otherwise. A local crash revert is never delayed or overridden.
  • Crash auto-revert: a change that crashed comes off as soon as the session ends, also when the app was killed mid-session, and is reported as a crash with its kind and hash.
  • Applies the returned change with a backup and restores it on undo; container settings for present mode, DXVK_CONFIG entries and the gamescope extras are backed up and restored like the rest.
  • Funnel events batched to our own API (card_shown, card_not_now, card_never, card_accepted, cap_asked, cap_accepted, cap_declined, signin_required, apply_ok, apply_failed, judged_helped, judged_no_change, judged_worse, restored, exhausted, done); a subset is mirrored to PostHog only when usage analytics is on.

Strings

New: optimize_after_no_rule, optimize_status_waiting, the card redesign strings listed in utkarshdalal/GameNative#2381, and vc_sharpness_lower, vc_none_may_be_unstable, vc_none, vc_textures_stream_later, vc_image_softer_upscaled. Changed: optimize_after_cap_held, vc_textures_softer. All in the default file and every locale.

CI

Recording

None yet. The redesigned card, goal chooser and sign-in need a device pass on a handheld in landscape with a controller.

Type of Change

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

Checklist

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