fix(video): movies keep their 16:9 shape on screens narrower than 16:9 #2358
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2358
Loading…
Reference in a new issue
No description provided.
Delete branch "PirateKingIsh/Longshot:fix/narrow-movies"
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?
Summary
On a picture narrower than 16:9, pre-rendered movies are stretched to the picture's full height: about 11% too tall at 16:10 and 33% at 4:3. The title screen's background is one of them, and it is the one checked here. To see it on main, set Output resolution to 1920×1200 or 1440×1080, restart, and watch the moon in the first shot of the title-screen movie.
The MOVIE patch in nx2/oot_wide.py moves the top and bottom of the viewport inward by equal amounts on narrow screens. Movies keep their 16:9 proportions with bars above and below. Wider pictures still use the existing side bars.
Thanks to dyst for diagnosing the 4:3 output in #2345, tracing the regression to
b44c9cd44(Monitor's shape for screens narrower than 16:9) and describing the same fix there.Fixes #2345.
Part of #1399.
Testing
Tested: Windows 11, Vulkan, RTX 5090, NVIDIA 621.24. Started from the repository's kokiri-start save on main and on this branch. Ran the title-screen movie at 1920×1080 (16:9), 1920×1200 (16:10), and 1440×1080 (4:3). The 1440×1080 run exercises the 4:3 output shape from #2345. The moon is round with black bars above and below at both narrow shapes. At 16:9 the movie still fills the picture. The before/after screenshots use the same title-screen scene.
The game-free movie test failed on main at 16:10, 4:3, and 5:4 because the vertical bounds stayed at full height. It passed all seven cases on this branch, including 32:9, 21:9 and 16:9. All nine targeted tests passed without skips. On Linux (Ubuntu 22.04, GCC 11.4),
tests/test_movie_shape.pypasses throughtests/run_all.pywithtest_wide_ui.py,test_widescreen_shapes.pyandtest_oot_wide_save_picture.py, and fails on main'sMOVIEin the same three cases; that is a game-free check, not a Linux game run. The full Windows runner recorded 789 passes, 42 failures, and 127 skips. Main reproduced the 41 failures below. The other check, test_gpu_hang_watch.py, passed on main and on an isolated branch rerun.nx2/test_nup_paths.py,nx2/test_version_long_paths.py,tests/test_auto_handheld.py,tests/test_build_long_paths.py,tests/test_cmpflags.py,tests/test_control.py,tests/test_copy_writable.py,tests/test_crash_dialog.py,tests/test_dev_ab.py,tests/test_dev_build.py,tests/test_dev_migrate.py,tests/test_dev_packs.py,tests/test_dev_update.py,tests/test_fastfp_fma.py,tests/test_fma_soft.py,tests/test_fpx_sticky.py,tests/test_fpxkeep.py,tests/test_game_menu_mouse_buttons.py,tests/test_input_movie.py,tests/test_job_queue.py,tests/test_linux_preflight.py,tests/test_long_paths.py,tests/test_make_game_cache.py,tests/test_native_zstd.py,tests/test_nfc_model_info.py,tests/test_no_gpu_start.py,tests/test_options_path.py,tests/test_pads_after_menu.py,tests/test_perf_report.py,tests/test_pipeline_cache_file.py,tests/test_pipeline_cache_save.py,tests/test_pipeline_state_computes.py,tests/test_portable_builder_home.py,tests/test_portable_builder_startup.py,tests/test_saveload_warm_cache.py,tests/test_sdiv_overflow.py,tests/test_spawn_emit.py,tests/test_vbytes.py,tests/test_vecfp.py,tests/test_vfpx_elem.py,tests/test_work_lock.pyStill to test:
Measurements
Verdict: Both narrow outputs match the 16:9 control within 0.3%. The bars are pure black in all 18 after captures at each narrow shape.
Setup: Windows 11, RTX 5090, and NVIDIA 621.24. Median moon width divided by height from four full-moon title-screen frames per run. Bar heights count consecutive black pixel rows at each picture edge.
0e32bc103d6f7579(built from its tree before the commit)The change adjusts movie framing. These captures measure geometry, and the runs used different shader-cache warmup states, so they do not establish a frame-time comparison.
Risks
The changed viewport is shared by pre-rendered movies. A movie with different viewport assumptions could be framed incorrectly. A revert restores the previous framing. Saves and settings need no migration.
Checklist
Ready for review
When it applies
tests/that reads changed source is updated, not weakened: the existing checks that readnx2/oot_wide.pyneeded no change and all pass.Ready to merge
Possibly related, for context:
Tested on my PC (Windows 11, RTX 5090, NVIDIA 621.24), starting from the repository's kokiri-start save. At 1920×1200 and 1440×1080, the title-screen moon stays round with even black bars above and below the movie. The 1440×1080 run covers the 4:3 output shape from #2345. At 1920×1080 the movie still fills the picture. The game-free viewport check fails on main and passes on this branch.
@review
Recommendation: Approve. The reported Windows run shows the title-screen movie corrected at 16:10 and 4:3, but the shared movie path still needs the declared in-game checks on other Tier 1 systems and outside the title screen. CI is also still running. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The change centers movies in a 16:9 viewport on narrow pictures while retaining the existing wider-screen behavior. It adds a game-free geometry check and updates the player guide; the remaining cost is validation of the shared movie path.
Should fix (1): not blocking, but worth doing before merging.
tests/test_movie_shape.py:93: The test treats a compiler command containing arguments as one executable name, although the test runner accepts such CC values. (more on the line) Do: Use the suite's compiler_command.parse_compiler for args.cc and prepend its resulting argument list to the compile command.Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)
nx2/oot_wide.py:96: The shared viewport change needs an in-game check on the Steam Deck at its native narrow resolution. (more on the line) Do: Run the title-screen movie on a Steam Deck at 1280×800 and check the image shape and both bars.nx2/oot_wide.py:96: The changed movie viewport needs an in-game check on the other affected Tier 1 GPU and OS combinations. (more on the line) Do: Check the title-screen movie at narrow and 16:9 output on NVIDIA Linux and AMD Windows and Linux, recording the hardware, driver, and result.nx2/oot_wide.py:96: The patch is shared by movies, but the reported in-game run covers only the title screen. (more on the line) Do: Run New Game with Skip opening off at 16:10 and check the movie's proportions and bars.@fixcan do L1.Checks: Still running: 10 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the tested title-screen scene: on Windows with an RTX 5090, the reported moon width-to-height ratio changed from 0.906 to 1.006 at 16:10 and from 0.755 to 1.008 at 4:3, with equal bars. The PR reports that its game-free check fails on main and passes on this branch.
Other systems: The viewport patch applies to pre-rendered movies across GPUs and operating systems. The reported in-game evidence covers Windows and NVIDIA; Linux, AMD, Steam Deck, and the New Game opening movie remain untested in game. The aspect globals are initialized before the game's threads start, and the existing wide-screen branch remains unchanged.
Switches: None added, changed, or removed.
Reviewed:
3d6f757924against0e32bc100d: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the complete changed Python files and their diff, and the relevant viewport initialization, size calculations, installation site, test runner, and compiler parser. Skimmed the changed user guide and related widescreen tests. docs/review-checklist.md and the adjacent Tooling checkout were absent. No recorded runs or generated files were changed.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run, as requested. The PR reports Windows in-game comparisons and game-free checks on Windows and Linux; the listed CI checks are still running.
Overlaps and merge order: Unknown; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -93,2 +95,2 @@"memcpy(&_ua, &_a, 4); memcpy(&_ub, &_b, 4); recomp_store32(c, _vp + 8, _ua); recomp_store32(c, _vp + 16, _ub); } }"" /* (nx2/oot_wide.py: movies in the middle 16:9) */")"memcpy(&_ua, &_a, 4); memcpy(&_ub, &_b, 4); recomp_store32(c, _vp + 8, _ua); recomp_store32(c, _vp + 16, _ub); } ""else { extern volatile float hos_wide_ratio; const float _r = hos_wide_ratio; const float _game = 16.0f / 9.0f; "L2 (should fix): The shared viewport change needs an in-game check on the Steam Deck at its native narrow resolution.
When: At 1280×800 the new vertical inset is active, but the available Deck evidence does not show whether the movie and its bars render correctly.
Do: Run the title-screen movie on a Steam Deck at 1280×800 and check the image shape and both bars.
L3 (should fix): The changed movie viewport needs an in-game check on the other affected Tier 1 GPU and OS combinations.
When: The reported game run covers NVIDIA on Windows only; the fixture does not exercise the renderer or verify the bars on Linux and AMD systems.
Do: Check the title-screen movie at narrow and 16:9 output on NVIDIA Linux and AMD Windows and Linux, recording the hardware, driver, and result.
L4 (should fix): The patch is shared by movies, but the reported in-game run covers only the title screen.
When: If the New Game opening uses different viewport assumptions, the title-screen result and synthetic bounds check would not reveal incorrect framing there.
Do: Run New Game with Skip opening off at 16:10 and check the movie's proportions and bars.
@ -0,0 +90,4 @@with tempfile.TemporaryDirectory() as tmp:source = Path(tmp) / "movie_shape.c"exe = source.with_suffix(".exe" if os.name == "nt" else "")source.write_text(FIXTURE.replace("@MOVIE@", module.MOVIE), encoding="utf-8")L1 (should fix): The test treats a compiler command containing arguments as one executable name, although the test runner accepts such CC values.
When: With CC set to a command such as
ccache gcc, the runner recognizes the compiler using parse_compiler and passes the command through --cc, but subprocess.run attempts to execute a file literally namedccache gccand the check fails before compiling.Do: Use the suite's compiler_command.parse_compiler for args.cc and prepend its resulting argument list to the compile command.