Repository navigation
OpenGP 1.0.4: menu-back and live performance information - #6
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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
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.
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.