feat(render): preview eligible Output resolution changes in play #1859
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1859
Loading…
Reference in a new issue
No description provided.
Delete branch "futondestroyer/Longshot:codex/live-output-resolution"
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
Allow live resolution changes from the settings menu without requiring a restart. All eight gameplay cases passed on Windows 11 with an RTX 4070. Review is open. No test results are recorded for this head on Windows AMD RX 6000–9000, Steam Deck, or desktop Linux with NVIDIA or AMD. Those systems still need coverage before merge. Guide review, current-revision screenshots, and maintainer approval are also open.
Summary
Eligible Windows Vulkan players can preview 1024×576 from 1280×720 in the Insert menu. Keep changes opens after FIFO reports a shown frame at the requested size. Yes saves the new size. No, Back and the ten-second timeout restore the previous output. Configurations that cannot preview use the existing restart flow, including writable linked options files.
The control bridge's
game_picturefield reports the last native source submitted to the renderer, which can be 1024×576 during a dropped trial while the display still shows the prior frame. The menu locks output and preview-dependent edits while a trial is pending. If a later native window rebuild restores the running size, the saved choice remains pending restart. The preview uses renderer API version 41, after version 40's Sprint Toggle binding, and keeps the Sprint bindings and layout transaction. Start withgpu/vk/vk_menu.cpp,gpu/vk/vk_replay.cppandhost/nvn_native.c.Testing
Tested: Both Windows modules built at stock
6e1521a7and candidate4df62273and matched their recorded SHA-256 values. Stock reached the Kokiri checkpoint at native 1280×720 and exited cleanly. The candidate showed Keep changes in the real Insert menu on Windows 11, RTX 4070, NVIDIA 621.01 and Vulkan FIFO. The hearts stayed visible after the keyboard tap with confirmation open. No restored native 1280×720 and retired the trial. A second preview accepted Yes and saved 1024×576. Physical F9 presses hid and restored the HUD after the menu closed.All 14 focused Windows checks passed, including Sprint, background input, save handling, output trials and presenter ordering. The linked-options regression failed on the preceding code and passed with the admission fix. Windows denied creating a real file symlink in the disposable run directory, so linked options were covered with the game-free fixture. An independent review of the tested source maps verified its v39 host table boundary and unchanged Sprint bindings. Moving that revision's callback copy boundary back to v39 failed the test; this does not verify the current v41 boundary. The extracted HUD check accepted fresh keyboard and pad presses outside the modal and blocked both while it was open. Deliberately bypassing either gate failed the corresponding assertion. Pinned Ruff and whitespace checks passed.
All eight gameplay cases passed with exit 0. Keep preserved 1024×576 through Kokiri → Hyrule Field → Kokiri and on a fresh launch. No, the ten-second timeout and an unshown trial restored native 1280×720 without changing the saved setting. Second-image allocation refusal and synchronous rendering used the restart flow. Native rebuild after Yes restored the running picture to 1280×720, retired the preview backing and retained the saved 1024×576 choice. The first scripted Keep missed the confirmation while two test windows were rendering. The same binaries passed in the sequential retry.
The strict Windows inventory completed all 901 stock checks and 904 candidate checks. Stock recorded 769 passes, 83 failures, one timeout and 48 skips. The candidate recorded 773 passes, the same 83 failures, and 48 skips. The candidate passed the stock-only seed-reader timeout. There were no candidate-only failures.
Failures shared by both Windows revisions
tests/test_appimage_player_build.pytests/test_auto_handheld.pytests/test_bug_report_defaults.pytests/test_capture_read_once.pytests/test_capture_readback_visibility.pytests/test_crash_dialog.pytests/test_crash_record.pytests/test_crt_options.pytests/test_damage_debug_menu.pytests/test_dev_ab.pytests/test_dev_build.pytests/test_dev_migrate.pytests/test_dev_packs.pytests/test_device_lost_exit.pytests/test_display_startup_failure.pytests/test_dlss_feature_size.pytests/test_draw_binds.pytests/test_draw_stream_visibility.pytests/test_failed_compile_keeps_objects.pytests/test_fastfp_fma.pytests/test_flush_nothing_held.pytests/test_fma_soft.pytests/test_fpx_sticky.pytests/test_frame_overlap.pytests/test_fsr3fi_hud_layer.pytests/test_fsr3fi_hudless_colour.pytests/test_fsr_image_retirement.pytests/test_fsr_uniform_ownership.pytests/test_game_menu_mouse_buttons.pytests/test_gpu_wait_stats.pytests/test_guest_imported.pytests/test_high_fps_fixes.pytests/test_host_guest_writes.pytests/test_job_queue.pytests/test_libc_hooks.pytests/test_lift_cache.pytests/test_linux_preflight.pytests/test_linux_pressure.pytests/test_low_vram_texture_mips.pytests/test_make_game_ngx.pytests/test_mesh_conv.pytests/test_mise_build.pytests/test_missing_nup.pytests/test_mods_list.pytests/test_ngx_sdk.pytests/test_oot_shadow_fit.pytests/test_pads_after_menu.pytests/test_pass_barrier.pytests/test_pending_guest_import.pytests/test_perf_report.pytests/test_pipeline_play_cache.pytests/test_prepare_cache_save.pytests/test_present_queue_default.pytests/test_present_source_crop.pytests/test_profiling_mode.pytests/test_psychov35_fsr3_fg.pytests/test_readback_timeout_source.pytests/test_recorder_own_idle.pytests/test_recorder_sync.pytests/test_recording_admission.pytests/test_reflex_swapchain_lifetime.pytests/test_renderer_new_handler.pytests/test_renhdrum.pytests/test_replay_write_order.pytests/test_sampler_admission.pytests/test_sdiv_overflow.pytests/test_slow_frames.pytests/test_song_note_cue.pytests/test_sparse_mirror.pytests/test_spawn_emit.pytests/test_staging_burst.pytests/test_target_reuse_memory.pytests/test_texel_buffer_ownership.pytests/test_ub_update_batch.pytests/test_ui_record.pytests/test_upscaler_rows.pytests/test_vbytes.pytests/test_vcore_escape.pytests/test_vcore_mask0.pytests/test_vecfp.pytests/test_vfpx_elem.pytests/test_vk_occlusion_queries.pytests/test_walk_key.pyThe approved paired screenshots keep their historical pins. Approved Kokiri captures
Still to test:
gpu/render/rx_nvn.h, which adds a preview-slot marker to native textures. The real Windows Graphics view retains the restart-only help text even when live preview works. The Linux-only canonical capture could not run on this PC. Guide refreshMeasurements
Verdict: All eight application samples averaged 60.00 fps at a 60 fps cap. PresentMon produced no usable displayed-frame intervals.
Setup: Same Kokiri checkpoint and 1280×720 FIFO window on Windows 11, RTX 4070 and NVIDIA 621.01. We used two interleaved pairs per output size and measured warmed 18-second samples. At 1024×576 stock selected the size at boot and the candidate selected it live with Yes. The table uses the median of two runs per side. The binary-size rows come from the exact optimized builds, which reused prior objects.
6e1521a74df62273The native preview reserves 7,929,856 guest bytes per session and stages 7,864,320 bytes of Vulkan images.
RX_VK_OUTPUT_PREVIEW_TESTandRX_VK_MENU_SCRIPTare off by default.Three existing switches affect eligibility.
HOS_HEADLESSdefaults to off because confirmation needs a displayed frame.HOS_MEMINFO_OLDdefaults to off so the game accounts for mapped pages, including the preview reservation.HOS_OUTPUT_RESdefaults to unset so the menu and options file select output. Setting it overrides the menu for that launch.Risks
Live preview depends on the recognized native window, ordered rendering, a supported FIFO present-wait path and writable regular options storage. Yes changes
output_resin the options file. If the running picture later rebuilds at the original size, the selected size stays saved for the next restart. The guest reservation stays charged until exit.Checklist
Ready for review
main; the title is a Conventional Commit. Tested main is6e1521a7.mise run testpasses (any failure that also fails onmainis named). Windows comparison above.main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def.tests/that reads changed source is updated, and its assertions are preserved.MKWVK_API_VERSIONbumped for the host and renderer previews.mainand here, for a change that shows on screen. The approved captures retain their older pins.Assisted-by:trailers. Carry BeanBot's assistance on follow-ups17c7b2b1,3a972864,9f04de12and754b73b1into the squash commit.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Ocarina of Time on Windows 11 26H2, RTX 4070, NVIDIA 621.01, FIFO V-Sync. Eight runs passed on 7c7ec81c. The confirmation opened after a shown frame from the matching native backing. Yes kept 1024x576 through Kokiri Forest, Hyrule Field and a fresh launch. No, Escape, timeout, forced no-frame and second-image allocation failure restored or preserved 1280x720 and the original settings. Boot-storage refusal and synchronous rendering used the stock restart path. The PR head adds a user-guide clarification.
Possibly related, for context:
Pinned-main verification on
65488813is complete. The exact published head completed the strict Windows inventory with 751 passes, 71 failures also present on main, and 48 skips. The private integration passed the live transition, repeated rollback, forced failure, and non-ASCII Windows path checks. Two interleaved pairs per condition stayed at 60 fps, and application-frame p99 differed by less than 0.1 ms at both matched output sizes. The description records the two build revisions and remaining checks.Earlier same-scene captures from the Kokiri Forest save on Windows and RTX 4070. These show the revisions named below, before the branch refresh.
Main
65488813f0at stock 1280×720 output.Private integration 127a8d6c06ee4df579b4ee0f3fa8b5bc4b33dc80 of published head
20e8c3a61fonto that main. The native picture is 1024×576 with the live confirmation visible in the 1280×720 window.20e8c3a61f9af66e3c49Rebased
20e8c3a6onto89c3d21eas9af66e3c. The feature patch is identical. Exact Windows builds, eight gameplay cases and eight paired timing runs passed. The strict Windows comparison found the same 73 failing checks on both revisions. Both added checks passed.Application-frame p99 was 18.25 → 18.05 ms at 1280×720 without a preview and 18.03 → 18.06 ms at 1024×576 after live confirmation. Every run held 60 fps. PresentMon returned no valid displayed-frame sample set.
This stays WIP for Linux host build evidence and Guide CI. The approved Kokiri comparison records its earlier source revisions. Approved screenshots
Same Kokiri Forest checkpoint, player position, and camera on Windows Vulkan. Both captures are 1280×720.
e0ef1b5721083b65a0ccc2eee9aad14482a44b9fwith native output at 1280×720.8600771bb5613b95a4cac3783d70563469e898d4with native output at 1024×576 during the live preview. The game log confirmed the matching FIFO shown frame before the confirmation opened.9af66e3c498600771bb5Refreshed to
8600771bon tested maine0ef1b57. The exact Windows builds and all eight gameplay cases passed. The condition-variable timeout passed its focused rerun.The two matched timing pairs per size gave application p99 of 18.62 → 18.19 ms at 1280×720 and 18.20 → 18.10 ms at 1024×576. PresentMon had no usable display intervals. Verified paired captures
Main advanced to
3df5c13e. Its acquire-ahead change conflicts ingpu/vk/vk_replay.cpp. The exact follow-up also needs HUD interaction coverage. Guide visual review, Linux host-build evidence, and external hardware coverage remain open. The PR stays WIP.Could independent BigBeans review the Windows AMD and Steam Deck scope below for the current PR head
4df622732cc8ddf4ce71c156605a9e0848d57e15on main6e1521a70a32603ed60a8263e4072625885669b7? The supported farm check compares separate boots. Check live confirmation and relaunch persistence by hand on eligible Windows hardware. Check the restart flow by hand on Steam Deck. The test of this lift change requires two independent BigBeans.@rebase
I rebased this pull request onto
main(3df5c13ed2): the new head isad7407163a.Conflicts resolved:
Nothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by futondestroyer. Nothing was run; a maintainer decides.
8600771bb5ad7407163aWIP: feat(render): preview eligible Output resolution changes in playto feat(render): preview eligible Output resolution changes in playRecommendation: Request changes. A fresh installation can show the confirmation but cannot keep the selected resolution, and some unsupported guest states silently discard the requested change instead of offering the restart flow.
The change previews a 1280×720 to 1024×576 output change on eligible Windows Vulkan setups and adds confirmation and rollback. It reserves about 7.6 MiB of guest storage for the session and allocates about 7.5 MiB of Vulkan images during a preview. The two failure paths in blocking need changes before merge.
Does it help: Unproven on the rebased head. The author reports eight successful gameplay cases on candidate
8600771band two interleaved timing pairs per size againste0ef1b57: application p99 was 18.62→18.19 ms at 1280×720 and 18.20→18.10 ms at 1024×576. Those runs predate headad740716and its acquire-ahead conflict resolution; displayed-frame intervals were unavailable.Other systems: Windows NVIDIA was tested before the rebase. Windows AMD confirmation and persistence, Steam Deck restart fallback, Linux host build and UTF-8 paths remain unverified. The changed guest memory accounting and presentation handoff also affect work outside the confirmation itself; the reported capped application timings do not establish displayed-frame pacing.
Switches: RX_VK_OUTPUT_PREVIEW_TEST is added as an off-by-default diagnostic for reservation, allocation and no-frame failures; that default is appropriate. RX_VK_MENU_SCRIPT remains off by default and gains a confirm: prefix. Both have switch-table entries.
Reviewed:
ad7407163aagainst3df5c13ed2: Read AGENTS.md, CONTRIBUTING.md, the PR template, relevant standards, the main preview-controller and guest-handoff changes, the menu diff, atomic-file helper, and the new output-trial test. Skimmed the remaining diff, recorded runs, translations and other tests; the large changed code files and all dependent callers were not read in full. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Blocking (to change before merge)
Suggestions (the author may take or leave)
Testing: Read-only review; no project code, builds or tests were run. git diff --check reported no whitespace errors. Exact-head Windows gameplay, CI and measurements remain outstanding.
Overlaps and merge order: The supplied comments identify overlap with main's acquire-ahead change and the HUD change; the rebase resolution needs an exact-head run. The Guide refresh is PR #1501, with its visual comparison still open.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.
@ -1251,0 +1266,4 @@std::lock_guard lk(options_save_mu);const std::string path = ini_path();if (path.empty() || hos_af_is_link(path.c_str())) return false;FILE* f = fopen(path.c_str(), "rb");On a fresh user folder the options file may not exist, so Yes always fails and rolls the preview back. Could a missing file be treated as empty and created atomically, while actual read errors still fail?
@ -4408,6 +4506,20 @@ void menu_tick() {fullscreen_tick();game_lang_tick();outputs_follow_screen();if (output_preview_target.w) {The guest can refuse a request after the renderer accepted it, such as when the captured window no longer qualifies. This silently cancels the player's selection; could that refusal carry the selection into the restart flow, separately from No or a confirmation timeout?
@fix
I changed this pull request where the review's points could be done here (the rest needs runs, measurements or decisions): the new head is
964c909032.Changed
Left for the author
e0ef1b57at 1280×720 and 1024×576, including displayed-frame intervals where available, to establish the performance and pacing effect of the final changes.Nothing was built or run: check the change. It will be reviewed again.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Recommendation: Request changes. A preview that never reaches the screen can still save the new resolution. The renderer also reads past an older host’s callback table, and the rebase breaks the acquire-ahead regression fixture.
Eligible Windows Vulkan players can try 1024×576 without restarting. The FIFO receipt ties confirmation to a frame rendered from the preview’s backing. The feature adds 7.6 MiB of guest reservation for the session and 7.5 MiB of Vulkan image allocations when staging. Since review 1929, the head adds missing-file creation, restart fallback for asynchronous refusal, and input cleanup before opening either dialog.
Does it help: Unproven on
964c9090. The author reports eight successful gameplay cases on8600771band two interleaved pairs per output size againste0ef1b57on an RTX 4070. With the 60 fps cap, application p99 was 18.62 → 18.19 ms at 1280×720 and 18.20 → 18.10 ms at 1024×576. Those runs show the feature working on the earlier build. Displayed-frame intervals and 1% lows are missing, and the runs predate the acquire-ahead rebase and fallback fix.Other systems: The shared Vulkan present path serves NVIDIA, AMD, Intel and Linux, including frame generation and swapchain recreation. The new guest reservation can affect qualifying 720p Windows sessions even when no preview is requested. The control bridge adds native picture dimensions separately from swapchain size and changes how an existing setting command behaves. Windows AMD, Steam Deck, Linux builds and UTF-8 paths still need evidence on the resulting head.
Switches: RX_VK_OUTPUT_PREVIEW_TEST is added with an off default and a switch-table row. Off is appropriate for forced failure diagnostics. RX_VK_MENU_SCRIPT remains unset by default and gains a documented confirm: prefix. Existing HOS_OUTPUT_RES and HOS_MEMINFO_OLD overrides exclude sessions from preview reservation. The preview itself is enabled by eligibility checks.
Reviewed:
964c909032against3df5c13ed2: Compared964c9090with3df5c13eand checked the follow-up againstad740716. Read AGENTS.md, CONTRIBUTING.md, the Forgejo template, the standards, replay rules, and the changed implementation and fixture hunks with surrounding callers. Read the full new preview controller, persistence and control-picture fixtures in the diff. Skimmed translations and recorded runs. The large source files outside the changed and dependent sections, all callers, and external captures were not read in full. docs/review-checklist.md and the adjacent Tooling checkout were absent.; nothing run (a code review).Checked and fine:
Blocking (to change before merge)
Testing: Read-only review. git diff --check passed. No build, project script, test or game run was executed. Before merge, provide CI, a current-base Windows comparison with displayed pacing where available, NVIDIA and AMD confirmation and persistence, Toggle HUD with confirmation open, Steam Deck restart fallback, Linux and UTF-8 build evidence, and the Guide visual review. Record the build-time and size impact of the lift change required by the standards.
Overlaps and merge order: Main’s acquire-ahead and Toggle HUD changes are already in the base. Verify both on the final head. Guide refresh PR #1501 shares screenshot review inputs. The supplied record gives no required merge order for it.
Automated code review by BeanBot (gpt-6.2-sol), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
@ -4210,0 +4329,4 @@r.value == &opts.framegen || r.value == &opts.hdr || r.value == &opts.reflex || r.value == &opts.dlss))return bridge_fill(i, out), -1;if (r.value == &opts.output_res && output_choice(want) == want && request_native_preview(picture_for(want)))return bridge_fill(i, out), 1;option_set now replies success with the old value while waiting for a player. Preserve the bridge setter contract or return an explicit pending result clients can track.
@ -4411,0 +4537,4 @@else if (remaining == 0) {edit_end(false);listening = 0;unavailable_native_preview();A published trial with no FIFO receipt reaches this branch and saves 1024×576 without Yes. Keep an activated-but-unshown outcome through cleanup and roll it back without saving.
@ -5514,2 +5753,4 @@} // namespacebool output_preview_request(uint32_t width, uint32_t height) {if (!host->output_preview_request || !output_preview_path.load(std::memory_order_acquire)) return false;The loader accepts a v36 host, then copies the enlarged table from it. Bound the copy to the host’s ABI size, check v39 before using this callback, and preserve older renderer table offsets.
@ -5848,6 +6153,11 @@ static bool acquire_fence_ready() {}void present_image(VkImage src, uint32_t sw, uint32_t sh, const int crop[4], VkImageView view, bool source_srgb, bool allow_scale) {tests/test_present_acquire_ahead.py still extracts this wrapper and fails to find the acquire code. Update its extraction and hand-off fixture for the receipt argument while retaining the ordering checks.
@fix
I changed this pull request as the review asked: the new head is
a474b67500.Changed
Already done
Nothing was built or run: check the change. It will be reviewed again.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Recommendation: Request changes. A pending preview can overwrite a newer resolution choice, and a native rebuild can undo a resolution the player already confirmed. The acquire-ahead fixture still generates invalid C++ after the follow-up fix.
Eligible Windows Vulkan players can try 1024×576 from 1280×720 without restarting. The FIFO receipt ties confirmation to a displayed frame from the preview backing. The feature costs 7,929,856 bytes of guest reservation for the session and 7,864,320 bytes of Vulkan image allocations when staging. Since review 1934, the follow-up distinguishes an activated but unshown preview from staging refusal, bounds the host table copy, appends the renderer callbacks, and restores synchronous output changes through the control bridge.
Does it help: Unproven on
a474b675. Eight reported gameplay cases passed on8600771b. Two interleaved timing pairs per size againste0ef1b57on an RTX 4070 gave application p99 of 18.62 → 18.19 ms at 1280×720 and 18.20 → 18.10 ms at 1024×576. All runs averaged 59.85–60.00 fps at the 60 fps cap. These runs predate the rebase and follow-up fixes. Displayed-frame intervals, 1% lows, heavy-scene timings, and clean-build time and size for the lift change are missing.Other systems: The shared Vulkan present and texture paths also serve Linux, Steam Deck, AMD, Intel, frame generation, and swapchain recreation. Linux is excluded from the guest reservation, but still uses the changed rendering paths. Recognized 720p Windows sessions can reserve memory even if the active renderer or display mode cannot preview. Dedicated allocation figures are available. Peak RAM and VRAM, the effect on guest allocation headroom, and displayed pacing on the rebased path are still open. The control bridge adds native picture dimensions at dispatch separately from window dimensions.
Switches: RX_VK_OUTPUT_PREVIEW_TEST is new and unset by default, which is appropriate for forced reservation, allocation, and no-frame failures. RX_VK_MENU_SCRIPT remains unset and adds the confirm: prefix. Both have switch-table entries. Existing HOS_OUTPUT_RES and HOS_MEMINFO_OLD now exclude preview reservation. The feature itself is enabled by eligibility checks.
Reviewed:
a474b67500against3df5c13ed2: Read AGENTS.md, CONTRIBUTING.md, the Forgejo template, the applicable standards and replay rules, the three commit messages, and the supplied comments and reviews. Reviewed the changed implementation hunks and surrounding menu, guest memory, native handoff, renderer ABI, texture retirement, and present code. Read the preview persistence and acquire-ahead fixture changes. Skimmed the remaining fixture changes, translations, and recorded run descriptions. Large source files outside the changed and dependent sections, some fixture hunks and callers, and external captures were not read in full. docs/review-checklist.md and the adjacent Tooling checkout were absent.; nothing run (a code review).Checked and fine:
Blocking (to change before merge)
Suggestions (the author may take or leave)
Testing: Read-only review. git diff --check was clean. No build, project script, or test ran. Exact-head Windows gameplay including Toggle HUD, AMD confirmation and persistence, Steam Deck restart fallback, Linux host build, UTF-8 paths, current-base measurements, and CI remain outstanding.
Overlaps and merge order: Main's acquire-ahead change is already in the base and its overlap was resolved by the rebase. Retest that integration with the HUD change on the resulting head. Guide refresh #1501 can reduce the visual review scope if it lands first. The Guide owner's comparison is still open.
Automated code review by BeanBot (gpt-6.2-sol), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
@ -1213,3 +1218,3 @@if (r.value == &opts.output_res) { // (smallest to largest: step_output_choice)v = step_output_choice(*r.value, dir);if (v == *r.value) return;if (v == *r.value || (keep && request_native_preview(picture_for(v)))) return;A second size edit can save normally while 1024×576 is staging. The first request can then overwrite it on Yes or staging refusal. Cancel the old request on a newer edit, or block output-affecting edits until staging resolves.
@ -2649,0 +2762,4 @@const uint64_t current = recomp_load64(c, detached_owner + 0x70);const int native_rebuild = __atomic_load_n(&detached_rebuild_pending, __ATOMIC_ACQUIRE) ||recomp_load8(c, detached_owner + 0xc8) || current != candidate_window;const int phase = rx_output_trial_phase(serial, detached_published && native_rebuild);A rebuild expires the trial even after Yes. The guest can return to 1280×720 while the menu and file report 1024×576. Carry the kept size through rebuild, or report the restored size and offer restart. Add a Keep-then-rebuild case.
@ -644,3 +649,3 @@def fixture(replay, windows, mode):present = block(replay, "void present_image(VkImage src,")present = block(replay, "void present_image_with_trial(VkImage src, uint32_t sw, uint32_t sh, const int crop[4], VkImageView view, bool source_srgb, bool allow_scale, OutputTrialSource trial) {")acquire = cut(present, " // (the presenter thread, RX_VK_PRESENT_THREAD: the present handed over",This slice now uses output_trial_skip_present and trial.native_generation, which the fixture lacks. The acquire-ahead slice below also pulls in an unmatched namespace close. Fix the extraction and stand-ins while keeping the ordering checks.
feat(render): preview eligible Output resolution changes in playto WIP: feat(render): preview eligible Output resolution changes in playa474b67500488752cc86Rebased onto
87c0d7b4as488752ccand addressed the three open review findings. Output, shape and preview-affecting settings are locked while a preview is pending. Native rebuild after Yes keeps the saved choice and makes it pending restart, using the next native texture to identify the running size. The acquire-ahead fixture now compiles and retains its ordering checks. Pending edit Native rebuild FixtureTen focused Windows checks passed on this exact head. The Windows Vulkan renderer built and passed its export check. The affected whole translation units passed LLVM-MinGW syntax checks against both pins. Independent source review found no remaining blocker in the three fixes. Two deliberate mutations failed at the expected rebuild assertions. Source review also checked the earlier fixes for fresh options files, pre-activation refusal, no shown frame, renderer ABI and bridge setter semantics.
This stays WIP while the exact Windows game pair and gameplay comparison run. Main advanced to
9bda94baduring validation. Its Vulkan memory and pipeline-cache changes merge cleanly with the checkpoint and remain outside its recorded evidence. Guide review, Linux host evidence and external hardware coverage remain open. Earlier gameplay and hardware scopeBoth exact Windows builds passed on
87c0d7b4and488752cc. All eight candidate gameplay cases passed on an RTX 4070 with NVIDIA 621.01 and Vulkan FIFO. Keep held 1024×576 through the Kokiri–Hyrule Field round trip and a fresh launch. No, timeout and the unshown trial restored the prior output. Allocation refusal and synchronous rendering kept the running picture and saved the restart choice.The native rebuild case deliberately requested a rebuild after Keep in a disposable session. The running picture returned to 1280×720, the preview backing retired, and the saved 1024×576 options file matched byte for byte. The condition-variable fixture passed on both revisions on rerun. The unchanged recording-admission fixture reproduced on both, and the semaphore fixture passed on the candidate.
The PR remains WIP for Toggle HUD while confirmation is open, latest-main validation, Guide review, independent approval and external hardware. Repair review Guide CI Existing hardware request
Finished the pinned Windows comparison of
87c0d7b4and488752ccin Kokiri. Two warmed interleaved pairs per output gave application p99 of 18.19 → 18.41 ms at 1280×720 and 18.52 → 18.70 ms at 1024×576. Average application fps was 59.99–60.00 across the eight arms. PresentMon produced no usable displayed-frame intervals.The PR remains WIP for the newer main, interactive HUD check, Guide review, independent approval and external hardware. Exact gameplay Guide CI
488752cc864df622732cRebased the preview onto
6e1521a7at4df62273. Sprint owns v39. The preview now uses v40 and the renderer stops copying older host tables before the new callback. Linked options use the restart flow. If an atomic save fails after Yes, the preview rolls back and logs the failure.Both exact Windows builds and all 14 focused checks passed. On the candidate in Kokiri Forest, the real Graphics menu showed the preview confirmation, a tap of the bound F9 left the hearts visible while it was open, No restored 1280×720, and a repeat followed by Yes retained 1024×576. Physical F9 presses hid and restored the HUD after the menu closed. The cold source check covered fresh keyboard and pad input outside the modal and suppression while it was open. Both deliberate breaks were caught.
The PR stays WIP while the full Windows matrix and timing finish. Guide #1501 still leaves one branch-specific source input for human review, and AMD Windows and Steam Deck remain with independent BigBeans. Guide refresh Hardware request
Finished Windows verification at
4df62273against6e1521a7. All eight gameplay cases passed, including Keep through the scene cycle, relaunch, timeout rollback and rebuild after Yes. The strict Windows inventory completed all 901 stock checks and 904 candidate checks. Stock recorded 769 passes, 83 failures, one timeout and 48 skips. The candidate recorded 773 passes, the same 83 failures, and 48 skips. The candidate passed the stock-only seed-reader timeout. There were no candidate-only failures.Two matched timing pairs per size averaged 60.00 application fps. Application p99 was 18.10 → 18.08 ms at 1280×720 and 18.09 → 18.37 ms at 1024×576. PresentMon produced no usable displayed-frame intervals.
The source and description remain WIP for Guide review, exact-head screenshots, independent review and external hardware. Guide CI Existing quoted hardware scope
WIP: feat(render): preview eligible Output resolution changes in playto feat(render): preview eligible Output resolution changes in play@review
Recommendation: Request changes. The Windows runs show that live preview can work, but a swapchain rebuild can let Yes save a choice whose confirmation is stale, and native rollback can stop presenting before it has a safe route back. The change also breaks the Linux options-save fixture.
Eligible Windows Vulkan players can try 1024×576 from 1280×720 and keep it without restarting. The feature adds a useful shortcut, but implements it through a game-specific window and texture swap that also changes guest memory accounting, presentation, and settings persistence.
@fixwill do (19)gpu/vk/vk_replay.cpp:6241: Validate the swapchain before taking confirmation input. (more on the line)host/nvn_native.c:2765: Do not expire a published candidate before establishing a safe native rollback. (more on the line)host/nvn_native.c:3004: Validate the lifetime and committed pages of the captured window and its textures before staging. (more on the line)gpu/vk/vk_replay.cpp:6239: Read preview eligibility through a synchronized snapshot. (more on the line)host/nvn_native.c:2869: Check effective renderer and storage eligibility before charging the boot reservation. (more on the line)gpu/vk/vk_texture.cpp:3032: Make allocation refusal recoverable throughout preview staging. (more on the line)gpu/vk/vk_menu.cpp:1359: Use the normal custom-output transaction when staging refuses. (more on the line)gpu/vk/vk_menu.cpp:4799: Handle mouse Back before the pending-preview cancellation check. (more on the line)tests/test_menu_save_atomic.py:386: This Linux fixture extracts save() but has no declaration for the new options_save_mu it uses. A normal non-root run fails to compile before it checks atomicity, symlinks, or Sprint persistence. Include the shared mutex declaration in the extraction or provide the mutex in the fixture.tests/test_capture_readback_visibility.py:42: Keep the capture visibility fixture's slices bounded to the code it exercises. Cutting from shot_pixels to do_present now pulls in the entire trial controller, and the fence slice now calls output_trial_skip_present with an undeclared trial. Extract shot_pixels by function boundary and stop the fence slice at its original end so the test can reach its stale-cache assertions.tests/test_preview_save.py:88: Honor CC in the new save and picture fixtures. (more on the line)gpu/vk/menu/output.cpp:409: The Graphics help still tells an eligible player that Output resolution applies after restart. The guide also tells players to enable Threaded rendering without saying that its change takes effect at the next launch. Update the two help surfaces to explain when preview is available and when restart is needed.17c7b2b1and3a972864have only a review link in their bodies. Carry the assistance attribution into the merge commit and make the checklist match the recorded attribution.gpu/vk/vk_replay.cpp:6606: Stage the backing before the present handoff or on a worker and report request-to-first-shown time, the longest displayed interval, and peak RAM and VRAM.nx2/oot_patches.py:1939: Log the lift, host build, and renderer build times separately so any increase can be traced to the changed step.Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 16s.PR description / Description follows the template (pull_request_target)fails on this head and passes on the base branch: Failing after 5s.CI / Website build and checks (pull_request)fails on this head and passes on the base branch: Failing after 18s.For the author (2) (a run, a measurement or a decision)
gpu/vk/vk_replay.cpp:6606: Measure displayed pacing across request, confirmation, and rollback. (more on the line)nx2/oot_patches.py:1939: Provide clean build time and size on both platforms. (more on the line)More: does it help, other systems, switches, what was read
Does it help: Yes for the feature on the tested RTX 4070. The author reports eight passing gameplay cases on
4df62273. Two warmed interleaved pairs per size against6e1521a7averaged 60.00 application fps at the cap. At 1280×720, p99 was 18.10 → 18.08 ms and the 1% low was 55.25 → 55.30 fps. At 1024×576 after Keep, p99 was 18.09 → 18.37 ms and the 1% low was 55.29 → 54.43 fps. The pacing cost is unproven. PresentMon supplied no usable displayed-frame intervals, and the warmed samples omit the transition. The reported reservation is 7,929,856 guest bytes per qualifying session and staging allocated 7,864,320 bytes of Vulkan images.Other systems: Linux and Steam Deck use the restart path but still share the changed memory HLEs, Vulkan presentation code, renderer ABI, and fixtures. Windows AMD and other Windows driver paths can pay the reservation cost even when live preview cannot run. HDR, Reflex, upscalers, generated presents, surface recreation, and acquire-ahead share the changed presentation path. The control bridge adds a source-size snapshot distinct from its existing swapchain size. Keep writes the options file and leaves gameplay saves alone. The lifter applies a new rebuild hook, so a clean game build matters alongside the renderer and host builds.
Switches: RX_VK_OUTPUT_PREVIEW_TEST is new and defaults off. Its reservation, allocation, and no-frame injections belong in tests. RX_VK_MENU_SCRIPT still defaults to no script and gains a confirm: prefix. Both defaults are appropriate and both rows are in switches.def. Existing controls now affect preview eligibility. HOS_HEADLESS defaults off, HOS_MEMINFO_OLD defaults off, HOS_OUTPUT_RES defaults unset, RX_VK_ASYNC follows Threaded rendering, RX_VK_FIFO and RX_VK_IMMEDIATE default to the V-Sync row, and RX_VK_REFLEX follows its menu row. Keep those defaults and use effective settings consistently when deciding whether to reserve memory and offer preview.
Reviewed:
4df622732cagainst6e1521a70a: Read AGENTS.md, CONTRIBUTING.md, the Forgejo template, the developer standards, all nine commits, and all 60 changed files at their changed sections. Read the three new fixtures and both changed API headers in full. Traced the surrounding guest allocation, queue, replay, texture, menu, ABI, and file-write paths. Skimmed the translation additions and supplied run history. No generated files changed. docs/review-checklist.md and the sibling Tooling checkout were absent. The linked captures and run artifacts were unavailable offline.; nothing run (a code review).Checked and fine:
Testing: Read-only source review and clean git diff --check. No builds or tests were run in this review. The author reports both pinned Windows builds, eight gameplay cases, and 14 focused Windows checks passing. The Windows inventory reports 83 shared failures and no candidate-only failures. The supplied CI failures are tracked separately.
Overlaps and merge order: Guide refresh #1501 overlaps screenshot source review. Review the combined Guide after #1501 lands or rebase onto it before signing off the screenshots. The Sprint v39 change is already in the pinned base.
Automated code review by BeanBot (gpt-6.2-sol), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -1261,0 +1356,4 @@static void unavailable_native_preview() {const Out selected = output_preview_target;answer_native_preview(false);opts.output_res = output_choice_of(selected.w, selected.h);L7: Use the normal custom-output transaction when staging refuses. If the player booted at a custom 1280×720 and types 1024×576 while that is also absent from the offered list, output_choice_of overwrites the custom slot still used by output_started. Returning to the starting aspect then selects the pending size instead of the running one. Share the existing transaction that preserves the running choice and updates the aspect and restart slots.
@ -4615,8 +4796,11 @@ void menu_tick() {if ((press[0] || press[6]) && debug_warning) {debug_warning = false;changed = true;} else if (output_preview_target.w && !output_preview_countdown && (press[0] || press[5] || press[6])) {L8 (minor): Handle mouse Back before the pending-preview cancellation check. A right click during staging is translated to Back only later in the options page, where it can close the menu without canceling the request. The confirmation can then reopen it. Route that click through the same cancellation path as keyboard and pad Back.
@ -5907,1 +6238,4 @@const bool preview_path = async_on() && dev.swapchain && dev.present_wait && dev.swap_mode == VK_PRESENT_MODE_FIFO_KHR &&!dev.hdr && !opts.hdr && !opts.reflex && !opts.dlss && !framegen_on() && !present_defer_into;output_preview_path.store(preview_path, std::memory_order_release);menu_tick();L1: Validate the swapchain before taking confirmation input. If the window is resized while Keep changes is open, this function can create a new swapchain and then process Yes using the old swapchain's receipt. Setting kept makes the generation check below skip cancellation. Invalidate or re-arm the confirmation before menu_tick, and require Yes to match the current swapchain generation.
@ -5907,0 +6236,4 @@// Ordered render jobs retire the preview after the copy has been submitted. On the game thread// retirement and the window copy could be handled by different threads.const bool preview_path = async_on() && dev.swapchain && dev.present_wait && dev.swap_mode == VK_PRESENT_MODE_FIFO_KHR &&!dev.hdr && !opts.hdr && !opts.reflex && !opts.dlss && !framegen_on() && !present_defer_into;L4: Read preview eligibility through a synchronized snapshot. The bridge can write opts.hdr, opts.reflex, and opts.dlss under menu_mu while the new predicate reads them before taking that lock. The atomic output_preview_path only publishes the result and does not protect those reads. Resolve the effective settings under the menu lock and publish one coherent eligibility result.
@ -6255,0 +6603,4 @@if (trial.generation) {const bool fifo_shown = hand_off && !pi.pNext && dev.present_wait && dev.swap_mode == VK_PRESENT_MODE_FIFO_KHR &&dev.swapchain && !dev.hdr && !opts.hdr && !framegen_on();frame = make_output_trial_frame(trial, dev.swapchain_generation, fifo_shown ? OutputPath::FifoShown : OutputPath::Unavailable);L15 (minor): Measure displayed pacing across request, confirmation, and rollback. Staging makes three images and views after the present copy is submitted and before handing it to the presenter, so the first transition can miss a FIFO refresh. The warmed Kokiri samples do not include that interval.
@ -2991,0 +3029,4 @@const VkFormatInfo f = vk_format(t.d.format);if (f.format == VK_FORMAT_UNDEFINED) return {};auto& owned = backing->images[i];create(Key{}, &t, f.format, false, 1, 1, 4, true, &owned);L6: Make allocation refusal recoverable throughout preview staging. The NewNothrow scope covers OutputTrialBacking, but create immediately calls make_unique outside it. Under host commit pressure the normal new handler can wait about five seconds and end the game before the preview can fall back. Use stack storage for the probe metadata or make the allocation nonfatal, and inject failure at this allocation in the fixture.
@ -2649,0 +2762,4 @@const uint64_t current = recomp_load64(c, detached_owner + 0x70);const int native_rebuild = __atomic_load_n(&detached_rebuild_pending, __ATOMIC_ACQUIRE) ||recomp_load8(c, detached_owner + 0xc8) || current != candidate_window;const int phase = rx_output_trial_phase(serial, detached_published && native_rebuild);L2: Do not expire a published candidate before establishing a safe native rollback. A rebuild can expire it here and then hit an alias or owner check that returns without restoring the stock window. The renderer drops every subsequent candidate present and the lift hook keeps deferring rebuild while the generation is published. Preserve presentation until a verified handoff can restore or replace the window, and test a queue or owner replacement during rollback.
@ -2649,0 +2866,4 @@const nvn_tex *t = win_tex(win, 0);if (!owner || !hos_mem_mapped(owner, 0xc9) || !t->pool || t->d.width != 1280 || t->d.height != 720 ||recomp_load64(c, owner + 0x70) != h2g(win) || recomp_load64(c, owner + 0xc0) != h2g(t->pool)) return;if (InterlockedCompareExchange(&detached_capture_claim, 1, 0)) return;L5: Check effective renderer and storage eligibility before charging the boot reservation. A 1280×720 run with Threaded rendering Off, no present-wait support, or linked options can still commit the extra pages and report them as guest memory in use for the whole session. Gate the reservation on the prerequisites known at startup and release it when the renderer establishes that preview is unavailable.
@ -2649,0 +3001,4 @@if (!__atomic_compare_exchange_n(&detached_ui_state, &requested, OUTPUT_UNAVAILABLE, 0,__ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) return;const nvn_win *win = hos_guest_range(detached_original, sizeof *win);if (!win || !hos_mem_mapped(detached_original, sizeof *win) || win->magic != NVN_MAGIC('W', 'I', 'N', 'D') ||L3: Validate the lifetime and committed pages of the captured window and its textures before staging. hos_mem_mapped only checks whether the range is inside a logical heap or region, and win_tex only checks the guest window. An in-place rebuild or a decommitted range can leave the same owner and window addresses with stale texture or pool pointers. Revalidate the window incarnation and capture checked texture and pool descriptors while their lifetime is protected.
@ -1936,1 +1936,4 @@OUT_EDITS = [("void f_80547fc0(Ctx *__restrict A64_NOESC c) {\n","void f_80547fc0(Ctx *__restrict A64_NOESC c) {\n"" if (hos_defer_native_output_rebuild(c)) return;\n"),L16 (minor): Provide clean build time and size on both platforms. The new lift edit changes the build input and the PR only gives binary sizes from builds that reused objects. Also complete the pinned Windows AMD, Steam Deck, and desktop Linux checks. Those systems share changed code even when they take the restart path.
@ -0,0 +85,4 @@def main():parser = argparse.ArgumentParser(description=__doc__)parser.add_argument("--cxx", default="g++")parser.add_argument("--cc", default="gcc")L11: Honor CC in the new save and picture fixtures. A supported Clang-only Linux setup can build the game with CC=clang and CXX=clang++, but the save fixture still invokes gcc for its shim. The picture fixture hardcodes clang even when CC selects GCC. Pass the configured C compiler from the inventory or resolve CC in each fixture, with a suitable fallback.
@fix
I didn't fix this pull request: it failed (the Codex runner answered 409: busy). Nothing was pushed.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@fix
@fix
@fix
I changed this pull request where an edit could (the rest needs runs, measurements or decisions): the new head is
85bfe539ef.Changed
Left for the author
Still for the author (no edit does these)
host/nvn_native.c:2765: Do not expire a published candidate before establishing a safe native rollback. A rebuild can expire it here and then hit an alias or owner check that returns without restoring the stock window. The renderer drops every subsequent candidate present and the lift hook keeps deferring rebuild while the generation is published. Preserve presentation until a verified handoff can restore or replace the window, and test a queue or owner replacement during rollback.host/nvn_native.c:3004: Validate the lifetime and committed pages of the captured window and its textures before staging. hos_mem_mapped only checks whether the range is inside a logical heap or region, and win_tex only checks the guest window. An in-place rebuild or a decommitted range can leave the same owner and window addresses with stale texture or pool pointers. Revalidate the window incarnation and capture checked texture and pool descriptors while their lifetime is protected.host/nvn_native.c:2869: Check effective renderer and storage eligibility before charging the boot reservation. A 1280×720 run with Threaded rendering Off, no present-wait support, or linked options can still commit the extra pages and report them as guest memory in use for the whole session. Gate the reservation on the prerequisites known at startup and release it when the renderer establishes that preview is unavailable.Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 16s.PR description / Description follows the template (pull_request_target)fails on this head and passes on the base branch: Failing after 5s.CI / Website build and checks (pull_request)fails on this head and passes on the base branch: Failing after 18s.Nothing was built or run: check the change. Its review follows.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Recommendation: Request changes. A native rebuild can still leave the game stuck on its last displayed frame, and staging can still dereference stale guest descriptors. The latest fix also leaves several regression fixtures unable to check the code they cover.
Eligible Windows Vulkan players can try 1024×576 from 1280×720 in play, keep it after a confirmed FIFO present, or return to the previous size. Other setups use the restart flow. The latest fix serializes menu admission with the renderer's eligibility snapshot and preserves a custom size when an arrow preview is refused. The feature adds native rollback and resource lifetime code, a 7,929,856-byte guest reservation, and 7,864,320 bytes of staged Vulkan images in the reported run.
@fixwill do (9)gpu/vk/vk_menu.cpp:4799: Handle mouse Back before the pending-preview cancellation check. A right click during staging is translated to Back only later in the options page, where it can close the menu without canceling the request. The confirmation can then reopen it. Route that click through the same cancellation path as keyboard and pad Back.tests/test_preview_save.py:88: The linked-options regression fixture searches for the old one-argument request_native_preview definition and raises ValueError before testing storage. Extract the new definition, provide the request-origin state, and preserve the linked-path and atomic-save assertions.gpu/vk/menu/output.cpp:409: The Graphics help still tells an eligible player that Output resolution applies after restart. The guide also tells players to enable Threaded rendering without saying that its change takes effect at the next launch. Update the two help surfaces to explain when preview is available and when restart is needed.17c7b2b1and3a972864. Carry the assistance into the squash commit and make the checklist reflect the recorded trailers.gpu/vk/vk_replay.cpp:6606: Stage the backing before the present handoff or on a worker and report request-to-first-shown time, the longest displayed interval, and peak RAM and VRAM.nx2/oot_patches.py:1939: Log the lift, host build, and renderer build times separately so any increase can be traced to the changed step.gpu/vk/vk_replay.cpp:6528: Passing the new preview_path argument breaks six present checks. (more on the line)tests/test_menu_text_field.py:460: The new refusal case injects a 1024×576 arrow target that the fixture never offers. (more on the line)For the author (8) (a run, a measurement or a decision)
host/nvn_native.c:2765: Do not expire a published candidate before establishing a safe native rollback. A rebuild can expire it here and then hit an alias or owner check that returns without restoring the stock window. The renderer drops every subsequent candidate present and the lift hook keeps deferring rebuild while the generation is published. Preserve presentation until a verified handoff can restore or replace the window, and test a queue or owner replacement during rollback. (@fixcouldn't: The published-trial rollback and queue or owner replacement test remain unresolved. The renderer and native lifetime paths need a coordinated change before candidate presentation can be preserved safe)host/nvn_native.c:3004: Validate the lifetime and committed pages of the captured window and its textures before staging. hos_mem_mapped only checks whether the range is inside a logical heap or region, and win_tex only checks the guest window. An in-place rebuild or a decommitted range can leave the same owner and window addresses with stale texture or pool pointers. Revalidate the window incarnation and capture checked texture and pool descriptors while their lifetime is protected. (@fixcouldn't: Window-incarnation protection and committed-page validation for captured texture and pool descriptors remain unresolved.)host/nvn_native.c:2869: Check effective renderer and storage eligibility before charging the boot reservation. A 1280×720 run with Threaded rendering Off, no present-wait support, or linked options can still commit the extra pages and report them as guest memory in use for the whole session. Gate the reservation on the prerequisites known at startup and release it when the renderer establishes that preview is unavailable. (@fixcouldn't: Startup eligibility gating and release of the charged reservation when preview is unavailable remain unresolved.)gpu/vk/vk_replay.cpp:6606: Measure displayed pacing across request, confirmation, and rollback. Staging makes three images and views after the present copy is submitted and before handing it to the presenter, so the first transition can miss a FIFO refresh. The warmed Kokiri samples do not include that interval.nx2/oot_patches.py:1939: Provide clean build time and size on both platforms. The new lift edit changes the build input and the PR only gives binary sizes from builds that reused objects. Also complete the pinned Windows AMD, Steam Deck, and desktop Linux checks. Those systems share changed code even when they take the restart path.Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 16s. (@fixcouldn't: Review the affected guide source and rendered page, then update the review hashes or captures as appropriate. The supplied record says that review is still pending.)PR description / Description follows the template (pull_request_target)fails on this head and passes on the base branch: Failing after 5s. (@fixcouldn't: Build the host on Linux with UTF-8 paths and obtain current-revision paired screenshots before ticking the applicable checklist items. The supplied evidence does not establish those results.)CI / Website build and checks (pull_request)fails on this head and passes on the base branch: Failing after 18s. (@fixcouldn't: Provide or inspect the earlier error message from the website build log; the supplied excerpt contains only the stack trace, so the failing condition could not be identified safely.)Since the last review (on
4df622732c)Resolved: L1 (Validate the swapchain before taking confirmation input. If the window is resized while Ke…); L4 (Use one synchronized settings snapshot through admission and FIFO handoff. The bridge can…); L6 (Make allocation refusal recoverable throughout preview staging. The NewNothrow scope cover…); L7 (Use the normal custom-output transaction when staging refuses. If the player booted at a c…); L9 (This Linux fixture extracts save() but has no declaration for the new options_save_mu it u…); L10 (Keep the capture visibility fixture's slices bounded to the code it exercises. Cutting fro…)
Still open: L2 (Do not expire a published candidate before establishing a safe native rollback. A rebuild…); L3 (Validate the lifetime and committed pages of the captured window and its textures before s…); L5 (Check effective renderer and storage eligibility before charging the boot reservation. A 1…); L8 (Handle mouse Back before the pending-preview cancellation check. A right click during stag…); L11 (The linked-options regression fixture searches for the old one-argument request_native_pre…); L12 (The Graphics help still tells an eligible player that Output resolution applies after rest…); L13 (Add the control bridge's game_picture field to the PR summary and describe it as the last…); L14 (The attribution now needs to cover the BeanBot follow-up 9f04de12 as well as
17c7b2b1and…); L15 (Measure displayed pacing across request, confirmation, and rollback. Staging makes three i…); L16 (Provide clean build time and size on both platforms. The new lift edit changes the build i…); L17 (The checkGuide screenshots / Guide images and local UI source review (pull_request)fai…); L18 (The checkPR description / Description follows the template (pull_request_target)fails…); L19 (The checkCI / Website build and checks (pull_request)fails on this head and passes on…)New: L20 (Preserve the custom slot when a refused preview came from the Output resolution arrows. Fo…); L21 (Keep the fixture's --source comparison working on the base checkout. At
6e1521a7the fence…); L22 (Passing the new preview_path argument breaks six present checks. Anti-Lag, FPS stats, pres…); L23 (The new refusal case injects a 1024×576 arrow target that the fixture never offers. With t…)More: does it help, other systems, switches, what was read
Does it help: Unproven at the checked-out HEAD, 754b73b1. The supplied report shows all eight gameplay cases passed on Windows 11 with an RTX 4070 at
4df62273against base6e1521a7. Two interleaved pairs per size averaged 60.00 application fps at the cap. Application p99 was 18.10 → 18.08 ms at 1280×720 and 18.09 → 18.37 ms at 1024×576, where 1% lows went from 55.29 to 54.43 fps. Those samples establish neither a performance gain nor how the transition appears on screen. PresentMon yielded no usable displayed intervals.Other systems: Native live preview is Windows-only. Windows AMD, Steam Deck and desktop Linux still need coverage because they share renderer, menu, guest memory and lift code even when they take the restart path. Headless, synchronous and unsupported present paths use restart. The control bridge reports the last submitted native source and crop, so a dropped trial can differ from the displayed picture. The host and renderer interface moves to v40 and requires matched modules.
Switches: RX_VK_OUTPUT_PREVIEW_TEST is new and off by default. Its reservation, allocation and no-frame modes deliberately exercise fallback, so off is the right default. RX_VK_MENU_SCRIPT adds a confirm: prefix and still defaults to no script. Both have switch table entries. Existing HOS_HEADLESS and HOS_MEMINFO_OLD default off, and HOS_OUTPUT_RES defaults unset. Those defaults are unchanged. Threaded rendering retains Auto and resolves at startup.
Reviewed:
85bfe539efagainst6e1521a70a: Read the base AGENTS.md, CONTRIBUTING.md and Forgejo PR template in full and checked the applicable developer standards. Reviewed the four complete diffs since 9f04de12, the base-to-HEAD production diff, and the HEAD functions and callers needed for each ledger item. Read the preview-save and capture-readback fixture scripts in full and inspected the relevant extracts and models in the other fixtures. Skimmed translations, other fixture updates and recorded runs. Large translation units were read around the changed and dependent functions. The local Tooling checkout and rendered Guide were unavailable.; nothing run (a code review).Checked and fine:
Testing: Reviewed source and recorded results without executing project code. The supplied Windows inventory at
4df62273reports 773 passes, 83 failures shared with the base and 48 skips. It predates the two follow-up commits in this checkout. The supplied CI reports three head-only failures in Guide review, PR description and Website build. Exact-HEAD gameplay and fixture runs, Linux UTF-8 host build evidence, pinned Tier 1 coverage, Guide review and current-revision screenshots remain outstanding.Overlaps and merge order: Guide refresh #1501 is related. The supplied clean-combination comparison still shows one extra source input from this PR, gpu/render/rx_nvn.h. No required merge order is established by the available evidence.
Automated code review by BeanBot (gpt-6.2-sol), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
@ -1300,3 +1413,3 @@}static void apply_custom_output(unsigned w, unsigned h, bool has_size) {// (changing the custom size can reorder the shape list: keep the startup and Later choices by shape, not index)int aspect_slot = -1;L20 (minor): Preserve the custom slot when a refused preview came from the Output resolution arrows. For example, a player running at 1280×720 can enter a custom 1536×864, return to 1280×720, then step down to an offered 1024×576. If staging refuses, the new shared transaction clears 1536×864, which the normal arrow edit preserves. Remember which control requested the preview and apply its normal restart transaction on refusal.
@ -6161,3 +6526,3 @@present_acquire_ahead = src && acquire_ahead_wanted();present_copy_done = f.done;present_out(index, qk);present_out(index, qk, trial, preview_path);L22: Passing the new preview_path argument breaks six present checks. Anti-Lag, FPS stats, presenter thread and present semaphores search for the old signature. Present ahead searches for the old call, and the acquire-ahead fixture extracts the new call with a three-argument stub and an old mutation target. Update the extractors, stub and mutation while retaining the ordering and semaphore assertions.
@ -49,7 +47,7 @@ def main():collect = source[start:end] + "\ncaptured = std::move(rec); }\n"call = source.index("vkWaitForFences(dev.device, 1, &f.done, VK_TRUE, UINT64_MAX)", source.index("void present_image("))start = source.rfind("\n", 0, call) + 1L21 (minor): Keep the fixture's --source comparison working on the base checkout. At
6e1521a7the fence wait is followed by framelog_collect and image acquisition, with no trial check, so the new end-marker lookup raises ValueError. End the slice after framelog_collect on both revisions.@ -361,0 +457,4 @@startup("1280x720");CHECK(!apply("1536x864"));opts.output_res = output_choice_of(1280, 720);output_preview_target = {1024, 576};L23: The new refusal case injects a 1024×576 arrow target that the fixture never offers. With the default fake screen modes, output_choice_of uses the custom slot for that size, so the assertion that it still holds 1536×864 fails. Add 1024×576 to the choices for this case and verify the output arrow reaches it before simulating refusal.
@fix
I didn't fix this pull request: it failed (Codex didn't finish with an answer (exit 1)). Nothing was pushed.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@fix
I didn't fix this pull request: it failed (Codex didn't finish with an answer (exit 1)). Nothing was pushed.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@fix
The ChatGPT usage limit is reached (it resets Nov 25th, 2026 1:04 AM), so this fix is paused. It runs by itself once the limit lifts (tried again every 30 minutes); nothing needs asking again.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@fix
@fix
I changed this pull request where an edit could (the rest needs runs, measurements or decisions): the new head is
004e129cbb. I rebased it ontomain(fd7dc40db0).Conflicts resolved
Changed
Changed in part (the rest is for the author)
Left for the author
Still for the author (no edit does these)
host/nvn_native.c:2765: Do not expire a published candidate before establishing a safe native rollback. A rebuild can expire it here and then hit an alias or owner check that returns without restoring the stock window. The renderer drops every subsequent candidate present and the lift hook keeps deferring rebuild while the generation is published. Preserve presentation until a verified handoff can restore or replace the window, and test a queue or owner replacement during rollback.host/nvn_native.c:3004: Validate the lifetime and committed pages of the captured window and its textures before staging. hos_mem_mapped only checks whether the range is inside a logical heap or region, and win_tex only checks the guest window. An in-place rebuild or a decommitted range can leave the same owner and window addresses with stale texture or pool pointers. Revalidate the window incarnation and capture checked texture and pool descriptors while their lifetime is protected.host/nvn_native.c:2869: Check effective renderer and storage eligibility before charging the boot reservation. A 1280×720 run with Threaded rendering Off, no present-wait support, or linked options can still commit the extra pages and report them as guest memory in use for the whole session. Gate the reservation on the prerequisites known at startup and release it when the renderer establishes that preview is unavailable.Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 16s.PR description / Description follows the template (pull_request_target)fails on this head and passes on the base branch: Failing after 5s.CI / Website build and checks (pull_request)fails on this head and passes on the base branch: Failing after 18s.Nothing was built or run: check the change. It will be reviewed again.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
85bfe539ef004e129cbbRecommendation: Request changes. A rollback can leave the session displaying its last frame, and preview staging still relies on guest objects whose lifetime and committed pages are not protected. Ineligible sessions can also retain the full preview reservation.
Eligible Windows Vulkan players can preview a lower output resolution and keep or revert it without restarting. The follow-up repairs the mouse cancellation path, help text, and several fixtures, but the native lifetime and reservation costs remain.
@fixwill do (3)gpu/vk/vk_replay.cpp:6484: Stage the backing ahead of the transition or on a worker, and record request-to-first-shown time and the longest displayed interval.nx2/build.py:2237: The timing output is in place; collect and report the results.gpu/vk/vk_api.h:17: The summary says preview uses renderer API version 40 and retains version 39 Sprint bindings, but the rebased code assigns preview version 41 after Sprint Toggle version 40. (more on the line)For the author (5) (a run, a measurement or a decision)
host/nvn_native.c:2765: Do not expire a published candidate before establishing a safe native rollback. A rebuild can expire it here and then hit an alias or owner check that returns without restoring the stock window. The renderer drops every subsequent candidate present and the lift hook keeps deferring rebuild while the generation is published. Preserve presentation until a verified handoff can restore or replace the window, and test a queue or owner replacement during rollback. (@fixcouldn't: The renderer can still expire a published trial before detached_publish_at_acquire verifies the owner, queue and aliases; its early returns can leave the candidate published without a safe rollback. T)host/nvn_native.c:3004: Validate the lifetime and committed pages of the captured window and its textures before staging. hos_mem_mapped only checks whether the range is inside a logical heap or region, and win_tex only checks the guest window. An in-place rebuild or a decommitted range can leave the same owner and window addresses with stale texture or pool pointers. Revalidate the window incarnation and capture checked texture and pool descriptors while their lifetime is protected. (@fixcouldn't: nvn_output_preview_poll still checks logical mappings and addresses before detached_probe_stage dereferences window textures and their pool. It does not protect the window incarnation or validate comm)host/nvn_native.c:2869: Check effective renderer and storage eligibility before charging the boot reservation. A 1280×720 run with Threaded rendering Off, no present-wait support, or linked options can still commit the extra pages and report them as guest memory in use for the whole session. Gate the reservation on the prerequisites known at startup and release it when the renderer establishes that preview is unavailable. (@fixcouldn't: detached_probe_capture still reserves at boot without checking effective renderer and storage eligibility, and there is no release when preview becomes unavailable.)gpu/vk/vk_replay.cpp:6484: Measure the transition on displayed frames and record peak RAM and VRAM. Allocation now happens before the copy submission, but still runs on the render thread before that frame can be submitted.nx2/build.py:2237: Collect clean build times and sizes on Windows and Linux and complete the pinned Windows AMD, Steam Deck and desktop Linux checks. The new timing output makes collection easier but is not measurement evidence.Since the last review (on
85bfe539ef)Resolved: L8 (Handle mouse Back before the pending-preview cancellation check. A right click during stag…); L11 (The linked-options regression fixture searches for the old one-argument request_native_pre…); L12 (The Graphics help still tells an eligible player that Output resolution applies after rest…); L13 (Add the control bridge's game_picture field to the PR summary and describe it as the last…); L14 (The attribution now needs to cover the BeanBot follow-up 9f04de12 as well as
17c7b2b1and…); L17 (The checkGuide screenshots / Guide images and local UI source review (pull_request)fai…); L18 (The checkPR description / Description follows the template (pull_request_target)fails…); L19 (The checkCI / Website build and checks (pull_request)fails on this head and passes on…); L22 (Passing the new preview_path argument breaks six present checks. Anti-Lag, FPS stats, pres…); L23 (The new refusal case injects a 1024×576 arrow target that the fixture never offers. With t…)Still open: L2 (Do not expire a published candidate before establishing a safe native rollback. A rebuild…); L3 (Validate the lifetime and committed pages of the captured window and its textures before s…); L5 (Check effective renderer and storage eligibility before charging the boot reservation. A 1…); L15 (Measure the transition on displayed frames and record peak RAM and VRAM. Allocation now ha…); L16 (Collect clean build times and sizes on Windows and Linux and complete the pinned Windows A…)
New: L24 (The summary says preview uses renderer API version 40 and retains version 39 Sprint bindin…)
Checks: Still running:
CI / Website build and checks (pull_request),PR description / Description follows the template (pull_request_target),CI / Conventional Commit title (pull_request),CI / Workflow lint (actionlint) (pull_request),Guide screenshots / Guide images and local UI source review (pull_request),Third-party parts / As their notes say (pull_request).More: does it help, other systems, switches, what was read
Does it help: Unproven for this head: eight gameplay cases passed on Windows RTX 4070 at
4df62273, before the latest follow-up. Paired warmed samples held 60 fps, but displayed-frame intervals were unavailable and transition pacing was not measured.Other systems: Windows AMD, Steam Deck and desktop Linux coverage remains outstanding. The native preview is Windows-specific, while renderer, build and restart-path changes can affect other systems.
Switches: RX_VK_OUTPUT_PREVIEW_TEST and RX_VK_MENU_SCRIPT are diagnostic switches, off by default. Existing HOS_HEADLESS, HOS_MEMINFO_OLD and HOS_OUTPUT_RES affect eligibility; their defaults are unchanged.
Reviewed:
004e129cbbagainstfd7dc40db0: Read the latest follow-up diff, the native capture, staging and rollback paths, the renderer trial and present paths, affected fixture changes, repository instructions, contributing guide, PR template, supplied description and comments. The remaining full PR diff, changed files, translations and generated files were not read in full. docs/review-checklist.md and the adjacent Tooling instructions were unavailable.; nothing run (a code review).Checked and fine:
4df62273.Testing: No commands from the project, builds or tests were run. The supplied Windows gameplay and timing evidence predates HEAD; CI checks are still running.
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.
@ -15,3 +15,3 @@#endif#define MKWVK_API_VERSION 40 /* (40: HOS_BIND_SPRINT_TOGGLE) */#define MKWVK_API_VERSION 41 /* (40: HOS_BIND_SPRINT_TOGGLE; 41: live output preview) */L24 (minor): The summary says preview uses renderer API version 40 and retains version 39 Sprint bindings, but the rebased code assigns preview version 41 after Sprint Toggle version 40. Update the summary and any affected verification claims to match the current ABI.
@fix
I edited this pull request's description (2 edits); no file needed changing.
Changed
Not done this time (still open: the next
@fixtakes it)Left for the author
Still for the author (no edit does these)
host/nvn_native.c:2765: Do not expire a published candidate before establishing a safe native rollback. A rebuild can expire it here and then hit an alias or owner check that returns without restoring the stock window. The renderer drops every subsequent candidate present and the lift hook keeps deferring rebuild while the generation is published. Preserve presentation until a verified handoff can restore or replace the window, and test a queue or owner replacement during rollback.host/nvn_native.c:3004: Validate the lifetime and committed pages of the captured window and its textures before staging. hos_mem_mapped only checks whether the range is inside a logical heap or region, and win_tex only checks the guest window. An in-place rebuild or a decommitted range can leave the same owner and window addresses with stale texture or pool pointers. Revalidate the window incarnation and capture checked texture and pool descriptors while their lifetime is protected.host/nvn_native.c:2869: Check effective renderer and storage eligibility before charging the boot reservation. A 1280×720 run with Threaded rendering Off, no present-wait support, or linked options can still commit the extra pages and report them as guest memory in use for the whole session. Gate the reservation on the prerequisites known at startup and release it when the renderer establishes that preview is unavailable.PR description / Description follows the template (pull_request_target)fails on this head and passes on the base branch: Failing after 28s.Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 28s.Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Recommendation: Request changes. A failed native rollback can still freeze the picture until a restart, and nothing tests the native window swap or its way back. Before more rework, a maintainer should also decide whether previewing one size pair is worth this much game-specific code. (The half-done ABI renumber from the rebase is fixed in this review,
2b8ea537.)For a player on Windows Vulkan whose output is exactly 1280x720, with V-Sync on, Threaded rendering on, the game's own upscaler, and no HDR, Reflex, DLSS or frame generation, picking 1024x576 now previews it in play. Yes keeps it and No goes back, with no restart. Every other setup and every other size keeps the restart flow. The gain is real but narrow. The default output is 2560x1440 or the screen's own size, so most players never reach it. The cost is about 1,100 lines of production code:
0x84ea2de0,+0xd8,+0x549, the window owner's+0x70/+0x88/+0xc8), gated on one game build id;WaitEvent,ReceiveLightMessageQueueandTryPopNotificationMessageHLEs;longshot_options.ini;As it stands, I don't think it makes the code better on net.
Does it help: not a perf change. The feature is shown working at
4df62273onmain6e1521a7: the author's eight gameplay cases on an RTX 4070 (Windows 11, NVIDIA 621.01, FIFO), Keep through Kokiri, Hyrule Field and a relaunch, and No, the timeout and refusal restoring 1280x720. The head004e129c(BeanBot's rebase and two follow-up commits) has not been built or run, andpr statuswarns that the numbers predate the new basefd7dc40d. No frame-rate cost shows beyond the noise at the 60 fps cap. At 1024x576, p99 went 18.09 to 18.37 ms and the 1% low 55.29 to 54.43 fps, from two pairs, so that is within noise. The transition itself (request to first shown frame, the longest displayed interval) is not measured.Other systems: the preview is reachable only on Windows.
output_boot_enabledis set under_WIN32only, so Linux and the Steam Deck never reserve or stage anything. They still run the changedpresent_imagelock scope, the HLE hooks (a compare each call), the page-operation admission (returns at once when disabled), the lift edit (one atomic load) and the rewrittencopy_sizechain inmkwvk_init. Since the ABI fix, none of these looks able to change their behaviour, but the Linux build is not shown. Windows AMD and Intel take the same preview path when eligible, and that is not run. The head also changes howtests/run_all.pypicks the C compiler for every fixture, and adds timing lines tonx2/build.pyandnx2/make_game.py(see Suggestions).Switches:
RX_VK_OUTPUT_PREVIEW_TESTis new, a diag switch, off by default, and only injects failures. Off is right.RX_VK_MENU_SCRIPTgains aconfirm:prefix and still defaults to no script, which is right. Both rows are inswitches.def. The existingHOS_HEADLESS,HOS_MEMINFO_OLDandHOS_OUTPUT_RESkeep their defaults and now also turn the preview off.Reviewed:
004e129c(then2b8ea537, my ABI fix on top) againstmainfd7dc40d. A re-review: my first pass was on85bfe539against6e1521a7. Compared withjj interdiff, the rebased commits up to9394c7abchange nothing against their old selves outside thevk_api.hresolution. The new commit004e129c, which I read in full, touches:vk_menu.cpp: mouse Back while staging;vk_replay.cpp: staging before the copy is submitted;menu/output.cpp: the help text;nx2/build.pyandnx2/make_game.py: timing prints;tests/run_all.py;Over both passes I read every production hunk in full:
host/nvn_native.c,host/hos_mem.c,host/hos_svc.c,host/nn_os_sync.c,host/nn_applet.c,host/rx_backend.c,host/control.{c,h},gpu/vk/vk_replay.cpp,gpu/vk/vk_menu.{cpp,h},gpu/vk/vk_texture.{cpp,h},gpu/vk/vk_api.h,gpu/vk/vk_main.cpp,gpu/render/rx_nvn.h,gpu/vk/switches.def,nx2/oot_patches.py, and the docs. I also read the code around them:menu_tick'smenu_mu,host/hos_atomic_file.h, and the Win32 shims inhost/posix/windows.h. I skimmed the translations inmenu_i18n.h,tests/test_output_trial.pyand the other changed fixtures. I did not check eachoffsetofin the newcopy_sizechain against the version that added the field. Nothing run (a code review).Fixed in this review:
2b8ea537, pushed tocodex/live-output-resolution. The rebase movedMKWVK_API_VERSIONto 41 (maintook 40 forHOS_BIND_SPRINT_TOGGLE, #1977, which adds no field), but the copy boundary atgpu/vk/vk_main.cpp:2054and the gate atgpu/vk/vk_replay.cpp:5777still said 40. A version-40 host frommainwould have been read past the end of its table, and its missingoutput_preview_requestcalled. Both now say 41, with the comments atvk_api.h:364and:447and the quoted one intests/test_hos_ab.py:387.Checked and fine:
85bfe539now look for the head'spresent_out(..., OutputTrialSource trial, bool preview_path)and its call:test_antilag,test_fps_stats,test_present_thread,test_present_semaphores,test_present_ahead,test_present_acquire_ahead(stub and mutation too).test_preview_save.pyextracts the two-argumentrequest_native_previewand checksfrom_field(it importsosfor itsCCdefault).menu_muthenoutput_trial_mu.menu_tickalready takesmenu_muitself, so the wider scope adds no new wait for the bridge.output_trial_phase,output_trial_watchdogandpresent_image_with_trialare destroyed after the trial lock is let go. The new earlymake_output_trial_framebeforevkEndCommandBufferonly stages. Its frame can't be acknowledged, becausematches()needs an adopted image.rx_backend.cchecks each renderer pointer before calling it. The Sprint enums,HOS_BIND_SPRINT_TOGGLEincluded, are unchanged.save_preview_size'sfopenis fine on Windows: the executable's manifest sets the UTF-8 code page (nx2/win_manifest.py).longshot_options.inikey is new: Keep writes the existingoutput_res=.third_party/changes.Blocking (to change before merge)
host/nvn_native.c:2773, BeanBot's L2, unchanged in this head). Once a preview is published,detached_publish_at_acquirereturns early when the window owner's texture slots match neither set, before it clearsdetached_published_generation.nvnQueuePresentTexturethen tags every present of the candidate window with that stale generation. In the renderer,output_trial_skip_present(gpu/vk/vk_replay.cpp:5218) returns true for every generation that is no longer the live trial, so every present is dropped. Meanwhilehos_defer_native_output_rebuildkeeps skipping the game'sf_80547fc0rebuild. The screen holds its last frame until a restart. A way back is needed that always lands: clear the published generation and present normally whenever the trial has expired, even when the native swap back cannot be done, and test that case.tests/test_output_trial.pymodels the renderer's trial controller with stubs. Nothing modelsdetached_publish_at_acquire,nvn_detached_pre_acquireornvn_output_preview_poll, the code that writes the game's structures, which is where Blocking 1 and BeanBot's L3 (stale texture and pool descriptors, also unchanged) live. A game-free fixture over that state machine should cover publish, a rebuild while published, an alias mismatch, and a queue replaced during rollback.target.w != 1024 || target.h != 576in both the menu andnvn_output_preview_request), for one game build, on Windows. Is that worth game-structure writes at fixed addresses and hooks in core HLEs? If the answer is yes, the general version (any offered size, the window's textures made at the asked size) would carry the same risk for every player at any output. If no, this should close rather than be fixed further.Suggestions (the author may take or leave)
tests/run_all.py:141adds a second"cc"key to the tools dict. The first (os.environ.get("CC") or which("gcc", "clang")) is now dead, and every fixture that takes{cc}changes behaviour:CCset, it now finds clang before gcc;CCwith arguments (ccache gcc) no longer resolves.Keep one entry, and say in the PR why the order changes, or leave
run_all.pyas it was and pass{cc}only to the two new fixtures.nx2/build.pyandnx2/make_game.pygain build-time prints (BeanBot's L16). They are harmless, but they are not about the preview, and the builder app reads these lines for progress. They belong in their own change.gpu/vk/vk_menu.cpp:1287save_preview_sizerebuildshos_atomic_writeby hand:hos_af_name,open_new,write_all, flush, move. After the link check it could build the text and callhos_atomic_write(path, data, size).host/hos_mem.c:52: the 7.5 MiB guest reservation is charged tohos_used_memoryfor the whole run for every eligible player at 1280x720, before Threaded rendering, V-Sync, DLSS or the options file are known (BeanBot's L5, unchanged). It could be taken at the first preview request instead.host/hos_svc.c:506: refusing a zero-lengthUnmapPhysicalMemory(a zero-sizeMEM_DECOMMITat an allocation base decommits the whole reservation) is a real fix, as are the region-tablerealloccheck and the zero-size page calls. They belong in a fix PR of their own with a test.gpu/vk/vk_replay.cpp:5167: each trial starts a detached thread that polls every 50 ms. The deadlines are already checked frommenu_tickand the presents.Questions
mainwith #2013's Graphics guide, and isgpu/render/rx_nvn.hthe only extra input?Testing: the author's runs are on Windows 11 with an RTX 4070 at
4df62273(eight gameplay cases, 14 focused checks, the Windows inventory with no candidate-only failures, timing at the cap). Nothing has run at004e129cor2b8ea537. Missing: the exact head on its new base; Windows AMD, the Steam Deck and desktop Linux (asked in the comments, not run); the Linux host build. On the CI, the PR description and Guide screenshots checks fail on this head, and the Website build is still waiting to run.Description boxes:
pr statuslists 3 to fix:mainand here" applies (a new dialog on screen). The captures in the comments, maine0ef1b57against8600771b, show it, and they are enough ifdraw_askis unchanged since; the author can link them and tick the box.Assisted-by:trailers" is now unticked for BeanBot's follow-ups. Their trailers have to be carried into the squash commit.Overlaps and merge order: none duplicates this. Every open PR that bumps
MKWVK_API_VERSION(for example #1892, #1817, #1784, #1753) races this one for version 41. Whichever merges second renumbers. #1542 and #1334 touch the same present, memory and NVN files. The Guide refresh #1501 is closed. Its successor #2013 is inmain.@ -1263,0 +1284,4 @@}// Replace only the resolution setting. Decline on a failed write so the old output remains effective.static bool save_preview_size(Out target) {Suggestion: after the
hos_af_is_linkcheck, buildreplacedand callhos_atomic_write(path.c_str(), replaced.data(), replaced.size()). It does the same temp-file, flush and move steps.@ -5096,0 +5215,4 @@if (!generation) return false;std::lock_guard lk(output_trial_mu);auto& trial = output_trial;if (trial.request.generation != generation || !trial.active || TrialClock::now() >= trial.request.deadline) return true;This returns true for any tagged present whose generation is no longer the live trial. Combined with the host's early returns in
detached_publish_at_acquire, that drops every present after a failed rollback (see the summary, Blocking 2).@ -491,2 +504,3 @@case 0x2D: /* UnmapPhysicalMemory(address, size): the pages read as zero if mapped again */if (!hos_guest_range(c->x[0], c->x[1])) { /* (longshot: guest pages only) *//* A zero-length MEM_DECOMMIT at the allocation base frees the entire Windows reservation. */if (!c->x[1]) {A good fix (a zero-size
MEM_DECOMMITat an allocation base decommits the whole reservation), but not about the preview. It is worth its own fix PR with a test.@ -2649,0 +2770,4 @@for (int i = 0; i < 3; ++i) {const uint64_t alias = recomp_load64(c, detached_owner + 0x88 + i * 8);if (owns_window) {if (alias != detached_candidate->window.tex[i] && alias != detached_old_textures[i]) return;This early return (and the one in the
elseloop) leavesdetached_published_generationset. Every later present of the candidate window is then tagged with a generation the renderer no longer knows, andoutput_trial_skip_presentdrops it.hos_defer_native_output_rebuildalso keeps skippingf_80547fc0. The picture freezes until a restart. The expired path needs a way back that always lands: clear the generation and present normally even when the swap back can't be done.@ -138,6 +138,7 @@ def find_tools():"dotnet": which("dotnet"),"cc": os.environ.get("CC") or which("gcc", "clang"),"cxx": which(os.environ.get("CXX", ""), "clang++", "g++", "c++"),"cc": which(os.environ.get("CC", ""), "clang", "gcc", "cc"),A second
"cc"key: the one two lines up is now dead. Every fixture that takes{cc}then finds clang before gcc, and aCCwith arguments (ccache gcc) no longer resolves. Keep one entry, or leave this file alone and give{cc}to the two new fixtures only.BeanBot's follow-up added a second "cc" key to find_tools' table, so the first was dead: with no CC set, every check given {cc} found clang before gcc, and a CC with arguments ("ccache gcc") no longer resolved. The preview's two checks need no particular C compiler, so the original entry stays the only one. Assisted-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <[email protected]>Recommendation: Wait (on a Windows in-game run of
b5bbe623, and the description). The blocking code points from my last review are fixed on the branch. Nothing has run at the new head, though, and this changes the present path and the game's own window rebuild. It needs a Windows run before it merges.Fixed in this review (pushed to
codex/live-output-resolution, the author's commits untouched):2b8ea537: the host table copy (vk_main.cpp:2054) and the gate (vk_replay.cpp:5777) now check version 41. That is the version the rebase moved the ABI to;maintook 40 with #1977. Before, a host built frommainwas read past the end of its table.cf00feba:tests/run_all.pyhas one C compiler entry again:CCfirst, then gcc. Neither of this PR's C fixtures needs clang.1d8fb861: a new game-free test,tests/test_output_rollback.py. It cuts the real native controller out ofhost/nvn_native.c(the detached window through the probe, plusnvnQueuePresentTexture's present tag). It runs that against a fake window owner, a stub renderer trial and a fake clock, through these steps:On
2b8ea537the preview window's presents still carry the stale generation 4 s after expiry, which the renderer drops. That is the frozen picture.b5bbe623: if the native swap can't make the way back within a second (detached_rollback_overdue), the trial ends anyway:detached_rebuild_pendingare cleared, so presents go out untagged and the game's own rebuild runs;output_trial_skip_presentis left as it was. It drops tagged presents on purpose, and untagged presents no longer freeze.None of these was built or run here. They are a code review's fixes, so CI and a Windows run have to show they hold.
Still open, not blocking in my view:
After a rollback that is given up:
For the author, before merge:
b5bbe623on Windows: the eight gameplay cases, andtest_output_rollback.pyboth ways (failing at2b8ea537, passing atb5bbe623).mainfd7dc40d. Say why they still hold, or measure again.The maintainer has settled the scope question: keep the feature.