fix(game): blend foliage impostor views on the performance path #2736
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!2736
Loading…
Reference in a new issue
No description provided.
Delete branch "jackkenney/Longshot:fix/blend-performance-foliage"
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
Stand still in the Graveyard and look up at a tree against the sky. Above the 30 FPS mode, whole clusters of leaves can change outline in a single frame as the branches sway. Kokiri Forest and Hyrule Field show the same flicker.
The performance path forces the foliage shader to finish each transition between atlas views immediately. The hook in
game/oot_sites.crestores the scene's choice for that one flag before the game selects its quality settings. A scene can still explicitly request an immediate transition. Otherwise the shader advances the fade at the actual frame rate.Testing
Tested: The player confirmed the fix in Hyrule Field, the Graveyard, and Kokiri Forest. They also saw an improvement in other Hyrule Field foliage. Its cause is unconfirmed.
Compared stock nightly 895 and the patched build at the same stationary Graveyard camera on Windows, Vulkan, RTX 5070 Ti, driver 621.24, frame generation off. Tested 60 FPS and uncapped at 4K and uncapped at 720p. A separate nightly 876 test covered the original 30 FPS fade and a map transition. The game-free regression detects a forced reset and checks that explicit scene resets and the other performance flags survive.
The changed C translation unit compiled to Windows x64 and Linux x64 objects from a UTF-8 path. Lint passed. The full strict Linux suite had 863 passes, 16 failures, and 10 platform skips. All 16 failures also reproduced on untouched
22d0d200. The failing checks were:test_bug_report.py,test_control_picture.py,test_crash_record.py,test_framegen_hdr.py,test_framegen_resources.py,test_guest_holes.py,test_input_background.py,test_lifter.py,test_log_open_failure.py,test_perf_send.py,test_pipeline_tour.py,test_present_source_crop.py,test_screensaver.py,test_switch_table.py,test_temporal_present_bandwidth.py,test_xinput_thread.py.Still to test:
Measurements
Verdict: The abrupt outline changes largely disappear. In the nightly 876 diagnostic A/B at 60 FPS, a single cluster switched abruptly 11 times stock, zero with the flag corrected, then nine with stock behavior restored.
For nightly 895, each 12-second recording used the same camera position and normal game colors. The table counts sampled video frames with a large single-step luminance change along the canopy against the sky. The measure includes normal wind motion. Each clip contributed 357 samples. Uncapped, both builds ran around 76–77 FPS at 4K and 138–140 FPS at 720p.
22d0d2005a3a365Risks
Foliage sharing this flag can spend longer drawing its existing transition when the atlas view changes. The fix has no frame-rate threshold or tuning constant. Reverting the hook restores the game's original performance-mode behavior. The separately reported traversal stutter in #2285 has a different reproduction.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows, Vulkan, RTX 5070 Ti, driver 621.24. Compared stock nightly 895 with the patch in the Graveyard at 60 FPS and uncapped up to about 138 FPS. The abrupt leaf-cluster switches subsided. The player independently confirmed the fix in Hyrule Field, the Graveyard, and Kokiri Forest.
Possibly related, for context:
Same stationary Graveyard camera at 60 base FPS, with frame generation off. Watch the outline of the leaf cluster against the sky. Stock nightly 895 is on the left and the fix is on the right.
WIP: fix(game): blend foliage impostor views on the performance pathto fix(game): blend foliage impostor views on the performance path@review
Recommendation: Approve. The reported runs show a substantial reduction in visible foliage switching on NVIDIA, but the frame-time cost and Tier 1 AMD and Steam Deck behavior remain unmeasured. The regression test also unnecessarily requires Clang instead of honoring the selected C compiler. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The hook preserves the scene’s foliage transition choice on the performance path, allowing impostor views to blend. It adds an always-on guest hook and can extend transition rendering, so its performance cost still needs measurement.
Should fix (1): not blocking, but worth doing before merging.
tests/test_foliage_impostor_flags.py:9: The test requires Clang even though its fixture is ordinary C and does not link a Clang-built object. (more on the line) Do: Use the runner’s {cc} selection and make the fixture compilation honor supported compiler commands, including their arguments.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
game/oot_sites.c:765: The cost of keeping foliage transitions active and calling the new hook has not been measured in frame times. (more on the line) Do: Compare repeated interleaved base and head runs in the Graveyard and a foliage-heavy area, reporting average and 1% low FPS and frame-time distributions on representative hardware.game/sites/sites.toml:1410: The rendering change has not been checked on the other affected Tier 1 systems. (more on the line) Do: Run the foliage reproduction and check for rendering and pacing regressions on AMD Windows and Linux and Steam Deck, plus NVIDIA Linux, with results recorded before merge.@fixcan do L1.Checks: Cancelled on this head (no result):
PR description / Title and description (pull_request_target). Still running: 10 checks.More: does it help, other systems, switches, what was read
Does it help: Yes, for the reported visual symptom: the PR reports large canopy changes falling from 38 to 0 at 4K/60, 25 to 3 at 4K uncapped, and 54 to 0 at 720p uncapped on an RTX 5070 Ti. The player also confirmed improvement in three areas; the performance cost is unproven.
Other systems: The hook runs on worker threads and changes guest foliage flags independently of GPU vendor and OS. NVIDIA Windows was tested; AMD Windows and Linux, Steam Deck, and NVIDIA Linux remain unverified. The callback uses only the supplied guest context and adds no shared mutable state. No save, audio, input, or renderer API changes were found.
Switches: None added, changed, or removed.
Reviewed:
5a3a365b53against22d0d20098: Read the repository rules, PR template, applicable standards and hook documentation, the complete diff and commit, the new test and its harness, and the changed code and nearby site entries. Skimmed the remaining entries in the large site tables and unrelated callbacks; no recorded runs, translations, or generated files were changed. The neighboring Tooling checkout and docs/review-checklist.md were absent.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code, tests, or project scripts were run. The author reports Windows and Linux object compilation, game testing on NVIDIA Windows, and 16 strict-suite failures reproduced on the base. CI is still running.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -761,0 +762,4 @@/* The performance path forces every change of impostor view to finish in oneupdate. Restore the scene's choice for that bit before the game selects itsquality flags. This also preserves an explicit request to skip the fade. */int hos_site_foliage_impostor_flags(Ctx *A64_NOESC c) {L2 (should fix): The cost of keeping foliage transitions active and calling the new hook has not been measured in frame times.
When: In foliage-heavy scenes, transitions can remain active longer and the hook adds guest-context synchronization and a call; the reported approximate uncapped FPS does not show whether average or low frame rates and frame pacing change.
Do: Compare repeated interleaved base and head runs in the Graveyard and a foliage-heavy area, reporting average and 1% low FPS and frame-time distributions on representative hardware.
@ -1407,1 +1407,4 @@args = ["x20:ptr:box"][[site]]name = "foliage.impostorFlags"L3 (should fix): The rendering change has not been checked on the other affected Tier 1 systems.
When: The same foliage flags reach rendering on AMD and Steam Deck as well as NVIDIA, but the only reported patched run is Windows on NVIDIA, leaving their visual behavior and performance unknown.
Do: Run the foliage reproduction and check for rendering and pacing regressions on AMD Windows and Linux and Steam Deck, plus NVIDIA Linux, with results recorded before merge.
@ -0,0 +6,4 @@sys.path.insert(0, str(Path(__file__).resolve().parent))from sitecheck import callback, engine_fn, run, site # noqa: E402RUN_ALL_ARGS = ["--cc", "{clang}"]L1 (should fix): The test requires Clang even though its fixture is ordinary C and does not link a Clang-built object.
When: On a supported Linux development setup with GCC selected through CC and no Clang installed, run_all skips this regression test, or fails it in strict mode, despite having a working C compiler.
Do: Use the runner’s {cc} selection and make the fixture compilation honor supported compiler commands, including their arguments.
@fix
5a3a365b5385cb18ca4eRecommendation: Approve. The code is ready: only testing is left. The player reports and canopy measurements show a substantial reduction in abrupt foliage changes. Frame-time cost and behavior on the other affected Tier 1 systems remain unmeasured. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
85cb18ca4e. I rebased it ontomain(0a124fb900).Changed
Nothing was built or run: the checks run again on the new head.
The hook preserves the scene’s foliage fade choice on the performance path, reducing visible outline changes. The regression test now uses the selected C compiler; the runtime cost of longer transitions remains unknown.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
game/oot_sites.c:765: The cost of keeping foliage transitions active and calling the new hook has not been measured in frame times. When: In foliage-heavy scenes, transitions can remain active longer and the hook adds guest-context synchronization and a call; the reported approximate uncapped FPS does not show whether average or low frame rates and frame pacing change. Do: Compare repeated interleaved base and head runs in the Graveyard and a foliage-heavy area, reporting average and 1% low FPS and frame-time distributions on representative hardware.game/sites/sites.toml:1410: The rendering change has not been checked on the other affected Tier 1 systems. When: The same foliage flags reach rendering on AMD and Steam Deck as well as NVIDIA, but the only reported patched run is Windows on NVIDIA, leaving their visual behavior and performance unknown. Do: Run the foliage reproduction and check for rendering and pacing regressions on AMD Windows and Linux and Steam Deck, plus NVIDIA Linux, with results recorded before merge.Checks: they run again on this head; a failure shows on the pull request.
More: does it help, other systems, switches, what was read
Does it help: Yes for the reported visual defect: the PR reports large canopy changes falling from 38 to 0 at 4K 60 FPS, 25 to 3 at 4K uncapped, and 54 to 0 at 720p uncapped, using 357 video samples per clip. Frame-time cost has not been measured.
Other systems: The hook affects foliage using this flag across rendering systems. The reported game runs cover Windows Vulkan on an RTX 5070 Ti; AMD or Intel Vulkan and other affected Tier 1 systems remain untested.
Switches: None.
Reviewed:
85cb18ca4eagainst0a124fb900: Read the fix diff, full foliage regression test and compiler parser, and the changed hook and site declarations in the diff. Skimmed compiler-selection callers, repository rules, the PR template, and the reported runs; the larger changed code and site tables were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run tests were executed. The PR reports game testing, object compilation and lint; CI has not run on this head.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.