WIP: fix(vk): preserve FSR HUD marking at reduced output resolution #2204
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2204
Loading…
Reference in a new issue
No description provided.
Delete branch "futondestroyer/Longshot:codex/fsr-sdr-hud-crop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
TL;DR
Keep the HUD sharp when FSR 3.1 frame generation interpolates a game image smaller than the present texture. At 2048×1152 inside a 2560×1440 SDR present, the stock renderer marked 0 of 600 frames and the fix marked all 600. The stock generated frames doubled hearts and broke up the area title during a camera turn. The fixed frames kept the HUD sharp. Restoring that work cost 0.22 ms at median on the frame-generation GPU pass and 81 MiB in Longshot's private renderer image allocations on the RTX 4070. The reported RX 9070 XT and FSR 4 Balanced setup still needs a run.
Summary
At 2560×1440, use reduced Output resolution 2048×1152 and FSR 3.1 frame generation. Turn the camera while the HUD and an area title are visible. The generated frames can drag the hearts, map and text along with the scene. The game's upscale and HUD draw into a 2048×1152 picture. The renderer was comparing that capture's size against the 2560×1440 present texture, so it skipped the HUD mask and learned transparency layer.
Accept a compact capture when it exactly covers the present's zero-origin crop. Allocate and copy the before and after images at the capture's own extent. An unaligned or mismatched capture continues to use the existing fallback. The Native HDR change from #2169 still uses the presented PQ pixels through the HUD mask. Start in
hud_sourceingpu/vk/vk_framegen.cppand the source-backed fixture intests/test_fsr3fi_hud_mask.py.The current head
972bbde6incorporates the Guide and website follow-up fromca9ca150. The Guide source review preserves the existing Graphics screenshot captured at124e4a4d. The settings parser now accepts the registered Simulated turf settings page and uses its shared help. The Controller speaker prose now uses neutral character and instrument terms. The renderer, host, game tests, build scripts and runtime inputs match87c521da.See the SDR reproduction in #1896.
Testing
Tested:
Windows 11, RTX 4070, NVIDIA 621.01. Compared exact main
a2dc5385and candidate87c521dausing the same verified API 44 host and paired renderer packs. Both used the child Market checkpoint, a 2560×1440 SDR present texture, the 2048×1152 crop, FSR 3.1 upscaling with 1906×1072 depth and motion, and 2× FSR 3.1 frame generation. Both comparisons reproduced missing HUD marks and layers on stock and restored them on the candidate. In paired local readbacks during the Hyrule Castle Town entrance camera turn, stock doubled the hearts and distorted the title and nearby text. The fixed generated frame kept those elements sharp while the scene moved. Both exited cleanly. The two rows in the Windows frame comparison show the same route and camera stimulus, with each generated result beside its ending real frame.The regression at
81150d05fails on the exact 2048×1152-at-origin case and passes with87c521da. Separate mutations fail when the copy uses the backing texture's larger extent or when a compact capture at a nonzero offset is accepted. The fixture also covers Native HDR mask routing. Independent source review cleared the bounds and lifetime changes. The Windows renderer linked and passed the export check.The six focused strict checks pass on both pins. The strict HUD-layer and HUD-less color checks require glslang, which is unavailable on this PC. Both math checks and their embedded shader source hashes pass when run directly. Pinned Ruff 0.12.0 and diff whitespace checks passed.
The split strict Windows inventory reported 841 passes, 59 failures and one timeout. Every named failure and the
test_cv_handoff_threads.pytimeout reproduced on stock. The Windows skip list carried 50 entries. The isolatedtests/test_job_queue.pyrunner exited before emitting a result on both revisions. The focused results above include the modified HUD regression.On exact
972bbde6, the production website built and its static publication check passed. Node reported 92 of 93 passing, including the settings parser cases and public-copy checks. The sole failure reproduces ona2dc5385: the save ZIP fixture expects LF from Python, which emits CRLF on Windows. The Longshot Guide asset and source-review checks passed. Launcher UI source review was outside the local checkout.Native HDR was requested in a private Windows run. The display exposed no HDR10 surface with Windows HDR off, so the game opened a 2560×1440 SDR swapchain. Native PQ gameplay remains open.
Checks with the same failed or timed-out outcome on stock
- `nx2/test_import_windows.py` - `nx2/test_nup_codec.py` - `nx2/test_nup_read_name.py` - `nx2/test_nup_stand_in.py` - `nx2/test_nup_verify.py` - `tests/test_auto_handheld.py` - `tests/test_build_long_paths.py` - `tests/test_close_waits_for_save.py` - `tests/test_cmpflags.py` - `tests/test_compile_zero_byte.py` - `tests/test_crash_dialog.py` - `tests/test_cv_handoff_threads.py` - `tests/test_damaged_rom_files.py` - `tests/test_dev_ab.py` - `tests/test_dev_build.py` - `tests/test_dev_migrate.py` - `tests/test_dev_packs.py` - `tests/test_discover.py` - `tests/test_draw_stream_visibility.py` - `tests/test_fastfp_fma.py` - `tests/test_float_add_subgroup.py` - `tests/test_fma_soft.py` - `tests/test_fpx_sticky.py` - `tests/test_fpxkeep.py` - `tests/test_fs_save_commit.py` - `tests/test_fsr_uniform_ownership.py` - `tests/test_fsr3fi_hud_layer.py` - `tests/test_fsr3fi_hudless_colour.py` - `tests/test_game_menu_mouse_buttons.py` - `tests/test_guest_copies.py` - `tests/test_hold_toggle.py` - `tests/test_input_movie.py` - `tests/test_insn_fixed_convert.py` - `tests/test_lift_lookups.py` - `tests/test_linux_preflight.py` - `tests/test_lower_atomg_cas.py` - `tests/test_make_game_cache.py` - `tests/test_menu_i18n.py` - `tests/test_menu_keys.py` - `tests/test_menu_slider_ends.py` - `tests/test_native_zstd.py` - `tests/test_nfc_model_info.py` - `tests/test_pads_after_menu.py` - `tests/test_perf_report.py` - `tests/test_prompt_guide_lines.py` - `tests/test_prompt_hand_guides.py` - `tests/test_prompt_picture_tint.py` - `tests/test_prompt_speed.py` - `tests/test_recording_admission.py` - `tests/test_sampler_admission.py` - `tests/test_sdiv_overflow.py` - `tests/test_sim_turf_pools.py` - `tests/test_spawn_emit.py` - `tests/test_switch_table.py` - `tests/test_tls_objects.py` - `tests/test_vbytes.py` - `tests/test_vecfp.py` - `tests/test_vfpx_elem.py` - `tests/test_vibration_menu.py` - `tests/test_walk.py`Still to test:
Measurements
Verdict: Both builds generated 600 FSR frames in each settled sample. The fix restores HUD marking and the learned transparency layer for all 600 reduced-output presents.
Setup: Windows 11, RTX 4070, NVIDIA 621.01. The same host, checkpoint, output crop and FSR settings are listed under Tested. The game-free test runs the same routing logic against the test-only revision on main and the fix.
a2dc538587c521daTiming setup. Optimized Windows builds of the same two revisions, API 44 host, Market checkpoint, SDR, 2× FSR 3.1 frame generation and a 60-fps cap. Each output size used two interleaved 18-second warmed runs per arm. All eight ran at 60.00 game fps. One additional attempt was excluded after it showed shader and pipeline work. Application timings come from native present-call returns. GPU timings cover the dedicated frame-generation recording.
a2dc538587c521daAt full output, both builds already marked and layered every generated frame. GPU time and image allocation stayed steady. One patched full-output run had a slower present-call tail. Its two p99 samples were 17.464 and 18.582 ms. Driver process-memory sample medians overlapped across runs at each size. The driver estimates are inconclusive.
Risks
The reduced-output path now runs the existing HUD copy and fit work where it was previously skipped. It allocates the before and after images at the actual capture size. Compact captures with a different origin or extent fall back. Reverting the change restores the previous path. Saves, settings, and caches need no migration.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows 11, RTX 4070 (NVIDIA 621.01), child Market entrance. Compared main
a2dc5385and this renderer at87c521dawith the same Windows API 44 host, SDR 2048×1152 cropped from a 2560×1440 present texture, FSR 3.1 upscaling, and 2× FSR 3.1 frame generation. Stock doubled the hearts and distorted the area title in the made frame while turning the camera. The fixed made frame kept them sharp. In settled 600-present samples, both made 600 FSR frames, and the HUD mask and layer each went from 0 on stock to 600 on the fix. Both test runs exited cleanly. The reported RX 9070 XT and FSR 4 Balanced setup still needs a matching run.@review
Recommendation: Request changes. The reported Windows NVIDIA comparison shows the reduced-output HUD fix working, but its GPU time and memory cost and behavior on other affected systems remain unmeasured. (It stands on L3: The check
Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 16s.)Accepts a zero-origin capture matching the presented crop, so FSR frame generation can mark and reconstruct the HUD at reduced output resolution. It restores the existing HUD processing path there, at the cost of additional GPU work and images.
@fixwill do (3)gpu/vk/vk_framegen.cpp:1451: Batch or reduce the newly enabled per-frame GPU work if measurements identify a material cost.Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 16s.CI / Website build and checks (pull_request)fails on this head and passes on the base branch: Failing after 56s.Before merging: testing (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_framegen.cpp:1451: This enables the after-copy, mask, learned-layer and per-generated-frame composite work for reduced output, but the comparison reports only marking counts. (more on the line)gpu/vk/vk_framegen.cpp:1451: The new crop path has only an SDR Windows NVIDIA game run. (more on the line)More: does it help, other systems, switches, what was read
Does it help: Yes, for the tested Windows RTX 4070 SDR setup: the reported paired comparisons changed HUD marks and learned layers from 0/600 to 600/600 presents, with sharper hearts and title text. The reported RX 9070 XT and FSR 4 configuration remains untested.
Other systems: The changed path is used by FSR 3.1 frame generation across Vulkan vendors and operating systems. The fixture covers compact Native HDR routing and rejected offset crops, but does not execute Vulkan or establish visual correctness on AMD, Linux or Steam Deck. Full-sized output remains a needed control.
Switches: None added, changed or removed.
Reviewed:
87c521dae2againsta2dc538590: Read the diff, commits, repository contribution rules, pull request template, HUD capture and generation code, fixture, present rectangle helper, relevant caller and HUD shaders. Skimmed the remaining frame generation implementation and standards. The separate review checklist and adjacent Tooling checkout were absent. No recorded runs, translations or generated files were changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code, tests or project scripts were run. The supplied CI reports two head-only failures, which the review bot records separately.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -1449,1 +1449,3 @@if (!fresh || hud.failed || !hud.picture || hud.pw != sw || hud.ph != sh || !fsr3fi::frames_wanted() ||// Reduced output can draw the scene and HUD in a compact picture before presenting a crop of a larger texture.const bool covers_present = hud.pw == sw && hud.ph == sh;const bool covers_crop = x0 == 0 && y0 == 0 && hud.pw == w && hud.ph == h;L1 (minor): This enables the after-copy, mask, learned-layer and per-generated-frame composite work for reduced output, but the comparison reports only marking counts. Measure average and 1% low FPS, frame times and VRAM against the base in the target scene with the same settings, including a representative constrained GPU.
L2 (minor): The new crop path has only an SDR Windows NVIDIA game run. Verify the reported RX 9070 XT and FSR 4 case at 2× and 4×, and exercise reduced and full output on Linux AMD and NVIDIA, Steam Deck, and Native HDR where supported; compare the HUD with frame generation off.
@fix
Recommendation: Approve. The code is ready: only testing is left. The Windows NVIDIA run shows that the fix restores HUD marking and keeps the HUD sharp in the reported reduced-output scene. Its GPU cost and behavior on the other affected Vulkan and HDR paths remain unverified. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
ca9ca150ca. It was already up to date withmain. I edited its description to match the change.Changed
Left for the author
Nothing was built or run: the checks run again on the new head.
The renderer accepts a matching zero-origin compact HUD capture and copies it at its own size, restoring HUD masking for reduced output. It enables additional GPU work on that path; its performance and memory cost are not yet measured.
Before merging: testing (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_framegen.cpp:1451: This enables the after-copy, mask, learned-layer and per-generated-frame composite work for reduced output, but the comparison reports only marking counts. Measure average and 1% low FPS, frame times and VRAM against the base in the target scene with the same settings, including a representative constrained GPU.gpu/vk/vk_framegen.cpp:1451: The new crop path has only an SDR Windows NVIDIA game run. Verify the reported RX 9070 XT and FSR 4 case at 2× and 4×, and exercise reduced and full output on Linux AMD and NVIDIA, Steam Deck, and Native HDR where supported; compare the HUD with frame generation off.Checks: they run again on this head (
Guide screenshots / Guide images and local UI source review (pull_request),CI / Website build and checks (pull_request)failed on the last one); a failure shows on the pull request.Also noticed (4; not asked for, not blocking)
87c521da, while the checkout includes a later documentation and website commit, 2f12a792.More: does it help, other systems, switches, what was read
Does it help: Yes: the reported paired Windows RTX 4070 comparison went from 0/600 to 600/600 HUD marks and learned layers, with the visible HUD artifacts fixed. The performance and VRAM cost is unmeasured.
Other systems: The path also affects AMD and NVIDIA Vulkan on Linux, Steam Deck and Native HDR; the requested comparisons remain outstanding. The website settings parser and guide screenshot source records also change.
Switches: None.
Reviewed:
ca9ca150caagainsta2dc538590: Read the repository rules and PR template, the renderer change and its HUD capture and present callers, the website settings parser and test, and the changed screenshot review. Skimmed the manifest fingerprints and recorded test results; the full renderer and fixture output was truncated.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run tests were executed. The author reports the paired Windows game run and focused regression results; CI is not yet reported for the supplied head.
Overlaps and merge order: none found
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
Windows 11, RTX 4070, NVIDIA 621.01. Both rows show the same child Market entrance route and right-stick turn with the area title visible. The top row is main
a2dc5385, and the bottom row is the renderer fix at87c521da. In each row, the left image is the ending game frame and the right image is its FSR 3.1 generated frame. Both runs used 2× frame generation and a 2048×1152 crop inside a 2560×1440 SDR present. Compare the hearts and area title across each row.Pushed
972bbde6with two Controller speaker wording changes to clear the website's branding check. It keeps the previously reviewed Guide and Simulated turf parser changes. The renderer and host match the Windows-tested87c521da.The local website built and passed the publication check. The node suite passed 92 of 93 checks, with the same save ZIP newline assertion failing on Windows main. The Guide check passed for Longshot inputs. The description records the Windows timing and memory comparison, the paired frame evidence, and the remaining platform and Native HDR checks.
@Beanstalk
Beanstalk test farm · ⛔ can't be tested as asked
Commit
972bbde· approved by llun (untrusted) · dashboardNot run: the farm can't test this as asked, so nothing is built or run:
⚠️ Note: FSR 4, Native HDR display verification and generated-frame visual comparisons are not available in this farm plan.
⚠️ Note: The HUD-marking log can also appear on the existing full-size path, so its presence would not prove the changed crop path ran.
What it could test instead: The alternative plan would run a hidden-window FSR 3.1 frame-generation smoke test at the child Market entrance, turning the camera on main and the PR. In about 20 minutes per tester it would measure frame times and VRAM and report whether HUD marking was logged; a crash or the specified performance regression would fail. It cannot reproduce or judge the requested reduced-output HUD fix.
A member of
BigBeanscan comment@Beanstalk <new words>to ask for something else, or@Beanstalk test it anywayto run the plan regardless.The reduced-output crop fix is proven for the SDR 1152p report, not for #1896's Native HDR case.
The measured case is 2048×1152 inside a 2560×1440 SDR present on an RTX 4070; the Native HDR attempt opened an SDR swapchain, and #1896 is the Native HDR report. The sentence "The Native HDR change from #2169 still uses the presented PQ pixels through the HUD mask" is a routing statement, not a result: the fixture's
pq=truecase checksgiven.hud_mask,given.color == hud.source.viewand that no HUD layer fit ran (fits.size() == fits_before), but it never sees a PQ present or a generated frame. Say "the mask routing is unchanged" and put #1896's Native HDR case first in the limitations; the linked #1896 comment 71454 is the SDR reproduction, not the Native HDR report.The crop itself reads right.
covers_croprequiresx0 == 0 && y0 == 0 && hud.pw == w && hud.ph == h, allocates the before/after images athud.pw/ph, and copies that extent. The test fails on main at the exact 2048×1152-at-origin case and rejects a nonzero origin and a one-pixel mismatch; thecovers_presentpath keeps the old full-size behaviour.Default: the new path is on unconditionally (no switch); the measured cost is +0.22 ms at median and +81 MiB of private renderer images on the RTX 4070 only. Lower-memory GPUs, AMD/RX 9070 XT, FSR 4 Balanced and Native HDR are still in Still to test. The full-output table's application row is worse on the patched side (1% low 57.07 → 55.54 fps, present p99 17.524 → 18.023 ms); the note explains one p99 sample but gives no spread for the 1% low. Call the full-output app result inconclusive or re-measure it; the GPU time and image allocation are steady.
No approval, no fix claim; the SDR reduced-output regression is real and the test would fail on main, but the Native HDR evidence is not there yet.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.