WIP: feat(menu): add simulated-turf presets #2241

Draft
erlo68 wants to merge 6 commits from erlo68/Longshot:feat/sim-turf-presets into main
Contributor

Summary

#2093 made simulated turf safe to tune beyond the game's list sizes, but its per-area raw controls still made useful quality/performance choices hard to reproduce. Players then asked for named presets, wider distance ranges and a controllable fade endpoint. This follow-up builds on #2093 (and current main, including #2174) with:

  • global Off, Low, Game's, High, Highest and Extreme presets, each derived from the installed profile of the area being played;
  • Custom selected automatically when a value changes, with those edits saved per area;
  • separate Fade start and Fade endpoint controls up to 200, direct Turf density percentages up to 200%, and 12/24/36 Minimum blades choices;
  • the implementation-oriented Far power row removed from the player-facing page while presets still choose its value internally.

This page affects the broad, flowing turf produced by the game's fluid/turf simulation. It does not change the short decorative blades controlled by Grass distance (the grass discussed by #1382).

Internally, the settings file moves to version 2 and stores the global preset plus per-area Custom values. The old menu keys remain as hidden compatibility rows. Turf density is now expressed directly as a percentage of the area's installed value. Version-1 global inverse-density multipliers retain their live meaning, including the old zero-density approximation. Version-1 per-area values remain raw and exact—even when they fall outside the new controls' range—until their field is edited. Editing Fade endpoint can also change Fade start to keep the range ordered. A Custom edit owns only the fields it actually changes. Starting from a named preset first carries that preset's active fields into Custom so the visual result does not jump.

Fade endpoint also needed more than a new slider: the game only enables its runtime foliage range override when both manager fields are set. The implementation therefore captures, writes and restores the paired start/endpoint override. While an endpoint override is selected, a lightweight watchdog restores only that pair if an event clears it without replacing the area's resource. Game's and every other configuration without an endpoint override stay on the ordinary scene-sampling path and do not periodically reapply settings. This fixes the first endpoint prototype, where the menu and saved value changed but the renderer ignored it.

The adaptive simulated-turf buffer implementation from #2093 is unchanged; these controls only give it different demand to accommodate. Because the visually useful Custom range can exceed a device-specific mesh-workgroup limit, this PR has a merge dependency on #2288, the renderer fix that bounds generated work against the current GPU's reported limits. #2251 remains the underlying issue report.

Review gpu/vk/menu/sim_turf.cpp for the player-facing page and gpu/vk/menu/sim_turf_settings.h for preset derivation, migration and paired range application.

Testing

Tested: Windows, Intel Core i7-14700KF, AMD Radeon RX 7900 XT, AMD driver 26.11.2 (LLPC), 3440x1440. From one saved Hyrule Field view, switched every preset live and captured the same camera position. Off removed simulated turf; Low reduced it; Game's restored the installed profile; High, Highest and Extreme changed coverage as specified. Switching directly from Off to High produced no visible intermediate flicker. Higher density percentages produced visibly greater turf coverage. The endpoint initially had no visible effect when written alone; the paired start/endpoint implementation changed the far coverage live. An Extreme endpoint of 3x showed instability, so the submitted preset uses 1.7x.

On current Windows head, a by-hand migration run started from a copied stable slot_05 and a version-1 settings file. In Hyrule Field, changing only Minimum blades from 12 to 24 retained the live legacy raw density at 500 and left the manager override (NaN, NaN). In Market, the version-1 raw density loaded as 300 while the installed minimum remained 1; changing only density from the displayed 150% to 125% produced raw density 250, kept the installed minimum at 1, and still left (NaN, NaN). Changing Fade start alone also left the override disabled; changing Fade endpoint then activated the required paired override (9.0, 70.0).

The running-game density direction was isolated at the same saved Hyrule Field camera with Fade start, endpoint and Minimum blades unchanged. Moving the UI from 25% to 200% changed raw TurfDensity from 50 to 400 and visibly increased simulated-turf coverage. Therefore increasing the raw field increases coverage; the version-1 global multiplier path is inverse because it divides the installed raw value.

A Windows production quick build completed with no compile failures after the original logic changes. On the current head, test_sim_turf_settings starts from a version-1 2.0x global density plus raw per-area density 500 and minimum blades 4, round-trips them through version 2, and verifies that the raw fields stay exact through edits to other rows. It also verifies that a default Game's tick performs only the normal scene sample, while an active paired endpoint is restored after the game clears it. The raw-migration assertion failed before the fix; deliberately restoring the old default full-apply path makes the sampling assertion fail. The final fixture passes through both installed clang++ and g++ command paths.

The full strict suite was attempted with llvm-mingw on PATH, but the local task runner interrupted it before the 907-check run completed, so no aggregate result is claimed and CI remains required. mise run lint passes the changed-file formatting, whitespace, gitleaks and ruff hooks after removing Codex's process-local Git credential injection; its repository-wide workflow check still reports the pre-existing ShellCheck SC2016 at .forgejo/workflows/build-windows.yml:82, a file this PR does not change.

Still to test:

  • Linux x86-64: compile and open the page, switch Game's -> High -> Game's, expecting the paired override to apply and restore without a crash (@Beanstalk linux build and simulated-turf preset smoke test).
  • Tier-1 NVIDIA on Windows: switch Off -> High -> Highest in Hyrule Field, expecting complete coverage changes without white blades or persistent flicker (@Beanstalk nvidia simulated-turf preset smoke test).

Measurements

Verdict: no difference shown: -0.6% fps (median 120.2 against 120.9), within the runs' spread (main 120.8 to 121.5, PR 119.4 to 121.1).

Setup: Windows 11, Intel Core i7-14700KF, AMD Radeon RX 7900 XT (driver 26.11.2); Hyrule Field child from a copy of stable slot_05; window 2150x900; output 3440x1440 native, render resolution fixed at 67% (2294x960), frame generation and V-Sync off, uncapped (HOS_FPS_MAX=1000). The overall Graphics quality preset was Custom; simulated turf used its default Game's preset. The frame trace measured 60 seconds after warm-up until no frame waited for a pipeline, in three interleaved main/PR pairs; medians are reported. Command: dev.py ab.

Before: main @ 753fb5af After: this PR @ 2ff65a76 Delta
FPS (each run) 120.9 / 121.5 / 120.8 (median 120.9) 121.1 / 119.4 / 120.2 (median 120.2) -0.6%
1% low FPS (1000 / p99) 94.8 92.2 -2.7%
Median frame time 8.17 ms 8.26 ms +0.09 ms
p99 frame time 10.55 ms 10.85 ms +0.30 ms
Frames of 50 ms or more (median) 2 0 -2

Spread: observed FPS ranges overlap: main 120.8 to 121.5; PR 119.4 to 121.1. These ranges do not predict what another run will show.

Risks

Named presets deliberately change simulated-turf workload: High, Highest and Extreme can cost substantial frame rate, and Extreme is labelled as potentially unstable. Players can return to Game's or Off immediately. The Custom limits were selected for useful visual tuning, not as a claim that one distance is safe on every GPU and scene. A restrictive UI clamp derived from the RX 7900 XT would not guarantee valid calls against other devices' limits. Therefore #2288 is a merge dependency: it bounds the actual renderer workload against the current GPU's limits. Without it, reachable Custom settings can exceed a native mesh-workgroup limit even while the adaptive record pool still has capacity, as reported in #2251.

The paired range override depends on the current game's manager fields. The code preserves game-owned values, restores them for Game's, and reapplies a selected range if an event clears it. A revert is sufficient if those fields change upstream.

Existing sim_turf_settings.ini version-1 per-area edits retain their raw values until their corresponding fields are edited; editing Fade endpoint can also change Fade start to keep the range ordered. Selecting a named preset replaces the legacy global-multiplier mode. No game saves, shader caches or build outputs change.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (the local Windows tool-name limitation is named above; CI is pending).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths (Windows passed; Linux is still pending).
  • Screenshots of the same spot on main and here, for a change that shows on screen (the attached Game's capture is the default reference; a separate main capture is still pending).
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary [#2093](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2093) made simulated turf safe to tune beyond the game's list sizes, but its per-area raw controls still made useful quality/performance choices hard to reproduce. Players then asked for named presets, wider distance ranges and a controllable fade endpoint. This follow-up builds on #2093 (and current `main`, including [#2174](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2174)) with: - global **Off**, **Low**, **Game's**, **High**, **Highest** and **Extreme** presets, each derived from the installed profile of the area being played; - **Custom** selected automatically when a value changes, with those edits saved per area; - separate Fade start and Fade endpoint controls up to 200, direct Turf density percentages up to 200%, and 12/24/36 Minimum blades choices; - the implementation-oriented Far power row removed from the player-facing page while presets still choose its value internally. This page affects the broad, flowing turf produced by the game's fluid/turf simulation. It does not change the short decorative blades controlled by **Grass distance** (the grass discussed by [#1382](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1382)). Internally, the settings file moves to version 2 and stores the global preset plus per-area Custom values. The old menu keys remain as hidden compatibility rows. Turf density is now expressed directly as a percentage of the area's installed value. Version-1 global inverse-density multipliers retain their live meaning, including the old zero-density approximation. Version-1 per-area values remain raw and exact—even when they fall outside the new controls' range—until their field is edited. Editing Fade endpoint can also change Fade start to keep the range ordered. A Custom edit owns only the fields it actually changes. Starting from a named preset first carries that preset's active fields into Custom so the visual result does not jump. Fade endpoint also needed more than a new slider: the game only enables its runtime foliage range override when both manager fields are set. The implementation therefore captures, writes and restores the paired start/endpoint override. While an endpoint override is selected, a lightweight watchdog restores only that pair if an event clears it without replacing the area's resource. Game's and every other configuration without an endpoint override stay on the ordinary scene-sampling path and do not periodically reapply settings. This fixes the first endpoint prototype, where the menu and saved value changed but the renderer ignored it. The adaptive simulated-turf buffer implementation from #2093 is unchanged; these controls only give it different demand to accommodate. Because the visually useful Custom range can exceed a device-specific mesh-workgroup limit, this PR has a merge dependency on [#2288](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2288), the renderer fix that bounds generated work against the current GPU's reported limits. [#2251](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2251) remains the underlying issue report. Review `gpu/vk/menu/sim_turf.cpp` for the player-facing page and `gpu/vk/menu/sim_turf_settings.h` for preset derivation, migration and paired range application. ## Testing **Tested:** Windows, Intel Core i7-14700KF, AMD Radeon RX 7900 XT, AMD driver 26.11.2 (LLPC), 3440x1440. From one saved Hyrule Field view, switched every preset live and captured the same camera position. Off removed simulated turf; Low reduced it; Game's restored the installed profile; High, Highest and Extreme changed coverage as specified. Switching directly from Off to High produced no visible intermediate flicker. Higher density percentages produced visibly greater turf coverage. The endpoint initially had no visible effect when written alone; the paired start/endpoint implementation changed the far coverage live. An Extreme endpoint of 3x showed instability, so the submitted preset uses 1.7x. On current Windows head, a by-hand migration run started from a copied stable `slot_05` and a version-1 settings file. In Hyrule Field, changing only Minimum blades from 12 to 24 retained the live legacy raw density at 500 and left the manager override `(NaN, NaN)`. In Market, the version-1 raw density loaded as 300 while the installed minimum remained 1; changing only density from the displayed 150% to 125% produced raw density 250, kept the installed minimum at 1, and still left `(NaN, NaN)`. Changing Fade start alone also left the override disabled; changing Fade endpoint then activated the required paired override `(9.0, 70.0)`. The running-game density direction was isolated at the same saved Hyrule Field camera with Fade start, endpoint and Minimum blades unchanged. Moving the UI from 25% to 200% changed raw `TurfDensity` from 50 to 400 and visibly increased simulated-turf coverage. Therefore increasing the raw field increases coverage; the version-1 global multiplier path is inverse because it divides the installed raw value. A Windows production quick build completed with no compile failures after the original logic changes. On the current head, `test_sim_turf_settings` starts from a version-1 2.0x global density plus raw per-area density 500 and minimum blades 4, round-trips them through version 2, and verifies that the raw fields stay exact through edits to other rows. It also verifies that a default Game's tick performs only the normal scene sample, while an active paired endpoint is restored after the game clears it. The raw-migration assertion failed before the fix; deliberately restoring the old default full-apply path makes the sampling assertion fail. The final fixture passes through both installed `clang++` and `g++` command paths. The full strict suite was attempted with llvm-mingw on `PATH`, but the local task runner interrupted it before the 907-check run completed, so no aggregate result is claimed and CI remains required. `mise run lint` passes the changed-file formatting, whitespace, gitleaks and ruff hooks after removing Codex's process-local Git credential injection; its repository-wide workflow check still reports the pre-existing ShellCheck SC2016 at `.forgejo/workflows/build-windows.yml:82`, a file this PR does not change. **Still to test:** - Linux x86-64: compile and open the page, switch Game's -> High -> Game's, expecting the paired override to apply and restore without a crash (`@Beanstalk linux build and simulated-turf preset smoke test`). - Tier-1 NVIDIA on Windows: switch Off -> High -> Highest in Hyrule Field, expecting complete coverage changes without white blades or persistent flicker (`@Beanstalk nvidia simulated-turf preset smoke test`). ## Measurements **Verdict:** no difference shown: -0.6% fps (median 120.2 against 120.9), within the runs' spread (main 120.8 to 121.5, PR 119.4 to 121.1). **Setup:** Windows 11, Intel Core i7-14700KF, AMD Radeon RX 7900 XT (driver 26.11.2); Hyrule Field child from a copy of stable `slot_05`; window 2150x900; output 3440x1440 native, render resolution fixed at 67% (2294x960), frame generation and V-Sync off, uncapped (`HOS_FPS_MAX=1000`). The overall Graphics quality preset was Custom; simulated turf used its default **Game's** preset. The frame trace measured 60 seconds after warm-up until no frame waited for a pipeline, in three interleaved main/PR pairs; medians are reported. Command: `dev.py ab`. | | Before: main @ `753fb5af` | After: this PR @ `2ff65a76` | Delta | |---|---|---|---| | FPS (each run) | 120.9 / 121.5 / 120.8 (median 120.9) | 121.1 / 119.4 / 120.2 (median 120.2) | -0.6% | | 1% low FPS (`1000 / p99`) | 94.8 | 92.2 | -2.7% | | Median frame time | 8.17 ms | 8.26 ms | +0.09 ms | | p99 frame time | 10.55 ms | 10.85 ms | +0.30 ms | | Frames of 50 ms or more (median) | 2 | 0 | -2 | **Spread:** observed FPS ranges overlap: main 120.8 to 121.5; PR 119.4 to 121.1. These ranges do not predict what another run will show. ## Risks Named presets deliberately change simulated-turf workload: High, Highest and Extreme can cost substantial frame rate, and Extreme is labelled as potentially unstable. Players can return to **Game's** or **Off** immediately. The Custom limits were selected for useful visual tuning, not as a claim that one distance is safe on every GPU and scene. A restrictive UI clamp derived from the RX 7900 XT would not guarantee valid calls against other devices' limits. Therefore [#2288](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2288) is a merge dependency: it bounds the actual renderer workload against the current GPU's limits. Without it, reachable Custom settings can exceed a native mesh-workgroup limit even while the adaptive record pool still has capacity, as reported in [#2251](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2251). The paired range override depends on the current game's manager fields. The code preserves game-owned values, restores them for Game's, and reapplies a selected range if an event clears it. A revert is sufficient if those fields change upstream. Existing `sim_turf_settings.ini` version-1 per-area edits retain their raw values until their corresponding fields are edited; editing Fade endpoint can also change Fade start to keep the range ordered. Selecting a named preset replaces the legacy global-multiplier mode. No game saves, shader caches or build outputs change. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (the local Windows tool-name limitation is named above; CI is pending). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths (Windows passed; Linux is still pending). - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen (the attached Game's capture is the default reference; a separate main capture is still pending). - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
feat(menu): add simulated-turf presets
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 11s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
57f0836c43
Follow the adaptive simulated-turf backend with global named presets, wider per-area controls, and paired runtime fade overrides.

Assisted-by: OpenAI Codex
Author
Contributor

Tested in game: Windows, Intel Core i7-14700KF, Radeon RX 7900 XT driver 26.11.2, Hyrule Field: switched every preset live from one saved camera; Off removed simulated turf, density percentages increased coverage directly, paired fade endpoint changed far coverage, and Off to High showed no visible intermediate flicker.

Tested in game: Windows, Intel Core i7-14700KF, Radeon RX 7900 XT driver 26.11.2, Hyrule Field: switched every preset live from one saved camera; Off removed simulated turf, density percentages increased coverage directly, paired fade endpoint changed far coverage, and Off to High showed no visible intermediate flicker.
Member

Possibly related, for context:

  • PR #2197 fix(vk): the simulated-turf switch rows sit in name order, so find() finds them — Open simulated-turf switch-table fix; verify interaction against menu/settings changes.
  • issue #950 Idea: More graphics performance and quality-of-life options — Open graphics-options request that this foliage-control feature partially addresses.
Possibly related, for context: - PR #2197 fix(vk): the simulated-turf switch rows sit in name order, so find() finds them — Open simulated-turf switch-table fix; verify interaction against menu/settings changes. - issue #950 Idea: More graphics performance and quality-of-life options — Open graphics-options request that this foliage-control feature partially addresses.
Author
Contributor

Visual comparison

All gameplay captures use the same Hyrule Field location and camera. The performance overlay is included for context, but each image is a single moment rather than a controlled benchmark.

Player-facing menu

Simulated-turf preset menu

Off

Fade start 0: simulated turf disabled.

Off preset

Low

Installed distances and blade count with 25% turf density.

Low preset

Game's

The area's installed simulated-turf profile and the default reference for this PR.

Game's preset

High

4x fade start, 1.5x endpoint, 200% density and 24 minimum blades.

High preset

Highest

10x fade start, 2x endpoint, 100% density and 36 minimum blades.

Highest preset

Extreme

12.5x fade start, 1.7x endpoint, 50% density, 24 minimum blades and reduced far-power falloff. This preset prioritizes reach and may be unstable.

Extreme preset

## Visual comparison All gameplay captures use the same Hyrule Field location and camera. The performance overlay is included for context, but each image is a single moment rather than a controlled benchmark. ### Player-facing menu ![Simulated-turf preset menu](https://git.magicbean.dev/attachments/87a5e3ac-e3d3-480e-988b-5a0c47ba9283) ### Off Fade start 0: simulated turf disabled. ![Off preset](https://git.magicbean.dev/attachments/b65e0b0b-e287-41e6-9fd1-0302fd7d6003) ### Low Installed distances and blade count with 25% turf density. ![Low preset](https://git.magicbean.dev/attachments/bef0e9b2-5378-4a38-a7c6-c4a1a9b29810) ### Game's The area's installed simulated-turf profile and the default reference for this PR. ![Game's preset](https://git.magicbean.dev/attachments/36ea3b29-fffa-4862-b902-d33dde72d18b) ### High 4x fade start, 1.5x endpoint, 200% density and 24 minimum blades. ![High preset](https://git.magicbean.dev/attachments/66f871d0-f6ea-4fac-a1bf-ea6658480203) ### Highest 10x fade start, 2x endpoint, 100% density and 36 minimum blades. ![Highest preset](https://git.magicbean.dev/attachments/fb2ba36a-f611-4a1f-966e-0e952fc84e89) ### Extreme 12.5x fade start, 1.7x endpoint, 50% density, 24 minimum blades and reduced far-power falloff. This preset prioritizes reach and may be unstable. ![Extreme preset](https://git.magicbean.dev/attachments/99287f4f-ce94-41bf-a0f7-5cabca8e75d8)
dazemc left a comment

Review at 57f0836c — comment only; the PR is WIP and CI is still pending (10 checks running), so there is no verdict here.

1. Version-1 global density is displayed inverted, and the first edit bakes the inverted value

  • gpu/vk/menu/sim_turf_settings.h:296 — legacy_scaled() applies density as base[1] / factor(1), so a 2.0x legacy multiplier means half the installed density.
  • gpu/vk/menu/sim_turf_settings.h:353 — the legacy-global display instead shows multipliers[1] * 10, so that same 2.0x reads 200%.
  • gpu/vk/menu/sim_turf_settings.h:364-366 — Custom 200% computes base[1] * factor, i.e. doubles density. The legacy display and the Custom scale mean opposite things.
  • gpu/vk/menu/sim_turf_settings.h:592-599 with area_changed at :605-614 — the first slider edit copies the displayed values into a Custom preset and clears legacy_global, so editing anything but density saves values[1] = 200 and applies base[1] * 2.0. Starting from the actual base[1] / 2, that is a 4x jump on the first edit.

The legacy density should be shown inverted (e.g. 1000 / multipliers[1], with the 0-multiplier case called out) before it can be saved as a percentage.

2. One slider rewrites all four fields and enables the endpoint override

  • gpu/vk/menu/sim_turf_settings.h:592-603 — save_custom_values() sets preset.changed = all_custom (:594; all_custom includes the endpoint bit, :41), copies all four displayed values (:595) and endpoint (:596). Every single-slider callback goes through it (area_changed, :605-614).
  • gpu/vk/menu/sim_turf_settings.h:358-370 — desired() applies every marked field, and bit count enables the runtime endpoint override (:368-370), so apply_endpoint (:445-480) writes manager +0x14c/+0x150 even when the user only touched, say, density.
  • gpu/vk/menu/sim_turf_settings.h:609 (with blade_choice at :301) — area_changed snaps blades, and the load default at :346 already shows blade_choice(base[2]). An area whose installed minimum is not 12/24/36 is rewritten without that slider being touched: Market's stock 2 (tests/sim_turf_settings_test.cpp:118, restored at :218) loads as 12 and the first edit saves 12 as a Custom change.

Should area_changed mark and save only the field being edited, and leave the endpoint bit unset unless the endpoint row/range actually requires it?

3. No version-1 migration test

tests/sim_turf_settings_test.cpp starts with no config file (:92), only writes and asserts version 2 (:186), and never writes a v1 file, loads a global/legacy_global line, or calls migrate_legacy_area (gpu/vk/menu/sim_turf_settings.h:309-323). The v1 load branch (:199-226) and the migration are new in this PR, and the diff also removes the old global-multiplier coverage; a v1 fixture with a 2.0x global line and an area record, loaded then edited, would pin down both findings 1 and 2.

4. Rules that pass

  • Module and keys: MENU_MODULE(sim_turf) at gpu/vk/menu/sim_turf.cpp:64, page sim_turf_settings at :83; no rows were added to vk_menu.cpp's table.
  • FROZEN keys: all eleven sim_turf_* keys are in tests/test_menu_ini_keys.py:65-75, including the new sim_turf_fade_endpoint and sim_turf_preset.
  • Hidden compatibility rows: sim_turf_global_multipliers has shown = false (gpu/vk/menu/sim_turf.cpp:100-112), the four multiplier sliders keep their keys and are hidden (:114-163), and sim_turf_far_power is hidden (:219-233), so old INI keys and control bridges still resolve.
  • Default: selected_preset = game_preset (gpu/vk/menu/sim_turf_settings.h:49) is Game's, asserted at tests/sim_turf_settings_test.cpp:129.
Review at `57f0836c` — comment only; the PR is WIP and CI is still pending (10 checks running), so there is no verdict here. ### 1. Version-1 global density is displayed inverted, and the first edit bakes the inverted value - `gpu/vk/menu/sim_turf_settings.h:296` — `legacy_scaled()` applies density as `base[1] / factor(1)`, so a 2.0x legacy multiplier means half the installed density. - `gpu/vk/menu/sim_turf_settings.h:353` — the legacy-global display instead shows `multipliers[1] * 10`, so that same 2.0x reads **200%**. - `gpu/vk/menu/sim_turf_settings.h:364-366` — Custom 200% computes `base[1] * factor`, i.e. **doubles** density. The legacy display and the Custom scale mean opposite things. - `gpu/vk/menu/sim_turf_settings.h:592-599` with `area_changed` at `:605-614` — the first slider edit copies the displayed `values` into a Custom preset and clears `legacy_global`, so editing anything but density saves `values[1] = 200` and applies `base[1] * 2.0`. Starting from the actual `base[1] / 2`, that is a 4x jump on the first edit. The legacy density should be shown inverted (e.g. `1000 / multipliers[1]`, with the 0-multiplier case called out) before it can be saved as a percentage. ### 2. One slider rewrites all four fields and enables the endpoint override - `gpu/vk/menu/sim_turf_settings.h:592-603` — `save_custom_values()` sets `preset.changed = all_custom` (`:594`; `all_custom` includes the endpoint bit, `:41`), copies all four displayed `values` (`:595`) and `endpoint` (`:596`). Every single-slider callback goes through it (`area_changed`, `:605-614`). - `gpu/vk/menu/sim_turf_settings.h:358-370` — `desired()` applies every marked field, and bit `count` enables the runtime endpoint override (`:368-370`), so `apply_endpoint` (`:445-480`) writes manager `+0x14c`/`+0x150` even when the user only touched, say, density. - `gpu/vk/menu/sim_turf_settings.h:609` (with `blade_choice` at `:301`) — `area_changed` snaps blades, and the load default at `:346` already shows `blade_choice(base[2])`. An area whose installed minimum is not 12/24/36 is rewritten without that slider being touched: Market's stock 2 (`tests/sim_turf_settings_test.cpp:118`, restored at `:218`) loads as 12 and the first edit saves 12 as a Custom change. Should `area_changed` mark and save only the field being edited, and leave the endpoint bit unset unless the endpoint row/range actually requires it? ### 3. No version-1 migration test `tests/sim_turf_settings_test.cpp` starts with no config file (`:92`), only writes and asserts version 2 (`:186`), and never writes a v1 file, loads a `global`/`legacy_global` line, or calls `migrate_legacy_area` (`gpu/vk/menu/sim_turf_settings.h:309-323`). The v1 load branch (`:199-226`) and the migration are new in this PR, and the diff also removes the old global-multiplier coverage; a v1 fixture with a 2.0x `global` line and an `area` record, loaded then edited, would pin down both findings 1 and 2. ### 4. Rules that pass - Module and keys: `MENU_MODULE(sim_turf)` at `gpu/vk/menu/sim_turf.cpp:64`, page `sim_turf_settings` at `:83`; no rows were added to `vk_menu.cpp`'s table. - FROZEN keys: all eleven `sim_turf_*` keys are in `tests/test_menu_ini_keys.py:65-75`, including the new `sim_turf_fade_endpoint` and `sim_turf_preset`. - Hidden compatibility rows: `sim_turf_global_multipliers` has `shown = false` (`gpu/vk/menu/sim_turf.cpp:100-112`), the four multiplier sliders keep their keys and are hidden (`:114-163`), and `sim_turf_far_power` is hidden (`:219-233`), so old INI keys and control bridges still resolve. - Default: `selected_preset = game_preset` (`gpu/vk/menu/sim_turf_settings.h:49`) is Game's, asserted at `tests/sim_turf_settings_test.cpp:129`.
Author
Contributor

Follow-up: device mesh-workgroup limit at very high Custom ranges

Stress testing beyond the submitted Extreme preset found a second, downstream ceiling. This is not an adaptive-buffer overflow:

  • on a Windows RX 7900 XT (AMD 26.11.2), the large pool peaked at 2,248,249 / 2,795,584 records, with every private mapping present;
  • the corresponding mesh-only indirect draw requested 70,195 workgroups;
  • this device advertises maxMeshWorkGroupCount[0] = 65,535;
  • the mesh shader consumes 32 pool records per workgroup (workgroup_id * 32 + lane), so the exact per-draw safe ceiling here is 2,097,120 records; record 2,097,121 requires an invalid 65,536th workgroup.

That explains the persistent flicker seen at values beyond Extreme, including nearby patches: the pool is filled through parallel atomic reservations, so record order changes and an over-limit mesh draw does not consistently lose only the farthest records. The submitted Extreme endpoint of 1.7x remained below the observed boundary in this scene; higher manual Custom values crossed it.

A proposed renderer follow-up is to make overload degrade by distance: classify/scatter pool records into coarse near-to-far distance buckets, consume them in that order, and clamp each mesh-only draw to the device's reported workgroup limit. That would keep nearby turf stable and discard the farthest tail first. A fully deterministic prefix/scatter would also remove churn inside the final partial bucket; alternatively, chunked mesh draws with a base-record offset would preserve every record but require more invasive shader/draw plumbing.

This PR does not attempt that backend change; this note records the discovered limit and a possible follow-up for the renderer maintainers.

### Follow-up: device mesh-workgroup limit at very high Custom ranges Stress testing beyond the submitted Extreme preset found a second, downstream ceiling. This is not an adaptive-buffer overflow: - on a Windows RX 7900 XT (AMD 26.11.2), the large pool peaked at **2,248,249 / 2,795,584 records**, with every private mapping present; - the corresponding mesh-only indirect draw requested **70,195 workgroups**; - this device advertises `maxMeshWorkGroupCount[0] = 65,535`; - the mesh shader consumes 32 pool records per workgroup (`workgroup_id * 32 + lane`), so the exact per-draw safe ceiling here is **2,097,120 records**; record 2,097,121 requires an invalid 65,536th workgroup. That explains the persistent flicker seen at values beyond Extreme, including nearby patches: the pool is filled through parallel atomic reservations, so record order changes and an over-limit mesh draw does not consistently lose only the farthest records. The submitted Extreme endpoint of 1.7x remained below the observed boundary in this scene; higher manual Custom values crossed it. A proposed renderer follow-up is to make overload degrade by distance: classify/scatter pool records into coarse near-to-far distance buckets, consume them in that order, and clamp each mesh-only draw to the device's reported workgroup limit. That would keep nearby turf stable and discard the farthest tail first. A fully deterministic prefix/scatter would also remove churn inside the final partial bucket; alternatively, chunked mesh draws with a base-record offset would preserve every record but require more invasive shader/draw plumbing. This PR does **not** attempt that backend change; this note records the discovered limit and a possible follow-up for the renderer maintainers.
fix(menu): preserve simulated-turf custom fields
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 15s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
a0f267e077
Author
Contributor

Addressed dazemc's migration and field-ownership findings in test-first commit 2c074667 and fix a0f267e0: v1 density now keeps its inverse meaning, Custom saves only owned fields/range coupling, and v1/v2 plus Market regressions pass. The separate oversized mesh-workgroup finding is now tracked in #2251.

Addressed dazemc's migration and field-ownership findings in test-first commit 2c074667 and fix a0f267e0: v1 density now keeps its inverse meaning, Custom saves only owned fields/range coupling, and v1/v2 plus Market regressions pass. The separate oversized mesh-workgroup finding is now tracked in #2251.
Owner
@review
BeanBot requested changes 2026-11-22 19:30:16 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. Migration changes some existing per-area settings. The expanded Custom range also reaches a confirmed invalid mesh draw.

Adds global simulated-turf presets, per-area Custom controls and a paired fade-range override. It makes choices easier to reproduce, but currently risks changed visuals for existing users and flickering at allowed Custom settings.

Blocking (3): must change before merging.

  1. L1 gpu/vk/menu/sim_turf_settings.h:320: Migration clamps and rounds valid version-1 per-area edits instead of preserving their live values. (more on the line) Do: Retain exact legacy raw values until the corresponding field is explicitly edited, including values outside the new controls' range, and cover those cases in the migration fixture.
  2. L2 gpu/vk/menu/sim_turf.cpp:182: The expanded Custom range permits demand beyond the device's mesh-workgroup limit without preventing the invalid draw. (more on the line) Do: Keep the controls within a demonstrably safe limit or make the renderer split or safely bound over-limit draws before exposing this range.
  3. L5: It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (for the author)

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3: The default path now reapplies settings periodically, but its cost against main is not measured. When: Players using the default Game's preset execute the new periodic apply path while playing; the PR's comparison table is pending. Do: Run interleaved main-versus-head measurements from the same save, scene and settings, reporting frame times and 1% lows. (@fix does its part first: Skip periodic reapplication when no override is active.)
  • L4: The paired manager override and preset transitions need coverage on the other affected systems. When: Only Windows on an AMD RX 7900 XT has an in-game result; Linux and Tier-1 NVIDIA behavior remain pending. Do: Complete the listed Linux build and preset smoke test and the NVIDIA preset transition run, recording the results.

@fix can do L1, L2 and L3.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • gpu/vk/menu/sim_turf_settings.h:425: Does increasing the raw TurfDensity field increase or decrease simulated-turf coverage in the running game?

Checks: Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven. The author reports visible preset and endpoint changes on a Windows RX 7900 XT, but the captures are single moments and the controlled comparison against main is pending.

Other systems: The settings write game-owned resources and manager fields and affect rendering demand on all GPUs and both supported operating systems. Linux, NVIDIA and the default-performance comparison are still untested; the author observed an over-limit mesh draw on the RX 7900 XT.

Switches: Adds the saved simulated-turf preset, default Game's, and a fade endpoint control; changes the density and blade controls and hides the old multiplier and far-power rows. Game's is intended to preserve the installed profile, but default performance has not been measured.

Reviewed: a0f267e077 against a2dc538590: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the changed menu and settings implementation, the settings fixture, the prior settings implementation, commits, comments and review. Skimmed the user documentation, menu-key check, developer standards and renderer references. The requested docs/review-checklist.md is absent; attachments and the full renderer were not read.; nothing run (a code review).

Checked and fine:

  • The new menu keys are added to the frozen key table and the compatibility rows remain hidden.
  • The settings file path uses a UTF-8 filesystem path and the Windows replacement uses wide file APIs.
  • The endpoint fixture checks that a cleared manager override is reapplied.

Testing: Read-only review; no builds, scripts or tests were run. The author reports a Windows in-game run and changed-file checks; CI is still running.

Overlaps and merge order: No overlapping pull request was established from the available checkout and review context.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** Migration changes some existing per-area settings. The expanded Custom range also reaches a confirmed invalid mesh draw. Adds global simulated-turf presets, per-area Custom controls and a paired fade-range override. It makes choices easier to reproduce, but currently risks changed visuals for existing users and flickering at allowed Custom settings. **Blocking (3)**: must change before merging. 1. **L1** `gpu/vk/menu/sim_turf_settings.h:320`: Migration clamps and rounds valid version-1 per-area edits instead of preserving their live values. (more on the line) **Do:** Retain exact legacy raw values until the corresponding field is explicitly edited, including values outside the new controls' range, and cover those cases in the migration fixture. 2. **L2** `gpu/vk/menu/sim_turf.cpp:182`: The expanded Custom range permits demand beyond the device's mesh-workgroup limit without preventing the invalid draw. (more on the line) **Do:** Keep the controls within a demonstrably safe limit or make the renderer split or safely bound over-limit draws before exposing this range. 3. **L5**: It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). *(for the author)* **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3**: The default path now reapplies settings periodically, but its cost against main is not measured. *When:* Players using the default Game's preset execute the new periodic apply path while playing; the PR's comparison table is pending. **Do:** Run interleaved main-versus-head measurements from the same save, scene and settings, reporting frame times and 1% lows. *(`@fix` does its part first: Skip periodic reapplication when no override is active.)* - **L4**: The paired manager override and preset transitions need coverage on the other affected systems. *When:* Only Windows on an AMD RX 7900 XT has an in-game result; Linux and Tier-1 NVIDIA behavior remain pending. **Do:** Complete the listed Linux build and preset smoke test and the NVIDIA preset transition run, recording the results. `@fix` can do L1, L2 and L3. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - `gpu/vk/menu/sim_turf_settings.h:425`: Does increasing the raw TurfDensity field increase or decrease simulated-turf coverage in the running game? **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The author reports visible preset and endpoint changes on a Windows RX 7900 XT, but the captures are single moments and the controlled comparison against main is pending. **Other systems:** The settings write game-owned resources and manager fields and affect rendering demand on all GPUs and both supported operating systems. Linux, NVIDIA and the default-performance comparison are still untested; the author observed an over-limit mesh draw on the RX 7900 XT. **Switches:** Adds the saved simulated-turf preset, default Game's, and a fade endpoint control; changes the density and blade controls and hides the old multiplier and far-power rows. Game's is intended to preserve the installed profile, but default performance has not been measured. **Reviewed:** a0f267e0770f against a2dc53859018: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the changed menu and settings implementation, the settings fixture, the prior settings implementation, commits, comments and review. Skimmed the user documentation, menu-key check, developer standards and renderer references. The requested docs/review-checklist.md is absent; attachments and the full renderer were not read.; nothing run (a code review). **Checked and fine:** - The new menu keys are added to the frozen key table and the compatibility rows remain hidden. - The settings file path uses a UTF-8 filesystem path and the Windows replacement uses wide file APIs. - The endpoint fixture checks that a cleared manager override is reapplied. **Testing:** Read-only review; no builds, scripts or tests were run. The author reports a Windows in-game run and changed-file checks; CI is still running. **Overlaps and merge order:** No overlapping pull request was established from the available checkout and review context. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -126,0 +179,4 @@
.label = "Fade endpoint",
.help = "Distance at which simulated turf is fully faded. It "
"always remains at least 1.0 beyond Fade start.",
.kind = menu::Kind::Slider,
Member

L2 (blocking): The expanded Custom range permits demand beyond the device's mesh-workgroup limit without preventing the invalid draw.

When: The author's RX 7900 XT run with a larger Custom range generated 70,195 workgroups against the device limit of 65,535 and produced persistent flicker, including nearby turf. These values are reachable through the new controls.

Do: Keep the controls within a demonstrably safe limit or make the renderer split or safely bound over-limit draws before exposing this range.

**L2** (blocking): The expanded Custom range permits demand beyond the device's mesh-workgroup limit without preventing the invalid draw. *When:* The author's RX 7900 XT run with a larger Custom range generated 70,195 workgroups against the device limit of 65,535 and produced persistent flicker, including nearby turf. These values are reachable through the new controls. **Do:** Keep the controls within a demonstrably safe limit or make the renderer split or safely bound over-limit draws before exposing this range.
@ -269,0 +317,4 @@
if (preset.changed & (1u << 1)) {
const double raw = preset.values[1];
preset.values[1] =
std::isfinite(base[1]) && base[1] > 0 && raw > 0 ? std::clamp(int(std::lround(raw * 100.0 / base[1])), 1, 200) : 100;
Member

L1 (blocking): Migration clamps and rounds valid version-1 per-area edits instead of preserving their live values.

When: A version-1 area with raw density 500 on an installed baseline of 100 is converted to 200%, then applied as 200; a saved minimum-blade value of 4 is converted to 12. Both values were valid in version 1 and change on entering the area.

Do: Retain exact legacy raw values until the corresponding field is explicitly edited, including values outside the new controls' range, and cover those cases in the migration fixture.

**L1** (blocking): Migration clamps and rounds valid version-1 per-area edits instead of preserving their live values. *When:* A version-1 area with raw density 500 on an installed baseline of 100 is converted to 200%, then applied as 200; a saved minimum-blade value of 4 is converted to 12. Both values were valid in version 1 and change on entering the area. **Do:** Retain exact legacy raw values until the corresponding field is explicitly edited, including values outside the new controls' range, and cover those cases in the migration fixture.
erlo68 force-pushed feat/sim-turf-presets from a0f267e077
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 15s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 2ff65a7675
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-22 22:08:15 +00:00
Compare
Author
Contributor

Rebased onto current main 753fb5af and addressed BeanBot L1/L3 in test-first commits a4b55475 and 2ff65a76.

  • L1: version-1 per-area values now stay raw and exact until the corresponding field is explicitly edited. The fixture covers density 500 and blades 4, including editing each independently.
  • L2: declared #2288 as this PR's merge dependency; #2251 is the underlying report. The Custom range remains visually useful rather than using a device-specific UI clamp; #2288 bounds actual generated work against each GPU's limits.
  • L3: the quarter-second scene poll now restores only a selected endpoint override. Game's and configurations without an endpoint override no longer call the full apply path periodically. The fixture's call count catches the old behavior, and the active-override restoration case still passes.
  • L5: branch rebased cleanly onto current main.

Focused fixture passes with the installed clang++ and g++; its negative checks fail when the reviewed bugs are restored. The strict 907-check suite was attempted but the local task runner interrupted it before completion. Changed-file lint hooks pass; the repository-wide workflow check still reports pre-existing ShellCheck SC2016 in .forgejo/workflows/build-windows.yml:82, which this PR does not modify. The PR remains WIP for #2288, the listed cross-platform runs, CI and measurements.

Rebased onto current main `753fb5af` and addressed BeanBot L1/L3 in test-first commits `a4b55475` and `2ff65a76`. - L1: version-1 per-area values now stay raw and exact until the corresponding field is explicitly edited. The fixture covers density 500 and blades 4, including editing each independently. - L2: declared [#2288](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2288) as this PR's merge dependency; [#2251](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2251) is the underlying report. The Custom range remains visually useful rather than using a device-specific UI clamp; #2288 bounds actual generated work against each GPU's limits. - L3: the quarter-second scene poll now restores only a selected endpoint override. Game's and configurations without an endpoint override no longer call the full apply path periodically. The fixture's call count catches the old behavior, and the active-override restoration case still passes. - L5: branch rebased cleanly onto current main. Focused fixture passes with the installed `clang++` and `g++`; its negative checks fail when the reviewed bugs are restored. The strict 907-check suite was attempted but the local task runner interrupted it before completion. Changed-file lint hooks pass; the repository-wide workflow check still reports pre-existing ShellCheck SC2016 in `.forgejo/workflows/build-windows.yml:82`, which this PR does not modify. The PR remains WIP for #2288, the listed cross-platform runs, CI and measurements.
Author
Contributor

Completed the two pending Windows checks on current head 2ff65a76, using fresh copies of stable slot_05 throughout.

  • Version-1 migration, by hand: Hyrule Field raw density stayed 500 when only Minimum blades changed 12 -> 24, with manager override (NaN, NaN). In Market, changing only displayed density 150% -> 125% changed raw density 300 -> 250, kept the installed Minimum blades value at 1, and left the override disabled. Changing Fade start alone still left it disabled; changing Fade endpoint activated the paired (9.0, 70.0) override.
  • Raw density direction: with Fade range and blades held constant at one saved Hyrule Field camera, 25% -> 200% changed raw TurfDensity 50 -> 400 and visibly increased coverage. Increasing the raw field therefore increases simulated-turf coverage; the legacy global multiplier is inverse because it divides that raw installed value.
  • L3 measurement: three interleaved 60-second pairs against main 753fb5af, same copied save/scene/settings, fixed 67% render resolution, uncapped. Verdict: no difference shown. Main median 120.9 FPS / 8.17 ms; PR default Game's median 120.2 FPS / 8.26 ms. 1% lows were 94.8 vs 92.2 FPS; p99 10.55 vs 10.85 ms. Observed FPS ranges overlap (main 120.8-121.5, PR 119.4-121.1).

dev.py ab wrote the standard measurements.md and results.json; its final console echo alone hit Windows CP1252 on the report's delta character after both files were written. The PR description now contains the report and removes only these completed Windows items from Still to test. Linux, Tier-1 NVIDIA, CI, a main comparison screenshot and merge dependency #2288 remain pending; the PR stays WIP.

Completed the two pending Windows checks on current head `2ff65a76`, using fresh copies of stable `slot_05` throughout. - **Version-1 migration, by hand:** Hyrule Field raw density stayed 500 when only Minimum blades changed 12 -> 24, with manager override `(NaN, NaN)`. In Market, changing only displayed density 150% -> 125% changed raw density 300 -> 250, kept the installed Minimum blades value at 1, and left the override disabled. Changing Fade start alone still left it disabled; changing Fade endpoint activated the paired `(9.0, 70.0)` override. - **Raw density direction:** with Fade range and blades held constant at one saved Hyrule Field camera, 25% -> 200% changed raw `TurfDensity` 50 -> 400 and visibly increased coverage. Increasing the raw field therefore increases simulated-turf coverage; the legacy global multiplier is inverse because it divides that raw installed value. - **L3 measurement:** three interleaved 60-second pairs against main `753fb5af`, same copied save/scene/settings, fixed 67% render resolution, uncapped. Verdict: no difference shown. Main median 120.9 FPS / 8.17 ms; PR default Game's median 120.2 FPS / 8.26 ms. 1% lows were 94.8 vs 92.2 FPS; p99 10.55 vs 10.85 ms. Observed FPS ranges overlap (main 120.8-121.5, PR 119.4-121.1). `dev.py ab` wrote the standard `measurements.md` and `results.json`; its final console echo alone hit Windows CP1252 on the report's delta character after both files were written. The PR description now contains the report and removes only these completed Windows items from **Still to test**. Linux, Tier-1 NVIDIA, CI, a main comparison screenshot and merge dependency #2288 remain pending; the PR stays WIP.
Owner
@review
BeanBot requested changes 2026-11-23 00:15:25 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. Some valid version-1 fade-start values are still changed on migration, and reachable Custom settings can produce an invalid mesh draw until the renderer dependency is merged.

Adds named simulated-turf presets and per-area Custom controls, including a paired fade-range override. The presets give players reproducible quality choices, but migration and device-limit protection remain incomplete.

Blocking (2): must change before merging.

  1. L1 gpu/vk/menu/sim_turf_settings.h:320: Migration clamps and rounds valid version-1 per-area edits instead of preserving their live values. When: A version-1 area with raw density 500 on an installed baseline of 100 is converted to 200%, then applied as 200; a saved minimum-blade value of 4 is converted to 12. Both values were valid in version 1 and change on entering the area. Do: Retain exact legacy raw values until the corresponding field is explicitly edited, including values outside the new controls' range, and cover those cases in the migration fixture.
  2. L2 gpu/vk/menu/sim_turf.cpp:182: The expanded Custom range permits demand beyond the device's mesh-workgroup limit without preventing the invalid draw. When: The author's RX 7900 XT run with a larger Custom range generated 70,195 workgroups against the device limit of 65,535 and produced persistent flicker, including nearby turf. These values are reachable through the new controls. Do: Keep the controls within a demonstrably safe limit or make the renderer split or safely bound over-limit draws before exposing this range.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L4: The paired manager override and preset transitions need coverage on the other affected systems. When: Only Windows on an AMD RX 7900 XT has an in-game result; Linux and Tier-1 NVIDIA behavior remain pending. Do: Complete the listed Linux build and preset smoke test and the NVIDIA preset transition run, recording the results.

@fix can do L1 and L2.

Since the last review (on a0f267e077)
Resolved: L3 (The default path now reapplies settings periodically, but its cost against main is not mea…); L5 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)
Still open: L1 (Migration clamps and rounds valid version-1 per-area edits instead of preserving their liv…); L2 (The expanded Custom range permits demand beyond the device's mesh-workgroup limit without…); L4 (The paired manager override and preset transitions need coverage on the other affected sys…)

Checks: Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes for the feature: the author reports live preset, density and endpoint changes on Windows with an RX 7900 XT. The default-path comparison showed no performance difference within the reported spread: median 120.9 FPS on main versus 120.2 FPS here.

Other systems: The menu changes shared rendering demand and manager fields across GPUs and operating systems. Windows AMD was tested; Linux and Tier-1 NVIDIA runs remain outstanding. The device mesh-workgroup limit also requires the declared renderer dependency.

Switches: The new simulated-turf preset defaults to Game's; Custom values are saved per area. Game's is an appropriate default because it retains the installed profile.

Reviewed: 2ff65a7675 against 753fb5af68: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the changed settings logic and fixture, and the supplied comments and reviews. Reviewed the change diff; the user documentation and menu-key test were skimmed. No docs/review-checklist.md exists.; nothing run (a code review).

Checked and fine:

  • Legacy raw density and minimum-blade values are retained independently until their rows are edited.
  • The active endpoint watchdog reapplies only the paired manager override.
  • The fixture covers raw migration, independent field edits and the default sampling path.

Testing: No code or tests were run for this review. The author reports Windows in-game and fixture checks; Linux, NVIDIA, the main comparison screenshot and CI remain pending.

Overlaps and merge order: #2288 must merge before this pull request to bound renderer work against device limits.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** Some valid version-1 fade-start values are still changed on migration, and reachable Custom settings can produce an invalid mesh draw until the renderer dependency is merged. Adds named simulated-turf presets and per-area Custom controls, including a paired fade-range override. The presets give players reproducible quality choices, but migration and device-limit protection remain incomplete. **Blocking (2)**: must change before merging. 1. **L1** `gpu/vk/menu/sim_turf_settings.h:320`: Migration clamps and rounds valid version-1 per-area edits instead of preserving their live values. *When:* A version-1 area with raw density 500 on an installed baseline of 100 is converted to 200%, then applied as 200; a saved minimum-blade value of 4 is converted to 12. Both values were valid in version 1 and change on entering the area. **Do:** Retain exact legacy raw values until the corresponding field is explicitly edited, including values outside the new controls' range, and cover those cases in the migration fixture. 2. **L2** `gpu/vk/menu/sim_turf.cpp:182`: The expanded Custom range permits demand beyond the device's mesh-workgroup limit without preventing the invalid draw. *When:* The author's RX 7900 XT run with a larger Custom range generated 70,195 workgroups against the device limit of 65,535 and produced persistent flicker, including nearby turf. These values are reachable through the new controls. **Do:** Keep the controls within a demonstrably safe limit or make the renderer split or safely bound over-limit draws before exposing this range. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The paired manager override and preset transitions need coverage on the other affected systems. *When:* Only Windows on an AMD RX 7900 XT has an in-game result; Linux and Tier-1 NVIDIA behavior remain pending. **Do:** Complete the listed Linux build and preset smoke test and the NVIDIA preset transition run, recording the results. `@fix` can do L1 and L2. **Since the last review** (on a0f267e0770f) Resolved: L3 (The default path now reapplies settings periodically, but its cost against main is not mea…); L5 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) Still open: L1 (Migration clamps and rounds valid version-1 per-area edits instead of preserving their liv…); L2 (The expanded Custom range permits demand beyond the device's mesh-workgroup limit without…); L4 (The paired manager override and preset transitions need coverage on the other affected sys…) **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the feature: the author reports live preset, density and endpoint changes on Windows with an RX 7900 XT. The default-path comparison showed no performance difference within the reported spread: median 120.9 FPS on main versus 120.2 FPS here. **Other systems:** The menu changes shared rendering demand and manager fields across GPUs and operating systems. Windows AMD was tested; Linux and Tier-1 NVIDIA runs remain outstanding. The device mesh-workgroup limit also requires the declared renderer dependency. **Switches:** The new simulated-turf preset defaults to Game's; Custom values are saved per area. Game's is an appropriate default because it retains the installed profile. **Reviewed:** 2ff65a7675f1 against 753fb5af6860: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the changed settings logic and fixture, and the supplied comments and reviews. Reviewed the change diff; the user documentation and menu-key test were skimmed. No docs/review-checklist.md exists.; nothing run (a code review). **Checked and fine:** - Legacy raw density and minimum-blade values are retained independently until their rows are edited. - The active endpoint watchdog reapplies only the paired manager override. - The fixture covers raw migration, independent field edits and the default sampling path. **Testing:** No code or tests were run for this review. The author reports Windows in-game and fixture checks; Linux, NVIDIA, the main comparison screenshot and CI remain pending. **Overlaps and merge order:** #2288 must merge before this pull request to bound renderer work against device limits. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner
@fix
BeanBot force-pushed feat/sim-turf-presets from 2ff65a7675
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 27dd1adde2
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
PR description / Description follows the template (pull_request_target) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
Third-party parts / As their notes say (pull_request) Successful in 26s
CI / Website build and checks (pull_request) Successful in 4m32s
2026-11-23 00:34:11 +00:00
Compare
BeanBot left a comment

Recommendation: Request changes. Custom settings can still produce an invalid mesh draw beyond the GPU's workgroup limit. The reported renderer dependency has not been shown merged into the base.

What @fix changed
I changed this pull request: the new head is 27dd1adde2. I rebased it onto main (21d5bdf9bc). I edited its description to match the change.

Changed

  • Legacy fade start migration: Preserved the raw fade start independently of display normalization, including the version-1 maximum, in gpu/vk/menu/sim_turf_settings.h:220. Extended the migration fixture in tests/sim_turf_settings_test.cpp:171. Tests were not run as requested.

Not done

  • Bound simulated-turf mesh workgroups, gpu/vk/menu/sim_turf.cpp:182: The GPU-generated indirect counts are copied without a limit in gpu/vk/vk_draw.cpp:7875 and also feed the compute fallback. This needs a device-limit-aware GPU-side bound or split covering both paths and their fallback cases. No demonstrably safe control limit was established.

Nothing was built or run: the checks run again on the new head.

The change adds named simulated-turf presets and per-area Custom controls. The latest fix preserves legacy fade-start values, but the renderer limit remains unbounded and the displayed start can differ from the live value.

Blocking (1): must change before merging.

  1. L2 gpu/vk/menu/sim_turf.cpp:182: The expanded Custom range permits demand beyond the device's mesh-workgroup limit without preventing the invalid draw. When: The author's RX 7900 XT run with a larger Custom range generated 70,195 workgroups against the device limit of 65,535 and produced persistent flicker, including nearby turf. These values are reachable through the new controls. Do: Keep the controls within a demonstrably safe limit or make the renderer split or safely bound over-limit draws before exposing this range. (for the author: @fix couldn't: The Custom range still reaches settings that generated 70,195 workgroups on a device limited to 65,535. The indirect conversion copies the GPU count without a device-limit bound, and #2288 has not bee)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L4: The paired manager override and preset transitions need coverage on the other affected systems. When: Only Windows on an AMD RX 7900 XT has an in-game result; Linux and Tier-1 NVIDIA behavior remain pending. Do: Complete the listed Linux build and preset smoke test and the NVIDIA preset transition run, recording the results.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (3; not asked for, not blocking)
  • When a preserved legacy start exceeds the displayed endpoint, selecting an endpoint can use the normalized displayed start for the manager pair while retaining the raw resource start.
  • The base-to-head diff includes inherited renderer and documentation commits beyond the five files listed in the pull request.
  • A same-scene main comparison screenshot and head CI results remain pending.
More: does it help, other systems, switches, what was read

Does it help: Yes: the author reports successful live preset and endpoint changes on Windows with an RX 7900 XT. Three interleaved default-preset comparisons showed 120.9 FPS on main versus 120.2 FPS on the PR, within the reported spread; this is not a performance gain claim.

Other systems: The controls affect shared rendering and GPU-generated indirect draws. Linux and Tier-1 NVIDIA runs remain pending; the observed workgroup-limit failure occurred on an RX 7900 XT.

Switches: The turf preset defaults to Game's; named presets and per-area Custom values are player-facing settings. The legacy multiplier and far-power rows remain hidden for compatibility.

Reviewed: 27dd1adde2 against 21d5bdf9bc: Read AGENTS.md, CONTRIBUTING.md, the PR template, relevant standards, the fix diff and the changed settings logic; inspected the menu controls, fixture, renderer indirect-draw path and PR evidence. The supplied base-to-head diff also includes unrelated inherited changes; those files were not read in full.; nothing run (a code review).

Checked and fine:

  • Version-1 and version-2 legacy area records retain fade-start values through the old maximum when loaded.
  • The fix retains the preset feature and does not route around it.
  • The default Game's path does not periodically reapply the full settings.

Testing: No commands from the project or tests were run. The author reports focused fixture passes on Windows compiler paths and a Windows in-game migration check; Linux and NVIDIA coverage remain pending.

Overlaps and merge order: #2288 is the stated renderer dependency and must merge before this PR unless the limit is addressed here.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** Custom settings can still produce an invalid mesh draw beyond the GPU's workgroup limit. The reported renderer dependency has not been shown merged into the base. **What `@fix` changed** I changed this pull request: the new head is 27dd1adde237. I rebased it onto `main` (21d5bdf9bc64). I edited its description to match the change. **Changed** - **Legacy fade start migration**: Preserved the raw fade start independently of display normalization, including the version-1 maximum, in gpu/vk/menu/sim_turf_settings.h:220. Extended the migration fixture in tests/sim_turf_settings_test.cpp:171. Tests were not run as requested. **Not done** - **Bound simulated-turf mesh workgroups, gpu/vk/menu/sim_turf.cpp:182**: The GPU-generated indirect counts are copied without a limit in gpu/vk/vk_draw.cpp:7875 and also feed the compute fallback. This needs a device-limit-aware GPU-side bound or split covering both paths and their fallback cases. No demonstrably safe control limit was established. Nothing was built or run: the checks run again on the new head. The change adds named simulated-turf presets and per-area Custom controls. The latest fix preserves legacy fade-start values, but the renderer limit remains unbounded and the displayed start can differ from the live value. **Blocking (1)**: must change before merging. 1. **L2** `gpu/vk/menu/sim_turf.cpp:182`: The expanded Custom range permits demand beyond the device's mesh-workgroup limit without preventing the invalid draw. *When:* The author's RX 7900 XT run with a larger Custom range generated 70,195 workgroups against the device limit of 65,535 and produced persistent flicker, including nearby turf. These values are reachable through the new controls. **Do:** Keep the controls within a demonstrably safe limit or make the renderer split or safely bound over-limit draws before exposing this range. *(for the author: `@fix` couldn't: The Custom range still reaches settings that generated 70,195 workgroups on a device limited to 65,535. The indirect conversion copies the GPU count without a device-limit bound, and #2288 has not bee)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The paired manager override and preset transitions need coverage on the other affected systems. *When:* Only Windows on an AMD RX 7900 XT has an in-game result; Linux and Tier-1 NVIDIA behavior remain pending. **Do:** Complete the listed Linux build and preset smoke test and the NVIDIA preset transition run, recording the results. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (3; not asked for, not blocking)</summary> - When a preserved legacy start exceeds the displayed endpoint, selecting an endpoint can use the normalized displayed start for the manager pair while retaining the raw resource start. - The base-to-head diff includes inherited renderer and documentation commits beyond the five files listed in the pull request. - A same-scene main comparison screenshot and head CI results remain pending. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the author reports successful live preset and endpoint changes on Windows with an RX 7900 XT. Three interleaved default-preset comparisons showed 120.9 FPS on main versus 120.2 FPS on the PR, within the reported spread; this is not a performance gain claim. **Other systems:** The controls affect shared rendering and GPU-generated indirect draws. Linux and Tier-1 NVIDIA runs remain pending; the observed workgroup-limit failure occurred on an RX 7900 XT. **Switches:** The turf preset defaults to Game's; named presets and per-area Custom values are player-facing settings. The legacy multiplier and far-power rows remain hidden for compatibility. **Reviewed:** 27dd1adde237 against 21d5bdf9bc64: Read AGENTS.md, CONTRIBUTING.md, the PR template, relevant standards, the fix diff and the changed settings logic; inspected the menu controls, fixture, renderer indirect-draw path and PR evidence. The supplied base-to-head diff also includes unrelated inherited changes; those files were not read in full.; nothing run (a code review). **Checked and fine:** - Version-1 and version-2 legacy area records retain fade-start values through the old maximum when loaded. - The fix retains the preset feature and does not route around it. - The default Game's path does not periodically reapply the full settings. **Testing:** No commands from the project or tests were run. The author reports focused fixture passes on Windows compiler paths and a Windows in-game migration check; Linux and NVIDIA coverage remain pending. **Overlaps and merge order:** #2288 is the stated renderer dependency and must merge before this PR unless the limit is addressed here. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
PR description / Description follows the template (pull_request_target) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
Third-party parts / As their notes say (pull_request) Successful in 26s
CI / Website build and checks (pull_request) Successful in 4m32s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/sim-turf-presets:erlo68-feat/sim-turf-presets'
git switch 'erlo68-feat/sim-turf-presets'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2241
No description provided.