WIP: fix(bug-report): the report's picture keeps the screen's shape #1143

Draft
enum wants to merge 2 commits from enum/Longshot:fix/bug-report-picture-shape into main
First-time contributor

Type: fix · Risk: low · Tested on: Windows 11, RTX 4070 · Needs: Linux, any GPU (a renderer build)

Why

The Insert menu's Bug report saves a picture of the game, and on any screen that isn't 16:9 that picture is distorted.
It is always 1280x720, so a 3440x1440 screen's frame is squeezed into it: 0.372 across but 0.5 down, and everything in
it looks tall and thin, the HUD included. #1133's picture looks so and sent the triage looking for a stretched HUD
that the screen does not have. The reporter's own full-size screenshot later showed the HUD at its true shape: each
heart 45x34 pixels, as here. Part of #1133: what is left there is the HUD's place on a wide screen, not this.

How to reproduce

Seen on: Windows 11 Pro (26300), RTX 4070, NVIDIA 616.56, on a 3440x1440 monitor in fullscreen
Settings and switches: Aspect ratio 21:9 (monitor's), Output resolution 3440x1440
Steps: in play, Insert menu > Gameplay > Bug report; open the report folder's picture.png
Expected: a picture in the screen's shape
Actual: 1280x720, everything in it tall and thin

What changed

The bug report's picture now keeps the screen's shape, fitted into 1280x720: 1280x536 at 21:9, 1152x720 at 16:10,
1280x720 at 16:9. The control bridge's shots keep their size and their log line.

  • vk: shot_ask_next (the report's picture, its only caller) asks through the new shot_ask_as with shape set.
    shot_ask_record then fits the frame into kShotW x kShotH with present_rect, by the display aspect the
    window's present uses for its bars (host->aspect_ratio, else the frame's or the crop's own shape). The headless
    frame, already squeezed to the shot's size, is fitted the same way. The frame is blitted to the image's corner,
    only that rectangle is copied back, and shot_ask_take writes the PNG at that size. The image and the buffer stay
    kShotW x kShotH. All in gpu/vk/vk_replay.cpp.
  • vk: shot_ask (the control bridge's) is shot_ask_as without shape: still kShotW x kShotH, as
    docs/control.md says, and its log line is byte for byte as before (tests/test_longshot_ctl.py matches it). The
    report's line names its picture and size.
  • comments: bug_report_picture (vk_menu.cpp) and shot_ask_next (vk_internal.h) describe the new size.
  • tests: tests/test_bug_report.py's checks of shot_ask_next and shot_ask_record name the new calls, as they named
    the old.

Measurements

Verdict: passes. The new check fails on main for the bug and passes here. In the game, on a 3440x1440 monitor, the
report's picture goes from 1280x720 (squeezed) to 1280x536, scaled the same across as down.

Hardware: Windows 11 Pro (26300), RTX 4070 (616.56), Ryzen 9 7900X, 64 GB; a 3440x1440 monitor
Scene: Kokiri Forest, the repository's kokiri-start save, in play; Aspect ratio 21:9, Output resolution 3440x1440,
NVIDIA DLSS, Frame generation 2x (DLSS FG), NVIDIA Reflex on, fullscreen
Method: a Bug report saved from the Insert menu (keyboard), its picture.png's size and scale against the 3440x1440
frame; main's renderer and this one in the same game folder
How to reproduce: the steps above; python -I -B tests/run_all.py test_bug_report_picture

Before: main @ 71b1edd8 After: this PR @ 1ff0e4ee
tests/test_bug_report_picture.py 4 of 7 cases fail (Windows clang, Linux g++ 15) pass
The report's picture.png, 3440x1440 screen 1280x720: 0.3721 across, 0.5000 down 1280x536: 0.3721 across, 0.3722 down
run_all.py (Windows) (failures on main) 609 passed, 26 failed, 43 skipped: all 26 also fail on main

Before: main @ 71b1edd8, top; After: this PR, bottom. The bug report's picture.png from the same spot on a 3440x1440 screen

== main
report-21x9: aspect 2.3889, a 3440x1440 frame: blitted to 1280x720 at 0,0; the PNG 1280x720
FAIL: the picture's size is not the screen's shape
FAIL: 4 of 7 cases: report-21x9, report-headless, report-16x10, report-crop-21x9
== this PR
report-21x9: aspect 2.3889, a 3440x1440 frame: blitted to 1280x536 at 0,0; the PNG 1280x536
report-headless: aspect 2.3889, a 1280x720 frame: blitted to 1280x536 at 0,0; the PNG 1280x536
report-16x10: aspect 1.6000, a 1920x1200 frame: blitted to 1152x720 at 0,0; the PNG 1152x720
report-16x9: aspect 0.0000, a 2560x1440 frame: blitted to 1280x720 at 0,0; the PNG 1280x720
bridge-21x9: aspect 2.3889, a 3440x1440 frame: blitted to 1280x720 at 0,0; the PNG 1280x720
bug report picture: ok
== in the game, this PR's renderer
vk: present 5801 written to ...\bug-reports\2026-11-16_08-53-19\picture.png (the control bridge)
menu: bug report written to bug-reports\2026-11-16_08-53-19: report.txt, longshot_log.txt (419 KB), picture.png

(The in-game run used this change before its last commit, which made the report's log line name its picture and size,
(the bug report's picture, 1280x536). That change only touches the line's text, as the check shows.)

Flags and settings

None. (gpu/vk/vk_menu.cpp changes only a comment, above bug_report_picture.)

Testing

Tested:

  • tests/test_bug_report_picture.py (new) runs vk_replay.cpp's shot asks with stand-ins for the blit, the readback and
    the PNG writer. It covers 21:9, 16:10, 16:9, the headless frame, two crops and the bridge's shot, and checks the
    readback's barrier and invalidate sizes. It fails on main and passes here, on Windows (llvm-mingw clang) and Linux
    (WSL, g++ 15). Undoing the fix fails its cases again, and so does a readback barrier sized too small.
  • test_bug_report, test_longshot_ctl and the full suite (above). test_bug_report_defaults fails here as on main
    (Auto's shadow_res, diagnosed on #773).
  • In the game: the report saved on a 3440x1440 monitor with main's renderer and with this one. Pictures and scales
    are above.
  • A second agent reviewed the change cold: Vulkan copy bounds, the undefined texels outside the blit, the aspect cases
    (0 at 16:9 and handheld, 1.25 to 5.33 otherwise), the threading. It found two stale comments and two test gaps, all
    fixed here.

Not tested: a 16:10 or 4:3 monitor in the game (covered by the check, not run). A whole renderer build on Linux:
the renderer was built on Windows (llvm-mingw, RX_VK_ONLY=1 nx2/build.py --standalone, 0 failed); on Linux only the
shot code the check cuts out was compiled (g++ 15). Linux in the game: the change is in the renderer's common code,
with no platform branch.

Must be tested:

  • Linux, any GPU: the renderer built from this branch (RX_VK_ONLY=1 python -I nx2/build.py --standalone), expecting it to compile and link with no new warning in gpu/vk/vk_replay.cpp; and, if a game is at hand, a Bug report on a screen that is not 16:9, expecting picture.png in the screen's shape (Test Farm: @Beanstalk linux, a renderer build of this branch)

Risks

What could break: the bug report's picture only. The control bridge's shots, the per-frame shots (RX_VK_SHOTS)
and the headless output are unchanged.

Turning it off: revert the commit

Compatibility: Nothing changes for a player but the picture's size in a bug report on a screen that isn't 16:9.
MkwVkHost and MkwVkRenderer are unchanged, so no API version bump.

Issues

See #1133

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Windows 11, RTX 4070 · **Needs:** Linux, any GPU (a renderer build) ## Why The Insert menu's Bug report saves a picture of the game, and on any screen that isn't 16:9 that picture is distorted. It is always 1280x720, so a 3440x1440 screen's frame is squeezed into it: 0.372 across but 0.5 down, and everything in it looks tall and thin, the HUD included. #1133's picture looks so and sent the triage looking for a stretched HUD that the screen does not have. The reporter's own full-size screenshot later showed the HUD at its true shape: each heart 45x34 pixels, as here. Part of #1133: what is left there is the HUD's place on a wide screen, not this. ## How to reproduce **Seen on:** Windows 11 Pro (26300), RTX 4070, NVIDIA 616.56, on a 3440x1440 monitor in fullscreen **Settings and switches:** Aspect ratio 21:9 (monitor's), Output resolution 3440x1440 **Steps:** in play, Insert menu > Gameplay > Bug report; open the report folder's `picture.png` **Expected:** a picture in the screen's shape **Actual:** 1280x720, everything in it tall and thin ## What changed The bug report's picture now keeps the screen's shape, fitted into 1280x720: 1280x536 at 21:9, 1152x720 at 16:10, 1280x720 at 16:9. The control bridge's shots keep their size and their log line. - vk: `shot_ask_next` (the report's picture, its only caller) asks through the new `shot_ask_as` with `shape` set. `shot_ask_record` then fits the frame into `kShotW` x `kShotH` with `present_rect`, by the display aspect the window's present uses for its bars (`host->aspect_ratio`, else the frame's or the crop's own shape). The headless frame, already squeezed to the shot's size, is fitted the same way. The frame is blitted to the image's corner, only that rectangle is copied back, and `shot_ask_take` writes the PNG at that size. The image and the buffer stay `kShotW` x `kShotH`. All in `gpu/vk/vk_replay.cpp`. - vk: `shot_ask` (the control bridge's) is `shot_ask_as` without `shape`: still `kShotW` x `kShotH`, as `docs/control.md` says, and its log line is byte for byte as before (`tests/test_longshot_ctl.py` matches it). The report's line names its picture and size. - comments: `bug_report_picture` (`vk_menu.cpp`) and `shot_ask_next` (`vk_internal.h`) describe the new size. - tests: `tests/test_bug_report.py`'s checks of `shot_ask_next` and `shot_ask_record` name the new calls, as they named the old. ## Measurements **Verdict:** passes. The new check fails on `main` for the bug and passes here. In the game, on a 3440x1440 monitor, the report's picture goes from 1280x720 (squeezed) to 1280x536, scaled the same across as down. Hardware: Windows 11 Pro (26300), RTX 4070 (616.56), Ryzen 9 7900X, 64 GB; a 3440x1440 monitor Scene: Kokiri Forest, the repository's `kokiri-start` save, in play; Aspect ratio 21:9, Output resolution 3440x1440, NVIDIA DLSS, Frame generation 2x (DLSS FG), NVIDIA Reflex on, fullscreen Method: a Bug report saved from the Insert menu (keyboard), its `picture.png`'s size and scale against the 3440x1440 frame; `main`'s renderer and this one in the same game folder How to reproduce: the steps above; `python -I -B tests/run_all.py test_bug_report_picture` | | Before: main @ 71b1edd8 | After: this PR @ 1ff0e4ee | |---|---|---| | `tests/test_bug_report_picture.py` | 4 of 7 cases fail (Windows clang, Linux g++ 15) | pass | | The report's `picture.png`, 3440x1440 screen | 1280x720: 0.3721 across, 0.5000 down | 1280x536: 0.3721 across, 0.3722 down | | `run_all.py` (Windows) | (failures on main) | 609 passed, 26 failed, 43 skipped: all 26 also fail on main | ![Before: main @ 71b1edd8, top; After: this PR, bottom. The bug report's picture.png from the same spot on a 3440x1440 screen](https://git.magicbean.dev/attachments/7e06554d-a083-453a-ade1-b5e9cd55ba50) ``` == main report-21x9: aspect 2.3889, a 3440x1440 frame: blitted to 1280x720 at 0,0; the PNG 1280x720 FAIL: the picture's size is not the screen's shape FAIL: 4 of 7 cases: report-21x9, report-headless, report-16x10, report-crop-21x9 == this PR report-21x9: aspect 2.3889, a 3440x1440 frame: blitted to 1280x536 at 0,0; the PNG 1280x536 report-headless: aspect 2.3889, a 1280x720 frame: blitted to 1280x536 at 0,0; the PNG 1280x536 report-16x10: aspect 1.6000, a 1920x1200 frame: blitted to 1152x720 at 0,0; the PNG 1152x720 report-16x9: aspect 0.0000, a 2560x1440 frame: blitted to 1280x720 at 0,0; the PNG 1280x720 bridge-21x9: aspect 2.3889, a 3440x1440 frame: blitted to 1280x720 at 0,0; the PNG 1280x720 bug report picture: ok == in the game, this PR's renderer vk: present 5801 written to ...\bug-reports\2026-11-16_08-53-19\picture.png (the control bridge) menu: bug report written to bug-reports\2026-11-16_08-53-19: report.txt, longshot_log.txt (419 KB), picture.png ``` (The in-game run used this change before its last commit, which made the report's log line name its picture and size, `(the bug report's picture, 1280x536)`. That change only touches the line's text, as the check shows.) ### Flags and settings None. (`gpu/vk/vk_menu.cpp` changes only a comment, above `bug_report_picture`.) ## Testing **Tested:** - `tests/test_bug_report_picture.py` (new) runs `vk_replay.cpp`'s shot asks with stand-ins for the blit, the readback and the PNG writer. It covers 21:9, 16:10, 16:9, the headless frame, two crops and the bridge's shot, and checks the readback's barrier and invalidate sizes. It fails on `main` and passes here, on Windows (llvm-mingw clang) and Linux (WSL, g++ 15). Undoing the fix fails its cases again, and so does a readback barrier sized too small. - `test_bug_report`, `test_longshot_ctl` and the full suite (above). `test_bug_report_defaults` fails here as on `main` (Auto's shadow_res, diagnosed on #773). - In the game: the report saved on a 3440x1440 monitor with `main`'s renderer and with this one. Pictures and scales are above. - A second agent reviewed the change cold: Vulkan copy bounds, the undefined texels outside the blit, the aspect cases (0 at 16:9 and handheld, 1.25 to 5.33 otherwise), the threading. It found two stale comments and two test gaps, all fixed here. **Not tested:** a 16:10 or 4:3 monitor in the game (covered by the check, not run). A whole renderer build on Linux: the renderer was built on Windows (llvm-mingw, `RX_VK_ONLY=1 nx2/build.py --standalone`, 0 failed); on Linux only the shot code the check cuts out was compiled (g++ 15). Linux in the game: the change is in the renderer's common code, with no platform branch. **Must be tested:** - Linux, any GPU: the renderer built from this branch (`RX_VK_ONLY=1 python -I nx2/build.py --standalone`), expecting it to compile and link with no new warning in `gpu/vk/vk_replay.cpp`; and, if a game is at hand, a Bug report on a screen that is not 16:9, expecting `picture.png` in the screen's shape (Test Farm: @Beanstalk linux, a renderer build of this branch) ## Risks **What could break:** the bug report's picture only. The control bridge's shots, the per-frame shots (`RX_VK_SHOTS`) and the headless output are unchanged. **Turning it off:** revert the commit **Compatibility:** Nothing changes for a player but the picture's size in a bug report on a screen that isn't 16:9. `MkwVkHost` and `MkwVkRenderer` are unchanged, so no API version bump. ## Issues See #1133 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The bug report's picture is always 1280x720, so a 3440x1440 screen's frame is
squeezed into it: everything in it looks tall and thin, the HUD included, a
distortion the screen does not have (#1133's attachment). The check runs
vk_replay.cpp's shot asks with stand-ins for the blit, the readback and the PNG
writer: the report's picture must be the screen's shape fitted into 1280x720
(1280x536 at 21:9, 1152x720 at 16:10, from the headless frame too), and the
control bridge's shots keep 1280x720; and with a crop, as the window passes one, the crop's shape. The readback's barrier and the CPU's view of it must cover the picture. On main 4 of its 7 cases fail.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(bug-report): the report's picture keeps the screen's shape (#1133)
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
1ff0e4ee3a
The bug report's picture was always 1280x720: a 3440x1440 screen's frame was
squeezed into it, 0.372 across and 0.5 down, so everything in it looked tall
and thin, the HUD included, a distortion the screen did not have. #1133's
attachment looked so, and on the reporter's screen the HUD measures as it
should (each heart 17x17 in their picture and in one made here).

shot_ask_next (the report's picture, its only caller) now asks for the
screen's shape: shot_ask_record fits the frame into kShotW x kShotH by the
display aspect the window's present bars by (host->aspect_ratio, else the
frame's own; also for the headless frame, already squeezed into the shot's
size), blits it to the image's corner, copies back that rectangle alone, and
shot_ask_take writes the PNG at that size: 1280x536 at 21:9, 1152x720 at
16:10, 1280x720 at 16:9. The control bridge's shots keep kShotW x kShotH and
their log line as it was (docs/control.md, tests/test_longshot_ctl.py); the
report's line names its picture and size.

tests/test_bug_report.py: its checks of shot_ask_next and shot_ask_record
name the new calls (shot_ask_as, blit_crop_to_rect), as they did the old.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
First-time contributor

Tested in game: Windows 11 Pro (26300), RTX 4070, NVIDIA 616.56, on a 3440x1440 monitor in fullscreen (Aspect ratio 21:9, Output resolution 3440x1440, DLSS, DLSS FG 2x, Reflex): in play in Kokiri Forest (kokiri-start save), Insert menu > Gameplay > Bug report saved with main's renderer and with this one in the same game folder. main: picture.png 1280x720, squeezed (0.372 across, 0.5 down). This PR: 1280x536 (0.3721 across, 0.3722 down), the same spot, report.txt and the log written as before.

Tested in game: Windows 11 Pro (26300), RTX 4070, NVIDIA 616.56, on a 3440x1440 monitor in fullscreen (Aspect ratio 21:9, Output resolution 3440x1440, DLSS, DLSS FG 2x, Reflex): in play in Kokiri Forest (kokiri-start save), Insert menu > Gameplay > Bug report saved with main's renderer and with this one in the same game folder. main: picture.png 1280x720, squeezed (0.372 across, 0.5 down). This PR: 1280x536 (0.3721 across, 0.3722 down), the same spot, report.txt and the log written as before.
enum changed title from WIP: fix(bug-report): the report's picture keeps the screen's shape to fix(bug-report): the report's picture keeps the screen's shape 2026-11-16 15:06:14 +00:00
enum changed title from fix(bug-report): the report's picture keeps the screen's shape to WIP: fix(bug-report): the report's picture keeps the screen's shape 2026-11-16 15:06:31 +00:00
Author
First-time contributor

@Beanstalk linux, any GPU: build the renderer from this branch (RX_VK_ONLY=1 python -I nx2/build.py --standalone) and say whether it compiles and links with no new warning in gpu/vk/vk_replay.cpp. If a game folder is at hand, save an Insert menu > Gameplay > Bug report on a screen that isn't 16:9 and give picture.png's size (expected: the screen's shape, 1280x536 at 21:9).

@Beanstalk linux, any GPU: build the renderer from this branch (RX_VK_ONLY=1 python -I nx2/build.py --standalone) and say whether it compiles and links with no new warning in gpu/vk/vk_replay.cpp. If a game folder is at hand, save an Insert menu > Gameplay > Bug report on a screen that isn't 16:9 and give picture.png's size (expected: the screen's shape, 1280x536 at 21:9).
Member

@enum only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it.

@enum only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/bug-report-picture-shape:enum-fix/bug-report-picture-shape'
git switch 'enum-fix/bug-report-picture-shape'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1143
No description provided.