Skip to content

OpenGP 1.0.4: menu-back and live performance information - #6

Merged
OfficiallySp merged 11 commits into
mainfrom
release-1.0.4
Nov 12, 2026
Merged

OfficiallySp merged 11 commits into
mainfrom
release-1.0.4

Conversation

@OfficiallySp

@OfficiallySp OfficiallySp commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

OpenGP 1.0.4 adds GP2 brake-back and live performance information. Players can change menu selections with the brake and inspect performance without recording a session.

GP2 selection menus -> brake -> previous selection (single-player only)
Game frames -> bounded live metrics -> Performance page / F7 overlay

The profiler branch is merged with recording, stack sampling, marks, capture tools and their UI excluded from the final tree. The private branch retains the development profiler. Known graphics issues are explicitly deferred in the release notes; Return to title and Restart race are not included.

Evidence

  • Before: The public build had no live performance page or overlay; GP2 selections could not go back. The private profiler offered recording and frame captures.
    After: Both games build and report 1.0.4. Windows CTest passes 22/22, including live timing/pause/counter-reset tests, overlay bindings and menu-history tests. The recording CLI option is rejected and isolated game runs create no profiler output files.
  • Fresh 115-second GP2 scripted run: inspected Waluigi Cup and Luigi racing after backing out and changing selections; exit 0. GP1 window smoke: inspected live overlay, F7 hide/restore. Game-derived screenshots and test saves remain local and are not attached.
  • Cross-platform CI must pass before merging; release packages will be built from the version tag and checked before publication to both release repositories.
  • All six CI checks passed on the final head (Windows, macOS, Linux GCC/Clang/GCC 12 and game-data scan). An additional Performance-page window check was blocked by a local Vulkan surface error; the preserved pre-change executable reproduces the same error. The earlier successful overlay on/off/on captures were inspected; the Performance page itself is compile-verified only.
  • Physical controllers, audio listening and two-machine linked play were not tested in this change. Earlier GP2 card/no-card, Time Attack and Grand Prix Continue evidence remains applicable to the unchanged menu-back code.

Merge Danger

Door: Two-way. Source changes can be reverted; 1.0.3 packages remain available. No save-format migration.

Blast Radius: Games. The shared input/menu and timing paths affect both GP1 and GP2. The new display keeps only 120 frame samples and does not run a sampling thread or write profiles. GPU memory is an estimate; graphics accuracy issues remain documented.

OfficiallySp and others added 11 commits October 17, 2026 17:30
F10 (or --profile, or the menu's new Profiler tab) records a profile into
user/profiles/<date>_<time>/, made to be read by tools/profiles.py:

- frames.bin: a record per frame shown (profile/record.h): the game's frame
  time and its idle time, the GX front end's work (state, textures, decoding,
  transforms), waits for the renderer and readbacks, the renderer's (uploads,
  swapchain waits, submits, shader compiles), draws, triangles, textures,
  copies, the scene and race. The GX front end and renderer count these per
  frame (gx::FrameStats, video::RenderStats).
- events.jsonl: scenes, races, hitches (what took the time, and the game's
  busiest functions from the stack samples), likely glitches (gx::Risk: what
  the front end can't draw as the hardware would), shader compiles, settings,
  pauses, marks (F8), captures, hangs.
- system.jsonl: CPU use by named thread, of OpenGP and the whole computer,
  memory. cpu/: call stack samples of the busy threads (Windows, 500 a
  second: each stopped thread's stack is copied and walked after it runs
  again, so nothing that may need its locks runs while it is stopped).
- thumbnails of the screen (copied without waiting for the GPU), the
  console, and a summary when it stops. A game that restarts itself goes on
  recording into the same profile.

F9 (or --capture-frame N) captures a frame: screen, EFB colour and depth
(before and after), every texture and EFB copy as PNG, and every command:
draws with their bounds, depth range, blending, TEV stages as formulas,
textures, vertex format, and the game function that issued them (each
write to the gather pipe notes its writer during a capture, so a command
leads to the code that wrote its first byte).

PNG files are compressed now (row filters and a small deflate encoder).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The profiler stays on a local branch: its options and keys are described
in docs/profiling.md only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The launcher asks for the next frame once it has the previous capture, and
by then the game can be a frame or two further on: the front end, which
captured only at exactly that frame, skipped it and every later one. Take
the first frame at or after the one asked for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With 1x960, a 960-pixel picture of every frame: enough to find one-frame
flicker (a pixel that differs from both neighbouring frames while they
agree), which frame captures, a frame at a time, can't show.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Profiles record how long each frame was held for the game's retrace
(pace_us), flag the setting (1024, "paced") and show it in the summary's
settings line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the profiler branch up to date with main's 1.0.0-1.0.2 work: the
menu redesign, texture pooling, crash and hang reports, and the video and
input changes. The profiler's recording, frame captures and Profiler page
are kept on the new menu.
The profiler's four actions (start/stop, mark, capture, overlay) are now
OpenGP's own controls, mapped like the cabinet's: keyboard defaults stay
F10/F8/F9/F7, and any key, gamepad button or axis can be bound on the
Controls page (its new Profiler section) or in user/controls.toml.

A live performance overlay (--profile-overlay, or F7 by default) shows
what the game is doing without writing a profile: a frame-time graph with
a 16.7 ms target line, fps, frame time, busy fraction, p99, render time,
drops, hitches, marks, whole-computer CPU use, GPU texture and pipeline
counts, and the profile's frame count while recording.

The profile's per-frame record gains five new fields: drops (VI retraces
without a new frame), guest_busy_us (game time less idle/wait/readbacks),
pipeline_binds, live_texture_kb and live_pipelines.  profiles.py reads
older records that lack drops and guest_busy_us by computing them.

Capture hitches (Profiler tab) auto-captures the next frame when a hitch
or likely glitch is first seen while recording (at most once per 5 s).
summary.json now includes drops, pipeline binds, and GPU live counts.
Integrate menu-back commit 1597e1d316060df1503ec483d8461fe53ebc09dc
on main 1a6aae4, retaining the
1.0.3 linked-race pacing fixes. Keep the existing default-on setting,
photo skipping, gas-confirmation guard, linked-play guard and race reset.

Bump the CMake version to 1.0.4 and describe the GP 2-only feature under
an explicitly unreleased heading. This is local staging only.

Validation: fresh clang-cl configure and build of both games; all 20
CTest tests passed; a local synthetic menu-back harness passed 9 cases
and 19 assertions; both game binaries report 1.0.4; check_game_data.py
and git diff --cached --check passed. Manual gameplay and the historical
scripted no-card/card/Time Attack runs were not repeated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
The sampler copied from a stopped thread's stack pointer up to its StackBase without checking which part of the stack was committed. A thread growing its stack can have its pointer in the guard page; the copy then takes the guard-page fault (0x80000001) the thread was about to take itself, and OpenGP dies while recording a profile (seen in Mario Kart Arcade GP 2 after about 5000 frames).

Copy only above the TEB's StackLimit, the bottom of the committed stack, and record just the innermost address for a sample taken below it.
The stack sampler copied a suspended thread's stack between Rsp and the stack base. On Windows the stack only grows on demand: the pages between the committed stack limit and the guard page are not mapped, so a thread that is part-way through growing its own stack can have an Rsp below the committed limit. Reading from there faults on the guard page (exception 80000001) inside the sampler's memcpy.

Read StackBase/StackLimit from the target thread's TEB and only copy when StackLimit <= Rsp < StackBase; otherwise record just the innermost address. TEB fields are read with ReadProcessMemory, so no kernel work (VirtualQuery) is done while threads are suspended.

This is the crash fix only; the rest of the profiler stays on the profiler branch. This branch will not build until that is merged.
Keep the performance page, overlay, bounded timing history and rebindable F7
control. Exclude recording, stack sampling, event logs, marks and captures
from the public build. Preserve GP2 brake-back and the 1.0.3 link fixes.

Add regression coverage for live measurements, overlay controls and menu
history. Document the deferred graphics issues for this release.

Co-Authored-By: Codex <noreply@openai.com>
@OfficiallySp
OfficiallySp merged commit 9b3e5a6 into main Nov 12, 2026
6 checks passed
@OfficiallySp
OfficiallySp deleted the release-1.0.4 branch November 12, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant