From 4fd70e398f3fd2dca0e4dac344d947b53c108721 Mon Sep 17 00:00:00 2001 From: epicmeme546 <178368684+epicmeme546@users.noreply.github.com> Date: Fri, 13 Nov 2026 06:22:18 -0500 Subject: [PATCH] Make F8 write a bug capture and add a test run that starts from one. F8 now always writes a folder under logs/captures: the area, Link's position and rotation, the camera of the frame on screen and the game's own, the presented frame as a PNG, frame times around the press, the machine, the settings that differ from the defaults, the end of the log, the save, and the game's flags and texts. A note on screen names the capture. The flight recorder's F8 dump goes into the capture's folder. NX2NAVI_CAPTURE_REPLAY starts a run on a capture's settings, teleports to its area, walks Link to where he stood and puts the free camera where the camera was; tools/capture_run.py prepares the profile from the capture's save, runs it and compares the two captures. docs/bug-capture.md has the files and the steps. Co-Authored-By: Claude Fable 5.2 --- docs/architecture.md | 5 +- docs/bug-capture.md | 120 ++++++ docs/controls.md | 3 +- docs/releases/v0.9.3.md | 7 + runtime/bugcap.c | 802 ++++++++++++++++++++++++++++++++++++++++ runtime/bugcap.h | 31 ++ runtime/cfg.c | 29 +- runtime/debug_tools.c | 182 ++++++++- runtime/debug_tools.h | 19 + runtime/flight.c | 62 +++- runtime/flight.h | 8 +- runtime/gfx_present.c | 67 +++- runtime/input.h | 2 +- runtime/input_map.h | 2 +- runtime/perf.c | 2 + runtime/ui/menu.cpp | 25 +- runtime/ui_text.c | 12 + runtime/ui_text.h | 4 +- runtime/vk.h | 16 + runtime/vk_dump.c | 2 +- tools/capture_run.py | 336 +++++++++++++++++ 21 files changed, 1687 insertions(+), 49 deletions(-) create mode 100644 docs/bug-capture.md create mode 100644 runtime/bugcap.c create mode 100644 runtime/bugcap.h create mode 100644 tools/capture_run.py diff --git a/docs/architecture.md b/docs/architecture.md index 9fb7060e..2abe159a 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -223,8 +223,9 @@ keeps per-core data without locks and relies on that, so the host models it (`ru whose size it uses, is made whole (`gfx_shader.c` `reflect_exact`). `auto` picks by the device-local budget. - Occlusion queries never block the CPU; a result that is not ready counts as visible. - Allocation: Vulkan Memory Allocator. Debugging: Vulkan validation layers, per-pass frame dumps (`NX2NAVI_DUMP`, - `vk_dump.c`), a sampling profiler (`NX2NAVI_PROFILE`, `tools/prof_report.py`) and a flight recorder - (`NX2NAVI_FLIGHT`). RenderDoc cannot capture, because it hides `VK_EXT_external_memory_host` from the application. + `vk_dump.c`), a sampling profiler (`NX2NAVI_PROFILE`, `tools/prof_report.py`), a flight recorder + (`NX2NAVI_FLIGHT`) and bug captures, which a player's F8 writes and a test run starts from (`bugcap.c`, + [bug-capture.md](bug-capture.md)). RenderDoc cannot capture, because it hides `VK_EXT_external_memory_host` from the application. Maxwell behaviour the back end has to match: [maxwell.md](maxwell.md). diff --git a/docs/bug-capture.md b/docs/bug-capture.md new file mode 100644 index 00000000..3120a6a1 --- /dev/null +++ b/docs/bug-capture.md @@ -0,0 +1,120 @@ +# Bug captures + +A bug capture records where and how the game was when a player saw something wrong, so that the bug can be looked for +again at that place instead of somewhere else. The player presses **F8**; a test run then starts from what the press +wrote. Code: `runtime/bugcap.c`, `tools/capture_run.py`. Ocarina of Time 1.1.1 (the place and the camera come from the +debug tools, `runtime/debug_tools.c`); on other game versions a capture still has the picture, the timing, the +settings and the save. + +## For the player + +When you see a bug, press **F8** while the game window is in front. About a second later a note at the top of the +screen says *Bug capture 3 saved* with the folder's name. Tell whoever looks into the bug the number ("capture 3") and +what you saw; nothing else is needed. Press it as often as you like: each press is its own capture, and a press while +the one before is still being written is skipped. + +The captures are in the game folder under `logs\captures`, one folder each, named by number and time +(`003-20261113-141502`). *Menu > Open log folder* shows `logs`. A capture is between one and a few megabytes; delete +old ones whenever you like. Nothing leaves your PC: a capture is files on your disk. + +## What a capture holds + +| File | What | +|---|---| +| `capture.txt` | Written last: a folder that has it is complete. `key = value` lines under `[sections]`, see below | +| `frame.png` | The frame on screen as the window got it, the overlay included, without the capture's own note (an HDR picture converted to sRGB) | +| `frames.tsv` | The last 600 presents before the press and the 30 after: frame, interval and replay time in ms | +| `log-tail.txt` | The last 256 KB of the run's log | +| `settings.ini` | Every setting that had a value (from `nx2navi.ini`, the menu or the environment) as `nx2navi.ini` lines, without the private ones (`runtime/cfg_private.h`) | +| `NX2navi-save-