feat(graphics): add fluid simulation switches #2476
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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!2476
Loading…
Reference in a new issue
No description provided.
Delete branch "erlo68/Longshot:feat/fluid-simulation-switches"
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
Longshot had no in-game way to stop Ocarina of Time's fluid effects or to hide only the low ground mist. This adds two saved, live switches on the Detail page of the Graphics tab, under More graphics settings. Both appear directly after Simulated turf and default to Off:
Turning the full switch back Off resumes the current simulation even when the manager was already disabled when Longshot first observed it. The settings survive restarts and are intentionally outside the quality presets.
The built-in
system/fluid-effectsmod owns both settings and both effects under the mod API (#2822). Its acquire callback applies the fluid manager switch. When Hide ground mist is on, the mod registers agfx().skip_draws(program)hook for each of the 12 mist program keys. Clearing the switch releases that mod's hooks, and unload releases them through the existing mod journal.The new hook reuses the graphics program-hook table used by the grass and shadows system mods. The mod supplies the effect-specific program keys, and Vulkan applies the same draw-skip rule to each registered key. This removes the mist-specific renderer code and settings snapshot field. Hook registration is limited to native system mods because omitting a draw can affect later passes that consume its output. The hook applies only to graphics draws, so the mist simulation and simulated turf keep running with the mist-only switch on.
Testing
Tested: On
c6882a4eoverca830e89, the full Windowsmise run test --jobs 6run finished with 831 passed, 16 failed, and 51 skipped. All 16 failures reproduced on the base with the same tools. The draw-skip hook-table, saved settings, localization, and controller relaunch checks passed. Five focused Rust tests passed for the fluid-effects mod and the program-hook ABI.16 Windows checks that also failed on main (
ca830e89)tests/test_audio_output_errors.pytests/test_audio_source.pytests/test_audio_source_load.pytests/test_audio_wave_buffer_release.pytests/test_coverage_run.pytests/test_dev_update.pytests/test_fsr4_tune.pytests/test_game_font.pytests/test_hd_rumble.pytests/test_lifter.pytests/test_pad_headphones_reader.pytests/test_pad_speaker.pytests/test_parity_gates.pytests/test_rumble_mapping.pytests/test_rumble_refresh.pytests/test_vibration_permission.pyCompiled and linked the Windows runtime and compiled, linked, and packaged the Ubuntu 24.04 build. Linux verification ended at packaging. In the Windows runtime, low ground mist disappeared and returned live in Kokiri Forest. A read-only check confirmed the fluid manager kept running with Hide ground mist on and stopped and resumed with Turn off fluid simulation. Both switches persisted across a restart. The renderer log confirmed all 12 mist hooks were installed and removed with the setting. The separate diagnostic profiling run captured Hyrule Field frame data and crashed during shutdown. All eight timed A/B runs exited normally with profiling disabled.
On
10aa77a9overca830e89, the menu layout and guide checks confirmed both switches appear on the new Detail page after Simulated turf. The fluid-effects Rust tests passed on Windows with LLVM-MinGW. The saved-key, settings declaration, generated ABI, menu translation, and screenshot integrity checks also passed.On
df8340f7overb4d56f52, the two fluid-effects Rust tests passed with LLVM-MinGW on Windows. The Windowslongshot-gamecrate passedcargo checkwith the generated native-mod registry. The renderer filter test verified live toggling for all 12 original mist programs. The Graphics menu layout matched the expected order, and the saved-key, option-ID, settings ABI, and guide screenshot checks passed.The full Windows
mise run test --jobs 6run ondf8340f7finished with 821 passed, 11 failed, and 51 skipped.tests/test_longshot_ctl.pypassed. I reran all 11 failures on the matchingmain(b4d56f52) with the same LLVM-MinGW tools.The follow-up
ce24af90added the fluid-effects crate README and translations for both switches in all 13 shipped non-English locales. It also corrected two source comments flagged by the repository's naming check. I reran the original failures and three menu/settings checks on this head. Five passed and nine failed. The crate README and naming checks now pass. The localization completeness check reports the same ReShade preset names on both heads.Nine Windows checks that also failed on main (
b4d56f52)tests/test_audio_output_errors.pytests/test_audio_wave_buffer_release.pytests/test_coverage_run.pytests/test_dev_update.pytests/test_fsr4_tune.pytests/test_game_font.pytests/test_i18n_complete.pytests/test_lifter.pytests/test_parity_gates.pyBuilt and linked matched Windows runtimes for
b4d56f52andce24af90. On the PR build in Hyrule Field, a read-only check of the game’s fluid manager confirmed that turning off fluid simulation stopped it and clearing the switch resumed it. Turning on Hide ground mist left the manager running. The game reported the intended switch states in all four PR timing runs, and all eight runs exited normally.The earlier testing history below predates the mod API rebase.
Built the matched Windows runtimes for
97ebb417and28cb22b9and ran both Hyrule Field A/B comparisons below. The five focused Windows checks passed after the tooltip edits. They cover the fluid effects, menu layout and help, saved keys, and guide screenshots.Built and linked
fba9511aover28cb22b9on Windows with LLVM-MinGW and on Ubuntu 24.04 with the pinned Linux toolchain. The Windows UTF-8 path check passed, and Linux used a non-ASCII work and output path. Linux verification ended at packaging. The Graphics screenshot source check passed with the newer guide image.The full Windows
mise run testrun onfba9511aended with 811 passed, 57 failed, and 48 skipped. Of those failures, 56 also failed on the matchingmain(28cb22b9) under the same Windows toolchain and settings. The remaining failure was a race during the fake Windows game relaunch intests/test_longshot_ctl.py. It passed on an isolated retry on the published head,97ebb417. A deterministic regression reproduced the same supervisor race on unmodifiedmain. The supervisor and control test sources are identical onmainand this PR.The full Windows rerun on
97ebb417plus the separate supervisor fix (e8d5fd1b) ended with 812 passed, 56 failed, and 48 skipped. The control-relaunch test passed in that run. The 56 failing check names matched the comparison onmainexactly. The PR head at that time was97ebb417.56 Windows checks that also failed on main (
28cb22b9)Built and linked the earlier head
5635cad9overe203e04bon Windows with LLVM-MinGW and on Ubuntu 24.04 with the pinned Linux toolchain. The Windows build linked from a checkout containing a non-ASCII path, and the Linux build used a non-ASCII work and output path. Linux verification ended after compile, link, and packaging. The Graphics screenshot source check also passed.The full strict Windows suite on
5635cad9finished with 803 passed, 42 failed, and 46 skipped. All 42 failing checks reproduced one203e04bunder the same tools and test settings. The feature's fluid, menu, saved-key, and game-boundary checks passed.On the earlier head
0a8104f32overbe663a08a, built and ran the game on Windows 11 with an AMD Radeon RX 7900 XT and driver 26.11.2.The evidence comment contains the two supplied Graphics screenshots from
fba9511aand the ground mist on/off comparison.After rebasing onto
be663a08a, eight focused strict checks passed on Windows with LLVM-MinGW:tests/test_fluid_effects.pytests/test_game_boundary.pytests/test_game_phases.pytests/test_menu_modules.pytests/test_menu_ini_keys.pytests/test_menu_help_paragraphs.pytests/test_option_ids.pytests/test_settings_table.pyOn that head, the new game and menu sources passed C syntax checks against the host headers using the test lift configuration. The guide screenshot source review and all 14 screenshot checks passed for the local Longshot sources.
The full strict Windows suite on
0a8104f32finished with 776 passed, 23 failed, and 45 skipped after retrying the first-pass failures with the installed LLVM-MinGW compiler aliases. All 23 remaining failures also reproduced onbe663a08awith the same tool setup. No PR-only failures were found.Still to test:
@Beanstalk fluid simulation switch on lower-end Tier 1 hardware).Measurements
Verdict: With both switches Off, median FPS was +0.3%, within the observed run spread. Turning off fluid simulation raised median FPS 1.6% against the PR's
mainbase, with both PR runs above both baseline runs. The 1% low fell 1.4% in that comparison. These numbers cover the tested desktop.Setup: Windows 11, Intel Core i7-14700KF, AMD Radeon RX 7900 XT with driver 26.11.2 (LLPC). Child Link in Hyrule Field, 2150×900 window, 67% render scale, the game's turf renderer, uncapped frame rate, V-Sync Off and frame generation Off. Each comparison used two interleaved pairs of 30-second traces after shader warm-up. Every baseline run used the game's fluid simulation. Hide ground mist stayed Off throughout. The test read the switch values back from the game before measuring.
ca830e89c6882a4eAll eight timed runs exited normally with zero cold frames and no queue noise flags. This compares the published head with its base
ca830e89, which was current when the runs started. Upstream advanced to2603ac21during the benchmark. Local run IDs are20261204-064030-hos_system_mods_dir-hyrule-fieldand20261204-064436-hos_system_mods_dir-hyrule-field.Risks
The full switch uses a version-specific native manager layout and checks the manager's type before writing. Both rows ship Off. Turning a row Off restores normal behavior. The saved keys are
fluid_simulation_offandground_mist_offin the profile'ssettings.toml. If hook registration fails partway, the fluid-effects mod withdraws the whole batch before the renderer receives it.Checklist
Ready for review
main; the title is a Conventional Commit.c6882a4e. Testing records the live switch checks and restart persistence.mise run testpasses the comparison againstca830e89. Testing names the 16 failures shared by the Windows runs.main, or Measurements says why there is nothing to measure. Measurements compares the published headc6882a4eagainst its baseca830e89.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.c6882a4e. The same revision also compiled, linked, and packaged on Ubuntu 24.04. Testing records the earlier Windows and Linux builds with UTF-8 paths.Assisted-by:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows 11, AMD Radeon RX 7900 XT, driver 26.11.2: in Hyrule Field both Graphics rows applied live; full shutdown froze and resumed fluid effects, Hide ground mist removed only the low mist while simulated turf continued, and both settings persisted through restarts.
UI and in-game evidence
Graphics settings
Captured on
fba9511a, before the tooltip copy was shortened.Ground mist on and off
This pair shows the visible ground-mist change for both Graphics toggles.
Possibly related, for context:
@Beanstalk Please run the Linux full suite with the pinned Vulkan/SPIR-V dependencies. If a lower-end Tier 1 Windows runner is available, also compare Hyrule Field with Turn off fluid simulation Off and On; expect live stop/resume without a crash, and report whether removing the simulation produces a measurable gain.
@erlo68 only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was for54c2b8d, and the PR has changed since (0a8104f), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.54c2b8d0b50a8104f323Rebased onto main
be663a08aand resolved the guide screenshot manifest conflict. The native stop/resume logic now runs on the game acquire phase, and the mist filter remains in the renderer. Both saved keys and the screenshot evidence are preserved. Eight focused Windows checks and the Longshot guide source review passed. A rebased game run and fresh measurements are pending the Rust builder toolchain.Built and tested
0a8104f32on Windows 11, Radeon RX 7900 XT, driver 26.11.2. In Hyrule Field, the full toggle stopped and resumed the fluid manager, the mist-only toggle left it running, and both settings survived a game restart. In Kokiri Forest the low mist disappeared and returned live, and renderer diagnostics confirmed two mist shader programs returned. The test sessions exited cleanly.Completed the full strict Windows suite before timing. With the LLVM-MinGW compiler aliases available, the combined result was 776 passed, 23 failed and 45 skipped. All 23 failures reproduced on main
be663a08a. Both fresh Hyrule Field A/B comparisons passed validation against that main revision: both options Off was 145.3 to 146.9 median FPS (+1.1%); full simulation disabled with Hide ground mist Off was 143.0 to 147.7 median FPS (+3.3%). Both ranges overlapped. Setup and individual samples are in Measurements.0a8104f323825278b736Rebased onto main
d9fa80cd1and resolved the Graphics screenshot manifest conflict. The existing screenshot passed its source review and all eight focused Windows checks passed on825278b73. The description now identifies the earlier head used for the full Windows suite and the A/B runs.WIP: feat(graphics): add fluid simulation switchesto feat(graphics): add fluid simulation switches825278b736d14b5f046bRebased onto main
bd7bcb52and resolved the Vulkan draw and Graphics screenshot manifest conflicts. The renderer keeps the Maxwell BC4 pass workaround and the live ground mist filter. The Graphics screenshot source check and nine focused Windows checks passed ond14b5f04, including the Maxwell draw regression. Runtime and A/B results remain tied to the earlier build.d14b5f046b5635cad949Rebased onto
e203e04bso both sides of the upcoming A/B include the latest host logging change. Windows and Linux builds passed on5635cad9, including UTF-8 build paths. The strict Windows suite finished with 803 passed, 42 failed, and 46 skipped. All 42 failures reproduced on matching main. Linux verification was build-only. The Windows timing runs are prepared and paused pending confirmation that the PC is free.5635cad949fba9511ae8Rebased onto main
28cb22b9. Resolved conflicts in the Graphics docs, renderer menu initialization, saved settings key checks, and the guide screenshot manifest. Kept the new Simulated turf controls and clarified that the full fluid switch acts on the game simulation. Nine focused Windows checks passed onfba9511a. The two failures reproduced on28cb22b9. The description identifies the earlier full build, suite, and timing results.Windows and Ubuntu 24.04 builds passed on
fba9511a. Linux verification was build-only. The full Windows mise suite finished with 811 passed, 57 failed, and 48 skipped. Matching main28cb22b9reproduced 56 failures. The remaining Windows control relaunch check passed on an isolated retry after a file lock. A/B timing remains paused and the PR stays ready for review.Shortened the two Graphics tooltips and replaced the two UI screenshots in the existing evidence comment. The Hyrule Field A/B compared PR head
97ebb417against main28cb22b9. Median FPS was +0.9% with both switches Off and +0.2% with full fluid simulation disabled. Both changes fell within the observed run-to-run spread. The measurements are in the description. The PR remains ready for review.97ebb4178adf8340f7f5ce24af90ae10aa77a91aRebased onto main
ca830e89. Both switches now appear after Simulated turf on Graphics → More graphics settings → Detail. Resolved the menu and guide conflicts and regenerated the settings ABI. The layout, saved keys, and Windows fluid-effects tests passed on10aa77a9. The description keeps the earlier A/B results tied to the commits that were measured.Moved the mist implementation into
system/fluid-effectsinc6882a4e. The system mod owns the 12 program keys and registers their draw skips through the native mod API. Vulkan uses the existing program-hook table to apply the generic draw skip. The hook is limited to native system mods because skipping a draw can also remove outputs another pass needs. Both switches keep their saved keys and Detail page placement. Automated and live testing for this revision are pending.Measured the published head
c6882a4eagainst itsmainbaseca830e89in Hyrule Field. Both switches Off was +0.3% median FPS, within the observed run spread. Turning off fluid simulation was +1.6% median FPS and −1.4% in the 1% low. Both PR runs in that comparison were faster than both baseline runs. Also recorded the Windows suite, focused Rust tests, live toggle and restart checks, and Linux build-only verification.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.