fix(oot): keep sun shadows sharp on ultrawide and move the cascade splits #2431

Open
Wrath wants to merge 5 commits from Wrath/Longshot:fix/2274-ultrawide-shadows into mod-api
First-time contributor

Ported onto mod-api (Longshot's mod API branch, #2434). On mod-api the game's shadow code is the Shadows system mod (game/mods/shadows), so this PR now targets mod-api:

  • Kept as they were: host/shadow_res.h (now only declarations), host/nn_applet.c, host/game_host.h, the vk_draw.cpp cascade bias, the HOS_SHADOW_RES and HOS_SHADOW_SPLITS switches, and the docs rows.
  • Moved: the wide shadow size to game/mods/shadows (wide.rs, its one owner; the host calls game_shadow_res_wide/_switch); the cascade split fit to splits.rs on a new format-1 site shadow.fitSplits.
  • Gone with mod-api: game/oot_shadow.c, oot_shadow_fit.c, oot_sites.c, the build's locations.toml and the C tests; their cases are Rust tests now.
  • Tested on this PC (RTX 3090, Linux), queue job l7-1 at 56517e3a: the tests above, Windows clippy, a game build, and headless shots on the castle-gate save. The log at 32:9 shows 5120 shadow texels (pool 802 MB, 192 MB for the sun's shadows) and cascades ending at 12 m and 45 m; at 16:9, 4096 texels. No visible seam in either shot (the 32:9 shot is a 1280x720 capture, so it can't judge the fine sharpness).

Summary

On monitors wider than 16:9, the game fits each sun shadow cascade around its slice of the wider horizontal view while keeping the same 3072x3072 shadow map. That spreads the same texels over a much wider area (worst at 32:9), making shadows coarse, shimmery, and flickering as the camera or sun moves, and making the cascade 0 to cascade 1 seam very noticeable on objects like the Castle Town drawbridge chains and archway.

To reproduce on main: launch at 32:9 (5120x1440) with Shadow resolution on Highest or Auto (12 GB+ GPU), go to Hyrule Field near the drawbridge and trees, and watch the shadow edges shimmer and soften across the near cascade seam.

What this changes:

  • Shadow map resolution (Highest and Auto on 12 GB+ GPUs): sets 16:9 and narrower to 4096, and scales smoothly upward with wider aspect ratios using 4096 * (aspect / (16/9))^0.3219 (rounded to a multiple of 8, capped at 5120: about 4512 at 21:9, 5120 at 32:9). The render target pool reserves the extra room at boot as long as the total stays within 900 MB; otherwise Highest falls back to 3072. An explicit HOS_RT_POOL_MB is used as-is and disables automatic shadow-map scaling. High (8 GB cards at 2200) and Game's presets are unchanged. HOS_SHADOW_RES=0 restores the menu's sizes, including 3072 on Highest; HOS_SHADOW_RES=<texels> (64 to 8192, rounded up to a multiple of 8) forces a size. A forced size bypasses the automatic 900 MB limit; with HOS_RT_POOL_MB set, the pool is used as-is.
  • Cascade splits: moves cascade 1 end to 45 m across all aspect ratios, and cascade 0 end to 15 m at 16:9 and narrower, 12 m at 32:9 and wider, sliding linearly in between (13.97 m at 3440x1440). HOS_SHADOW_SPLITS=0 (or off / 0,0) restores the game's splits; HOS_SHADOW_SPLITS=<c0>,<c1> overrides them. If the requested splits would leave a slice empty or out of order, the game's splits are kept there.
  • Cascade depth bias: for each sun shadow map larger than 4096, adds 3,4 to the cascade depth bias to suppress shadow acne on the higher-resolution maps. Maps at 4096 or smaller get no automatic addition. RX_VK_CASCADE_BIAS (including 0,0) overrides the automatic addition.

Result: shadows on 32:9 and 16:9 are sharper and mostly stop flickering in Hyrule Field, including across the drawbridge chains, archway, trees, and Link up close.

Files to read first: game/mods/shadows/src/wide.rs, game/mods/shadows/src/splits.rs, host/shadow_res.h, host/nn_applet.c, gpu/vk/vk_draw.cpp.

Fixes #2274

Testing

Tested: Windows 11 Pro, NVIDIA GeForce RTX 3090 (24 GB), driver 621.01, DLAA, Shadow resolution on Highest. I walked Hyrule Field near the Castle Town drawbridge, the gate and the river wall at both 32:9 (5120x1440) and 16:9 (2560x1440), once on main (Nightly 805, 6b928cb4) and once on this PR (1a8cbac2), with the stat screen open in every picture. The pictures are below the list.

  • At 16:9 the PR build looks great to me and really helps with the shadows there.
  • 32:9 booted with 5120 sun shadows (+192 MB render target pool, 802 MB total), 12.00 m / 45.00 m cascade splits, and 3,4 cascade bias. The nearest shadows are sharper and steadier around Link and the drawbridge. I have not looked closely at the farther shadow slices yet.
  • 16:9 booted with 4096 sun shadows (+84 MB render target pool, 596 MB total), 15.00 m / 45.00 m cascade splits, and 0,0 cascade bias.
  • Checks: mise run lint passes (only the pre-existing shellcheck note on build-windows.yml). Affected tests (test_oot_shadow, test_oot_shadow_splits, test_oot_shadow_fit, test_output_resolution, test_rt_pool_minimum, test_switch_table, test_settings_table, test_menu_ini_keys) all pass on this branch, and all 5 shadow/pool tests fail when copied onto clean origin/main (90fae88c). On mise run test, the 28 remaining failures are identical on clean origin/main.

32:9 (5120x1440), main first, this PR second

Castle wall by the river
main @ 6b928cb4, 32:9, castle wall by the river
this PR @ 1a8cbac2, 32:9, castle wall by the river

Castle in the field
main @ 6b928cb4, 32:9, castle in the field
this PR @ 1a8cbac2, 32:9, castle in the field

Drawbridge chains
main @ 6b928cb4, 32:9, drawbridge chains
this PR @ 1a8cbac2, 32:9, drawbridge chains

16:9 (2560x1440), main first, this PR second

Castle gate
main @ 6b928cb4, 16:9, castle gate
this PR @ 1a8cbac2, 16:9, castle gate

Castle wall by the river
main @ 6b928cb4, 16:9, castle wall by the river
this PR @ 1a8cbac2, 16:9, castle wall by the river

Still to test:

  • 21:9 (3440x1440) on Highest/Auto (12 GB+ GPU): boot into Hyrule Field, expecting a 4512 shadow map (+125 MB pool), 13.97 m / 45.00 m splits, and the automatic 3,4 bias (@Beanstalk or by hand).
  • 8 GB GPU at 32:9 on Auto/High: boot into Hyrule Field, expecting the 2200 shadow map unchanged and no VRAM out-of-memory (@Beanstalk or by hand).
  • AMD and Intel GPUs at 32:9: check that the automatic 3,4 cascade bias does not cause peter-panning or shadow acne (@Beanstalk or by hand).
  • Linux: build the host code on Linux, expecting a clean build (by hand, only the Windows llvm-mingw build was run locally).

Measurements

Verdict: In these spot checks the PR build runs about the same as main: frame time within 1 ms and GPU time within 0.5 ms at the same spots, with the render target pool growing by 192 MB at 32:9 and 84 MB at 16:9. Each spot is one reading, not an interleaved median, so please treat the table as a sanity check and not a full benchmark.

Setup: Windows 11 Pro, RTX 3090 (24 GB), driver 621.01, Ryzen 9 5900X, DLAA, V-Sync off, Shadow resolution on Highest, Hyrule Field near Castle Town. FPS, frame time and GPU time are read from the stat screen open in each picture; the pool sizes come from the run logs. main is Nightly 805 (6b928cb4), which had RX_VK_CASCADE_BIAS=0,2 and HOS_SHADOW_STABLE=1 set; the PR run had no switches set. The PR was measured on 1a8cbac2, the head before BeanBot's rebase (it is now a3489f89), and I have not re-measured on the new head.

Before: main @ 6b928cb4 After: this PR @ 1a8cbac2
32:9 castle wall by the river 63 fps, 16.4 ms, GPU 12.1 ms 62 fps, 16.4 ms, GPU 12.2 ms
32:9 castle in the field 67 fps, 15.0 ms, GPU 11.0 ms 64 fps, 15.3 ms, GPU 11.5 ms
32:9 drawbridge chains 69 fps, 14.5 ms, GPU 10.9 ms 74 fps, 13.6 ms, GPU 10.6 ms
16:9 castle gate 84 fps, 12.2 ms, GPU 7.5 ms 84 fps, 12.0 ms, GPU 7.7 ms
16:9 castle wall by the river 78 fps, 13.3 ms, GPU 8.0 ms 82 fps, 12.5 ms, GPU 8.3 ms
32:9 render target pool 610 MB 802 MB (+192 MB)
16:9 render target pool 512 MB 596 MB (+84 MB)

Risks

  • Larger shadow maps use more render-target pool memory (+84 MB at 16:9, +125 MB at 21:9, +192 MB at 32:9) and add some shadow-pass GPU cost. The 900 MB limit prevents automatic scaling on setups that would run tight (such as 5K 16:9 or 4K-class 21:9), and 8 GB GPUs (High / 2200) are untouched by default. Forced shadow sizes bypass that limit, and an explicit pool size is used as-is.
  • Kill switches: HOS_SHADOW_RES=0 restores 3072, HOS_SHADOW_SPLITS=0 restores the game's splits, and RX_VK_CASCADE_BIAS=0,0 disables the automatic bias. A plain revert also backs everything out cleanly.
  • Player impact after updating: saves and longshot_options.ini are untouched.

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 (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure. (One reading per spot so far; interleaved runs on the new head are still to do.)
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • 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 verified; Linux still to do.)
  • Screenshots of the same spot on main and here, for a change that shows on screen.
  • 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.
> **Ported onto `mod-api` (Longshot's mod API branch, #2434).** On `mod-api` the game's shadow code is the Shadows system mod (`game/mods/shadows`), so this PR now targets `mod-api`: > - Kept as they were: `host/shadow_res.h` (now only declarations), `host/nn_applet.c`, `host/game_host.h`, the `vk_draw.cpp` cascade bias, the `HOS_SHADOW_RES` and `HOS_SHADOW_SPLITS` switches, and the docs rows. > - Moved: the wide shadow size to `game/mods/shadows` (`wide.rs`, its one owner; the host calls `game_shadow_res_wide`/`_switch`); the cascade split fit to `splits.rs` on a new format-1 site `shadow.fitSplits`. > - Gone with `mod-api`: `game/oot_shadow.c`, `oot_shadow_fit.c`, `oot_sites.c`, the build's `locations.toml` and the C tests; their cases are Rust tests now. > - Tested on this PC (RTX 3090, Linux), queue job l7-1 at 56517e3a: the tests above, Windows clippy, a game build, and headless shots on the castle-gate save. The log at 32:9 shows 5120 shadow texels (pool 802 MB, 192 MB for the sun's shadows) and cascades ending at 12 m and 45 m; at 16:9, 4096 texels. No visible seam in either shot (the 32:9 shot is a 1280x720 capture, so it can't judge the fine sharpness). ## Summary On monitors wider than 16:9, the game fits each sun shadow cascade around its slice of the wider horizontal view while keeping the same 3072x3072 shadow map. That spreads the same texels over a much wider area (worst at 32:9), making shadows coarse, shimmery, and flickering as the camera or sun moves, and making the cascade 0 to cascade 1 seam very noticeable on objects like the Castle Town drawbridge chains and archway. To reproduce on `main`: launch at 32:9 (5120x1440) with Shadow resolution on Highest or Auto (12 GB+ GPU), go to Hyrule Field near the drawbridge and trees, and watch the shadow edges shimmer and soften across the near cascade seam. What this changes: - **Shadow map resolution (`Highest` and `Auto` on 12 GB+ GPUs):** sets 16:9 and narrower to `4096`, and scales smoothly upward with wider aspect ratios using `4096 * (aspect / (16/9))^0.3219` (rounded to a multiple of 8, capped at `5120`: about `4512` at 21:9, `5120` at 32:9). The render target pool reserves the extra room at boot as long as the total stays within 900 MB; otherwise Highest falls back to `3072`. An explicit `HOS_RT_POOL_MB` is used as-is and disables automatic shadow-map scaling. `High` (8 GB cards at `2200`) and `Game's` presets are unchanged. `HOS_SHADOW_RES=0` restores the menu's sizes, including `3072` on Highest; `HOS_SHADOW_RES=<texels>` (64 to 8192, rounded up to a multiple of 8) forces a size. A forced size bypasses the automatic 900 MB limit; with `HOS_RT_POOL_MB` set, the pool is used as-is. - **Cascade splits:** moves cascade 1 end to `45 m` across all aspect ratios, and cascade 0 end to `15 m` at 16:9 and narrower, `12 m` at 32:9 and wider, sliding linearly in between (`13.97 m` at 3440x1440). `HOS_SHADOW_SPLITS=0` (or `off` / `0,0`) restores the game's splits; `HOS_SHADOW_SPLITS=<c0>,<c1>` overrides them. If the requested splits would leave a slice empty or out of order, the game's splits are kept there. - **Cascade depth bias:** for each sun shadow map larger than `4096`, adds `3,4` to the cascade depth bias to suppress shadow acne on the higher-resolution maps. Maps at `4096` or smaller get no automatic addition. `RX_VK_CASCADE_BIAS` (including `0,0`) overrides the automatic addition. Result: shadows on 32:9 and 16:9 are sharper and mostly stop flickering in Hyrule Field, including across the drawbridge chains, archway, trees, and Link up close. Files to read first: `game/mods/shadows/src/wide.rs`, `game/mods/shadows/src/splits.rs`, `host/shadow_res.h`, `host/nn_applet.c`, `gpu/vk/vk_draw.cpp`. Fixes #2274 ## Testing **Tested:** Windows 11 Pro, NVIDIA GeForce RTX 3090 (24 GB), driver 621.01, DLAA, Shadow resolution on Highest. I walked Hyrule Field near the Castle Town drawbridge, the gate and the river wall at both 32:9 (5120x1440) and 16:9 (2560x1440), once on main (Nightly 805, `6b928cb4`) and once on this PR (`1a8cbac2`), with the stat screen open in every picture. The pictures are below the list. - At 16:9 the PR build looks great to me and really helps with the shadows there. - 32:9 booted with `5120` sun shadows (`+192 MB` render target pool, 802 MB total), `12.00 m / 45.00 m` cascade splits, and `3,4` cascade bias. The nearest shadows are sharper and steadier around Link and the drawbridge. I have not looked closely at the farther shadow slices yet. - 16:9 booted with `4096` sun shadows (`+84 MB` render target pool, 596 MB total), `15.00 m / 45.00 m` cascade splits, and `0,0` cascade bias. - Checks: `mise run lint` passes (only the pre-existing shellcheck note on `build-windows.yml`). Affected tests (`test_oot_shadow`, `test_oot_shadow_splits`, `test_oot_shadow_fit`, `test_output_resolution`, `test_rt_pool_minimum`, `test_switch_table`, `test_settings_table`, `test_menu_ini_keys`) all pass on this branch, and all 5 shadow/pool tests fail when copied onto clean `origin/main` (`90fae88c`). On `mise run test`, the 28 remaining failures are identical on clean `origin/main`. **32:9 (5120x1440), main first, this PR second** Castle wall by the river ![main @ 6b928cb4, 32:9, castle wall by the river](https://git.magicbean.dev/attachments/7683e906-589e-4fab-a741-7c7b17da812a) ![this PR @ 1a8cbac2, 32:9, castle wall by the river](https://git.magicbean.dev/attachments/1cf7bf41-7966-4c71-875f-3e1a253c3e47) Castle in the field ![main @ 6b928cb4, 32:9, castle in the field](https://git.magicbean.dev/attachments/94240c2e-c9ce-4460-a143-829e69a8028c) ![this PR @ 1a8cbac2, 32:9, castle in the field](https://git.magicbean.dev/attachments/cf4b7367-1a59-405c-8655-76881b1bd1b0) Drawbridge chains ![main @ 6b928cb4, 32:9, drawbridge chains](https://git.magicbean.dev/attachments/4b0fec73-3495-40be-aae9-255740527518) ![this PR @ 1a8cbac2, 32:9, drawbridge chains](https://git.magicbean.dev/attachments/b9d266fe-fdbe-49bc-aa07-92a938bdce52) **16:9 (2560x1440), main first, this PR second** Castle gate ![main @ 6b928cb4, 16:9, castle gate](https://git.magicbean.dev/attachments/ac42ddd5-d61e-4209-93ac-a0e332f5859f) ![this PR @ 1a8cbac2, 16:9, castle gate](https://git.magicbean.dev/attachments/34dfe66f-b48e-4231-a2a1-268318c3d49f) Castle wall by the river ![main @ 6b928cb4, 16:9, castle wall by the river](https://git.magicbean.dev/attachments/5584b812-a4d9-443b-b182-5f885d5a7b55) ![this PR @ 1a8cbac2, 16:9, castle wall by the river](https://git.magicbean.dev/attachments/6087a452-8600-4d75-babe-8db582dcf9ad) **Still to test:** - 21:9 (3440x1440) on Highest/Auto (12 GB+ GPU): boot into Hyrule Field, expecting a `4512` shadow map (`+125 MB` pool), `13.97 m / 45.00 m` splits, and the automatic `3,4` bias (`@Beanstalk` or by hand). - 8 GB GPU at 32:9 on Auto/High: boot into Hyrule Field, expecting the `2200` shadow map unchanged and no VRAM out-of-memory (`@Beanstalk` or by hand). - AMD and Intel GPUs at 32:9: check that the automatic `3,4` cascade bias does not cause peter-panning or shadow acne (`@Beanstalk` or by hand). - Linux: build the host code on Linux, expecting a clean build (by hand, only the Windows llvm-mingw build was run locally). ## Measurements **Verdict:** In these spot checks the PR build runs about the same as main: frame time within 1 ms and GPU time within 0.5 ms at the same spots, with the render target pool growing by 192 MB at 32:9 and 84 MB at 16:9. Each spot is one reading, not an interleaved median, so please treat the table as a sanity check and not a full benchmark. Setup: Windows 11 Pro, RTX 3090 (24 GB), driver 621.01, Ryzen 9 5900X, DLAA, V-Sync off, Shadow resolution on Highest, Hyrule Field near Castle Town. FPS, frame time and GPU time are read from the stat screen open in each picture; the pool sizes come from the run logs. main is Nightly 805 (`6b928cb4`), which had `RX_VK_CASCADE_BIAS=0,2` and `HOS_SHADOW_STABLE=1` set; the PR run had no switches set. The PR was measured on `1a8cbac2`, the head before BeanBot's rebase (it is now `a3489f89`), and I have not re-measured on the new head. | | Before: main @ 6b928cb4 | After: this PR @ 1a8cbac2 | |---|---|---| | 32:9 castle wall by the river | 63 fps, 16.4 ms, GPU 12.1 ms | 62 fps, 16.4 ms, GPU 12.2 ms | | 32:9 castle in the field | 67 fps, 15.0 ms, GPU 11.0 ms | 64 fps, 15.3 ms, GPU 11.5 ms | | 32:9 drawbridge chains | 69 fps, 14.5 ms, GPU 10.9 ms | 74 fps, 13.6 ms, GPU 10.6 ms | | 16:9 castle gate | 84 fps, 12.2 ms, GPU 7.5 ms | 84 fps, 12.0 ms, GPU 7.7 ms | | 16:9 castle wall by the river | 78 fps, 13.3 ms, GPU 8.0 ms | 82 fps, 12.5 ms, GPU 8.3 ms | | 32:9 render target pool | 610 MB | 802 MB (+192 MB) | | 16:9 render target pool | 512 MB | 596 MB (+84 MB) | ## Risks - Larger shadow maps use more render-target pool memory (+84 MB at 16:9, +125 MB at 21:9, +192 MB at 32:9) and add some shadow-pass GPU cost. The 900 MB limit prevents automatic scaling on setups that would run tight (such as 5K 16:9 or 4K-class 21:9), and 8 GB GPUs (`High` / `2200`) are untouched by default. Forced shadow sizes bypass that limit, and an explicit pool size is used as-is. - Kill switches: `HOS_SHADOW_RES=0` restores `3072`, `HOS_SHADOW_SPLITS=0` restores the game's splits, and `RX_VK_CASCADE_BIAS=0,0` disables the automatic bias. A plain revert also backs everything out cleanly. - Player impact after updating: saves and `longshot_options.ini` are untouched. ## 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. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [ ] Measured against `main`, or Measurements says why there is nothing to measure. *(One reading per spot so far; interleaved runs on the new head are still to do.)* - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [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 verified; Linux still to do.)* - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen. - [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.
fix(oot): keep sun shadows sharp on ultrawide and move the cascade splits
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
Website / Website on Cloudflare (pull_request_target) Has been skipped
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
9a599a98d0
The game fits each sun cascade around its slice of the view, and its view is wider at
the sides on a picture wider than 16:9: the nearest cascade covers more ground with the
same texels, and the shadows came out coarse and flickering, worst at 32:9 (#2274).

- Highest (and Auto on 12 GB or more) is 4096 at 16:9 and narrower, and grows with a
  wider picture: 4096 x (shape / 16:9)^0.3219, at most 5120 (4512 at 21:9, 5120 at
  32:9). The render target pool gets room for it at boot while it stays within 900 MB.
  Game's and High are unchanged. HOS_SHADOW_RES=0 keeps 3072; =<texels> forces.
- The sun's cascade splits: cascade 1 ends at 45 m, cascade 0 at 15 m at 16:9 and
  12 m at 32:9, linear in the shape between (the game's 10.8 m and 33.3 m in Hyrule
  Field). HOS_SHADOW_SPLITS=0 keeps the game's; =<c0>,<c1> moves them.
- Once a sun map past 4096 is drawn (a wider picture), the cascade depth bias defaults
  to 3,4; 16:9 keeps none. RX_VK_CASCADE_BIAS, 0,0 included, still replaces it.

Fixes #2274

Assisted-by: Grok Bot
Author
First-time contributor

Tested in game: Windows 11 Pro, RTX 3090 (24 GB), driver 621.01, DLAA, Highest shadows. Tested in Hyrule Field (trees, drawbridge chains/archway, Link up close) at 32:9 (5120x1440: 5120 shadows, +192 MB pool, 12m/45m splits, 3,4 bias) and 16:9 (2560x1440: 4096 shadows, +84 MB pool, 15m/45m splits, 0,0 bias). Shadows are sharper and mostly stop flickering.

Tested in game: Windows 11 Pro, RTX 3090 (24 GB), driver 621.01, DLAA, Highest shadows. Tested in Hyrule Field (trees, drawbridge chains/archway, Link up close) at 32:9 (5120x1440: 5120 shadows, +192 MB pool, 12m/45m splits, 3,4 bias) and 16:9 (2560x1440: 4096 shadows, +84 MB pool, 15m/45m splits, 0,0 bias). Shadows are sharper and mostly stop flickering.
Member

Possibly related, for context:

  • PR #836 fix(oot): on Shadow resolution Highest, the sun's nearest shadow cascade no longer moves with the camera, so thin shadows near Link shimmer less — Merged prior cascade-fit stability changes; review interaction with the existing steady-fit behavior.
  • PR #1367 perf(vk): the static shadow map made smaller on cards with little VRAM (RX_VK_SHADOW_MAP_SIZE) — Open shadow-map VRAM work; may interact with increased render-target memory use.
Possibly related, for context: - PR #836 fix(oot): on Shadow resolution Highest, the sun's nearest shadow cascade no longer moves with the camera, so thin shadows near Link shimmer less — Merged prior cascade-fit stability changes; review interaction with the existing steady-fit behavior. - PR #1367 perf(vk): the static shadow map made smaller on cards with little VRAM (RX_VK_SHADOW_MAP_SIZE) — Open shadow-map VRAM work; may interact with increased render-target memory use.
Member
@review
BeanBot requested changes 2026-11-24 03:52:19 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The automatic bias remains active after lowering shadow quality, and an explicit pool size can receive larger shadows without space being added for them. The visual improvement is reported on one GPU, but the performance cost and behavior across supported hardware remain unmeasured.

The change enlarges Highest sun shadow maps, moves cascade splits and adds depth bias for large maps. The reported Hyrule Field result is sharper, more stable shadows, at the cost of additional pool memory and unquantified GPU time.

Blocking (2): must change before merging.

  1. L1 gpu/vk/vk_draw.cpp:6147: The automatic bias is latched for the rest of the process after any qualifying large depth target is drawn. (more on the line) Do: Choose the automatic bias from the current sun shadow map and its current size, and clear it when the map or preset changes.
  2. L2 host/nn_applet.c:218: An explicit pool override suppresses the extra allocation but still grants the larger automatic shadow size. (more on the line) Do: Do not grant the automatic enlargement when an explicit pool has not reserved space for it, or account for the extra space while preserving the documented override semantics.

Should fix (2): not blocking, but worth doing before merging.

  • L3 tests/test_oot_shadow_splits.py:18: The new test hard-codes gcc for the test runner instead of using its configured C compiler. (more on the line) Do: Pass the runner's C compiler placeholder and honor CC in standalone invocation.
  • L4 tests/test_output_resolution.py:82: The new pool assertions inherit HOS_SHADOW_RES from the developer's environment but assume any set value adds no pool space. (more on the line) Do: Remove HOS_SHADOW_RES from the fixture environment or explicitly exercise and calculate its override cases.

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

  • L5 host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. (more on the line) Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets. (@fix does its part first: Reserve the extra pool space only when the selected preset can use the enlarged map, while accounting for later preset changes.)
  • L6 gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. (more on the line) Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.

@fix can do L1, L2, L3, L4 and L5.

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

  • Can the shadow-resolution hook run concurrently on multiple game workers? Its first-use read flag and cached value are plain statics, so concurrent entry would require synchronization.
  • Can a newly loaded area's original split equal a value written for the previous area? The global split cache would then treat it as its own previous write and retain the previous area's original value.

Checks: Still running: 10 checks.

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

Does it help: Unproven against the requested baseline: the author reports visibly sharper, mostly stable shadows on an RTX 3090 at 16:9 and 32:9, but the before screenshots are listed as pending and the matching base timing measurements are TBD. The reported pool increases are 84 MiB at 16:9 and 192 MiB at 32:9.

Other systems: The split change affects every shadow preset, including Game's and High. The pool grows even when those presets use no larger map, including on Steam Deck and lower-memory GPUs. The bias affects matching depth-only targets after a large target is drawn. AMD, Intel, Linux, Steam Deck, other scenes and lower presets have no reported runs.

Switches: HOS_SHADOW_RES is added, defaulting to 4096–5120 on Highest when granted; HOS_SHADOW_SPLITS is added, defaulting to aspect-dependent 12–15 m and 45 m; RX_VK_CASCADE_BIAS changes from 0,0 to 3,4 after a qualifying large map. Their defaults need the missing hardware and performance evidence. All have switch-table entries, though the existing HOS_SHADOW_STABLE entry still describes Highest as 3072.

Reviewed: 9a599a98d0 against 90fae88c13: Read the repository instructions, contribution rules, standards and PR template; the diff and commit; shadow resolution, split, pool and patch code; and the changed shadow and pool test paths. Skimmed the larger output-resolution fixture and documentation. The requested docs/review-checklist.md and neighboring Tooling checkout are absent. The full renderer and every changed test were not read in full; no generated files or recorded runs were supplied in the diff.; nothing run (a code review).

Checked and fine:

  • The commit has an Assisted-by trailer.
  • No game-derived output or generated shader files are added in the diff.
  • The new switches have switch-table rows, and the renderer API is unchanged.
  • The split fixture covers defaults, overrides, invalid inputs and a separate view.

Testing: No commands that build, run tests or execute project code were run, as requested. The author reports Windows game testing and passing affected checks; CI remains in progress.

Overlaps and merge order: Not checked; the network is closed.


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

**Recommendation: Request changes.** The automatic bias remains active after lowering shadow quality, and an explicit pool size can receive larger shadows without space being added for them. The visual improvement is reported on one GPU, but the performance cost and behavior across supported hardware remain unmeasured. The change enlarges Highest sun shadow maps, moves cascade splits and adds depth bias for large maps. The reported Hyrule Field result is sharper, more stable shadows, at the cost of additional pool memory and unquantified GPU time. **Blocking (2)**: must change before merging. 1. **L1** `gpu/vk/vk_draw.cpp:6147`: The automatic bias is latched for the rest of the process after any qualifying large depth target is drawn. (more on the line) **Do:** Choose the automatic bias from the current sun shadow map and its current size, and clear it when the map or preset changes. 2. **L2** `host/nn_applet.c:218`: An explicit pool override suppresses the extra allocation but still grants the larger automatic shadow size. (more on the line) **Do:** Do not grant the automatic enlargement when an explicit pool has not reserved space for it, or account for the extra space while preserving the documented override semantics. **Should fix (2)**: not blocking, but worth doing before merging. - **L3** `tests/test_oot_shadow_splits.py:18`: The new test hard-codes gcc for the test runner instead of using its configured C compiler. (more on the line) **Do:** Pass the runner's C compiler placeholder and honor CC in standalone invocation. - **L4** `tests/test_output_resolution.py:82`: The new pool assertions inherit HOS_SHADOW_RES from the developer's environment but assume any set value adds no pool space. (more on the line) **Do:** Remove HOS_SHADOW_RES from the fixture environment or explicitly exercise and calculate its override cases. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L5** `host/nn_applet.c:218`: The pool grows on every preset, including cards that never select Highest automatically. (more on the line) **Do:** Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets. *(`@fix` does its part first: Reserve the extra pool space only when the selected preset can use the enlarged map, while accounting for later preset changes.)* - **L6** `gpu/vk/vk_draw.cpp:6145`: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. (more on the line) **Do:** Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems. `@fix` can do L1, L2, L3, L4 and L5. **Questions (2)** (not confirmed from the code; they don't hold the recommendation) - Can the shadow-resolution hook run concurrently on multiple game workers? Its first-use read flag and cached value are plain statics, so concurrent entry would require synchronization. - Can a newly loaded area's original split equal a value written for the previous area? The global split cache would then treat it as its own previous write and retain the previous area's original value. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven against the requested baseline: the author reports visibly sharper, mostly stable shadows on an RTX 3090 at 16:9 and 32:9, but the before screenshots are listed as pending and the matching base timing measurements are TBD. The reported pool increases are 84 MiB at 16:9 and 192 MiB at 32:9. **Other systems:** The split change affects every shadow preset, including Game's and High. The pool grows even when those presets use no larger map, including on Steam Deck and lower-memory GPUs. The bias affects matching depth-only targets after a large target is drawn. AMD, Intel, Linux, Steam Deck, other scenes and lower presets have no reported runs. **Switches:** HOS_SHADOW_RES is added, defaulting to 4096–5120 on Highest when granted; HOS_SHADOW_SPLITS is added, defaulting to aspect-dependent 12–15 m and 45 m; RX_VK_CASCADE_BIAS changes from 0,0 to 3,4 after a qualifying large map. Their defaults need the missing hardware and performance evidence. All have switch-table entries, though the existing HOS_SHADOW_STABLE entry still describes Highest as 3072. **Reviewed:** 9a599a98d0e2 against 90fae88c1396: Read the repository instructions, contribution rules, standards and PR template; the diff and commit; shadow resolution, split, pool and patch code; and the changed shadow and pool test paths. Skimmed the larger output-resolution fixture and documentation. The requested docs/review-checklist.md and neighboring Tooling checkout are absent. The full renderer and every changed test were not read in full; no generated files or recorded runs were supplied in the diff.; nothing run (a code review). **Checked and fine:** - The commit has an Assisted-by trailer. - No game-derived output or generated shader files are added in the diff. - The new switches have switch-table rows, and the renderer API is unchanged. - The split fixture covers defaults, overrides, invalid inputs and a separate view. **Testing:** No commands that build, run tests or execute project code were run, as requested. The author reports Windows game testing and passing affected checks; CI remains in progress. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -6138,2 +6142,4 @@
}();
(void)parsed;
static std::atomic<bool> wide_sun{false};
if (!cascade_set && at.width > 4096 && !wide_sun.load(std::memory_order_relaxed) && !wide_sun.exchange(true))
Member

L6 (should fix): The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs.

When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere.

Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.

**L6** (should fix): The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. *When:* The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. **Do:** Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.
@ -6140,0 +6144,4 @@
static std::atomic<bool> wide_sun{false};
if (!cascade_set && at.width > 4096 && !wide_sun.load(std::memory_order_relaxed) && !wide_sun.exchange(true))
logf("vk: cascade bias 3,4: a sun shadow map %u texels a side, past 4096 (RX_VK_CASCADE_BIAS)", at.width);
const bool wide_bias = !cascade_set && wide_sun.load(std::memory_order_relaxed);
Member

L1 (blocking): The automatic bias is latched for the rest of the process after any qualifying large depth target is drawn.

When: At 32:9, start on Highest and then change Shadow resolution to High or Game's, which applies immediately. The smaller cascades still receive 3,4 even though the automatic bias is intended for maps larger than 4096, changing their shadows until restart.

Do: Choose the automatic bias from the current sun shadow map and its current size, and clear it when the map or preset changes.

**L1** (blocking): The automatic bias is latched for the rest of the process after any qualifying large depth target is drawn. *When:* At 32:9, start on Highest and then change Shadow resolution to High or Game's, which applies immediately. The smaller cascades still receive 3,4 even though the automatic bias is intended for maps larger than 4096, changing their shadows until restart. **Do:** Choose the automatic bias from the current sun shadow map and its current size, and clear it when the map or preset changes.
host/nn_applet.c Outdated
@ -210,0 +215,4 @@
explicit HOS_RT_POOL_MB is taken as it is, and the wide size only while the pool stays within the 900 MB most */
const int forced = hos_shadow_res_switch(getenv("HOS_SHADOW_RES"), NULL);
uint32_t sun = forced > 0 ? (uint32_t)forced : forced < 0 ? 0 : hos_shadow_res_wide((uint32_t)wide, (uint32_t)(wide >> 32));
uint64_t extra = e || !sun ? 0 : hos_shadow_res_extra(sun);
Member

L2 (blocking): An explicit pool override suppresses the extra allocation but still grants the larger automatic shadow size.

When: With HOS_RT_POOL_MB=512 at 16:9 and Highest, the pool remains 512 MiB while the hook changes 3072 shadows to 4096, consuming approximately 84 MiB more of that same pool. A previously sufficient override can therefore exhaust the render-target pool.

Do: Do not grant the automatic enlargement when an explicit pool has not reserved space for it, or account for the extra space while preserving the documented override semantics.

**L2** (blocking): An explicit pool override suppresses the extra allocation but still grants the larger automatic shadow size. *When:* With HOS_RT_POOL_MB=512 at 16:9 and Highest, the pool remains 512 MiB while the hook changes 3072 shadows to 4096, consuming approximately 84 MiB more of that same pool. A previously sufficient override can therefore exhaust the render-target pool. **Do:** Do not grant the automatic enlargement when an explicit pool has not reserved space for it, or account for the extra space while preserving the documented override semantics.
Member

L5 (should fix): The pool grows on every preset, including cards that never select Highest automatically.

When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured.

Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.

**L5** (should fix): The pool grows on every preset, including cards that never select Highest automatically. *When:* A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. **Do:** Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.
@ -0,0 +15,4 @@
import sys
import tempfile
RUN_ALL_ARGS = ["--cc", "gcc"]
Member

L3 (should fix): The new test hard-codes gcc for the test runner instead of using its configured C compiler.

When: On a supported Windows or Linux setup with Clang selected through CC and no gcc executable, the runner skips or fails this check instead of testing the split change.

Do: Pass the runner's C compiler placeholder and honor CC in standalone invocation.

**L3** (should fix): The new test hard-codes gcc for the test runner instead of using its configured C compiler. *When:* On a supported Windows or Linux setup with Clang selected through CC and no gcc executable, the runner skips or fails this check instead of testing the split change. **Do:** Pass the runner's C compiler placeholder and honor CC in standalone invocation.
@ -79,1 +80,3 @@
assert(hos_rt_pool_size(305ull << 20) == ((uint64_t)pool << 20)); // (512 MB at least, 900 MB at most above 4K: nn_applet.c)
// (512 MB at least, 900 MB at most above 4K: nn_applet.c; and room for Highest's 4096 sun shadows, 84 MB, within 900 MB:
// issue 2274, host/shadow_res.h)
const bool sixteen = !getenv("HOS_SHADOW_RES") && !getenv("HOS_RT_POOL_MB") && pool + 84 <= 900;
Member

L4 (should fix): The new pool assertions inherit HOS_SHADOW_RES from the developer's environment but assume any set value adds no pool space.

When: With HOS_SHADOW_RES=4096 in the environment, the production function adds 84 MiB, while sixteen is false and the assertion expects the unexpanded pool, so the unrelated output-resolution check fails.

Do: Remove HOS_SHADOW_RES from the fixture environment or explicitly exercise and calculate its override cases.

**L4** (should fix): The new pool assertions inherit HOS_SHADOW_RES from the developer's environment but assume any set value adds no pool space. *When:* With HOS_SHADOW_RES=4096 in the environment, the production function adds 84 MiB, while sixteen is false and the assertion expects the unexpanded pool, so the unrelated output-resolution check fails. **Do:** Remove HOS_SHADOW_RES from the fixture environment or explicitly exercise and calculate its override cases.
Author
First-time contributor

Change requests noted, fixes are already mostly built locally, out of tokens, will wrap up Wednesday if nobody picks it up.

Change requests noted, fixes are already mostly built locally, out of tokens, will wrap up Wednesday if nobody picks it up.
Member
@fix
Member

I didn't fix this pull request: the change I made would remove a switch this pull request adds (gpu/vk/switches.def), which undoes it. So L1, L2, L3 and L4 are the author's now. Nothing was pushed.


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

I didn't fix this pull request: the change I made would remove a switch this pull request adds (`gpu/vk/switches.def`), which undoes it. So L1, L2, L3 and L4 are the author's now. Nothing was pushed. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
HumanBean added this to the WIP project 2026-11-24 17:22:26 +00:00
Owner
@fix
BeanBot force-pushed fix/2274-ultrawide-shadows from 9a599a98d0
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
Website / Website on Cloudflare (pull_request_target) Has been skipped
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 1a8cbac234
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
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
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
CI / Workflow lint (actionlint) (pull_request) Successful in 21s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 21s
Third-party parts / As their notes say (pull_request) Successful in 22s
Website / Website builds (pull_request) Successful in 1m33s
CI / Website build and checks (pull_request) Successful in 1m51s
PR description / Description follows the template (pull_request_target) Failing after 21s
2026-11-24 17:40:38 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The reported visual improvement is promising, but matching baseline timings and cross-vendor visual results are still missing. The extra pool reservation also remains on presets that cannot use the enlarged map. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 1a8cbac234. I rebased it onto main (6123c76adc). I edited its description to match the change.

Changed

  • Cascade bias at gpu/vk/vk_draw.cpp:6133: Selects automatic bias from each current target's size and updates the switch description and source check.
  • Pool override at host/nn_applet.c:219: With an explicit pool override, automatic enlargement is no longer granted; an explicit shadow-size override remains effective. Updated pool cases.
  • Configured compiler at tests/test_oot_shadow_splits.py:18: Uses the runner's compiler placeholder and honors CC for standalone invocation.
  • Fixture environment at tests/test_output_resolution.py:392: Removes HOS_SHADOW_RES from the fixture environment. Tests were not run, as requested.

Not done

  • Preset-aware pool reservation at host/nn_applet.c:214: The fixed graphics heap and pool are allocated at startup. Avoiding the reservation on lower presets while supporting an immediate later switch to Highest needs a safe way to grow or replace those allocations; that implementation remains open. The author still needs to measure the resulting memory use.

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

The change increases sun-shadow resolution and adjusts cascade splits and bias to reduce ultrawide shimmer. It adds render-target memory and shadow-pass work, with the performance cost still unmeasured against the base.

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

  • L5 host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.
  • L6 gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.

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

Also noticed (3; not asked for, not blocking)
  • The pull request description's listed screenshots are placeholders rather than attached before-and-after evidence.
  • The Linux host build remains unverified.
  • The supplied base-to-head diff includes changes from other commits as well as the shadow change.
More: does it help, other systems, switches, what was read

Does it help: Unproven: the author reports sharper, more stable shadows on an RTX 3090 at 16:9 and 32:9, but the matching base FPS and GPU-time results are TBD. The reported pool increases are 84 MB and 192 MB respectively.

Other systems: The rendering changes can affect other GPUs, drivers and Linux; AMD and Intel visual runs and a Linux build remain unreported. Lower shadow presets still reserve the enlarged pool by default.

Switches: HOS_SHADOW_RES defaults to automatic scaling, with 0 restoring menu sizes and 64–8192 forcing a size. HOS_SHADOW_SPLITS defaults to the new aspect-dependent splits, with 0 restoring game splits or a pair overriding them. RX_VK_CASCADE_BIAS defaults to 3,4 above 4096 texels and 0,0 otherwise; an explicit value overrides it. The defaults still need the outstanding visual and timing evidence.

Reviewed: 1a8cbac234 against 6123c76adc: Read AGENTS.md and CONTRIBUTING.md, the fix diff, the pool and cascade-bias code around the changed lines, and the shadow sizing code. The base diff output was truncated and the full changed code and repository rules referenced by it were not all read; no complete code review is claimed.; nothing run (a code review).

Checked and fine:

  • Automatic cascade bias is selected from the current target size, and an explicit RX_VK_CASCADE_BIAS takes precedence.
  • An explicit HOS_RT_POOL_MB disables the automatic shadow-size grant while retaining a forced shadow-size override.

Testing: No commands that build or run tests were executed. The author reports Windows RTX 3090 gameplay checks; CI has not run on this head.

Overlaps and merge order: Not checked; network access is unavailable.


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

**Recommendation: Approve.** The code is ready: only testing is left. The reported visual improvement is promising, but matching baseline timings and cross-vendor visual results are still missing. The extra pool reservation also remains on presets that cannot use the enlarged map. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 1a8cbac234cd. I rebased it onto `main` (6123c76adc00). I edited its description to match the change. **Changed** - **Cascade bias at gpu/vk/vk_draw.cpp:6133**: Selects automatic bias from each current target's size and updates the switch description and source check. - **Pool override at host/nn_applet.c:219**: With an explicit pool override, automatic enlargement is no longer granted; an explicit shadow-size override remains effective. Updated pool cases. - **Configured compiler at tests/test_oot_shadow_splits.py:18**: Uses the runner's compiler placeholder and honors CC for standalone invocation. - **Fixture environment at tests/test_output_resolution.py:392**: Removes HOS_SHADOW_RES from the fixture environment. Tests were not run, as requested. **Not done** - **Preset-aware pool reservation at host/nn_applet.c:214**: The fixed graphics heap and pool are allocated at startup. Avoiding the reservation on lower presets while supporting an immediate later switch to Highest needs a safe way to grow or replace those allocations; that implementation remains open. The author still needs to measure the resulting memory use. Nothing was built or run: the checks run again on the new head. The change increases sun-shadow resolution and adjusts cascade splits and bias to reduce ultrawide shimmer. It adds render-target memory and shadow-pass work, with the performance cost still unmeasured against the base. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L5** `host/nn_applet.c:218`: The pool grows on every preset, including cards that never select Highest automatically. *When:* A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. **Do:** Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets. - **L6** `gpu/vk/vk_draw.cpp:6145`: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. *When:* The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. **Do:** Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems. **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> - The pull request description's listed screenshots are placeholders rather than attached before-and-after evidence. - The Linux host build remains unverified. - The supplied base-to-head diff includes changes from other commits as well as the shadow change. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: the author reports sharper, more stable shadows on an RTX 3090 at 16:9 and 32:9, but the matching base FPS and GPU-time results are TBD. The reported pool increases are 84 MB and 192 MB respectively. **Other systems:** The rendering changes can affect other GPUs, drivers and Linux; AMD and Intel visual runs and a Linux build remain unreported. Lower shadow presets still reserve the enlarged pool by default. **Switches:** HOS_SHADOW_RES defaults to automatic scaling, with 0 restoring menu sizes and 64–8192 forcing a size. HOS_SHADOW_SPLITS defaults to the new aspect-dependent splits, with 0 restoring game splits or a pair overriding them. RX_VK_CASCADE_BIAS defaults to 3,4 above 4096 texels and 0,0 otherwise; an explicit value overrides it. The defaults still need the outstanding visual and timing evidence. **Reviewed:** 1a8cbac234cd against 6123c76adc00: Read AGENTS.md and CONTRIBUTING.md, the fix diff, the pool and cascade-bias code around the changed lines, and the shadow sizing code. The base diff output was truncated and the full changed code and repository rules referenced by it were not all read; no complete code review is claimed.; nothing run (a code review). **Checked and fine:** - Automatic cascade bias is selected from the current target size, and an explicit RX_VK_CASCADE_BIAS takes precedence. - An explicit HOS_RT_POOL_MB disables the automatic shadow-size grant while retaining a forced shadow-size override. **Testing:** No commands that build or run tests were executed. The author reports Windows RTX 3090 gameplay checks; CI has not run on this head. **Overlaps and merge order:** Not checked; network access is unavailable. </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>
Author
First-time contributor

Edits have been pulled and tested locally, seems to function the same. Fix is still applied!

Edits have been pulled and tested locally, seems to function the same. Fix is still applied!
Wrath changed title from WIP: fix(oot): keep sun shadows sharp on ultrawide and move the cascade splits to fix(oot): keep sun shadows sharp on ultrawide and move the cascade splits 2026-11-25 19:19:16 +00:00
Member
@review
BeanBot left a comment

Recommendation: Request changes. It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (L7) The reported game run shows sharper, more stable shadows on an RTX 3090, but the cost against the base and the effect on other GPU vendors remain unmeasured. The pool also reserves extra space on presets that cannot use the larger map.

Raises Highest shadow-map resolution and moves cascade splits to reduce coarse, shimmering sun shadows, at the cost of additional render-target memory and unknown GPU time. It also adds automatic depth bias for maps larger than 4096.

Blocking (1): must change before merging.

  1. L7: 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)

  • L5 host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.
  • L6 gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.

Since the last review (on 1a8cbac234)
Still open: L5 (The pool grows on every preset, including cards that never select Highest automatically.); L6 (The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vend…)
New: L7 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)

Checks: Failing on this head, which is behind its base, where it passes: PR description / Description follows the template (pull_request_target). @rebase (or @fix) brings it up to date and runs it again; not held against it.

Also noticed (3; not asked for, not blocking)
  • The pull request description's listed screenshots are placeholders rather than attached before-and-after evidence.
  • The Linux host build remains unverified.
  • The supplied base-to-head diff includes changes from other commits as well as the shadow change.
More: does it help, other systems, switches, what was read

Does it help: Unproven across affected systems. The author reports visibly sharper, more stable shadows on Windows with an RTX 3090 at 32:9 and 16:9; the reported pool increases are 192 MB and 84 MB respectively. Matching base timing numbers and cross-vendor visual results are missing.

Other systems: The changes affect shadow rendering and pool memory on Windows and Linux, across GPU vendors and presets. AMD and Intel visual runs, Linux compilation, and an 8 GB Auto/High run remain unreported.

Switches: HOS_SHADOW_RES is added: by default Highest scales from 4096 to 5120 when pool space permits; 0 restores menu sizes and a numeric value forces a size. HOS_SHADOW_SPLITS is added: defaults to 15–12 m and 45 m; 0 restores the game's splits and a pair overrides them. RX_VK_CASCADE_BIAS now defaults to 3,4 for maps above 4096, otherwise 0,0; an explicit value overrides it. The defaults still need the ledger's measurements and visual runs.

Reviewed: 1a8cbac234 against 6123c76adc: Read repository rules, the PR template, standards, the diff and the ledger-relevant pool and shadow-resolution paths. Skimmed the remaining changed code, documentation and tests; did not read vk_draw.cpp or all changed test files in full. The requested review checklist and adjacent Tooling rules file were not present.; nothing run (a code review).

Checked and fine:

  • The author reports an in-game comparison on Windows with an RTX 3090 at 32:9 and 16:9.
  • The new and changed switches have entries in gpu/vk/switches.def.

Testing: No commands that build or run project code were executed. The author reports passing affected tests and lint, with remaining suite failures also present on main; the PR lists Linux, 21:9, 8 GB and AMD/Intel runs as outstanding.

Overlaps and merge order: Not checked; network unavailable.


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

**Recommendation: Request changes.** It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). (L7) The reported game run shows sharper, more stable shadows on an RTX 3090, but the cost against the base and the effect on other GPU vendors remain unmeasured. The pool also reserves extra space on presets that cannot use the larger map. Raises Highest shadow-map resolution and moves cascade splits to reduce coarse, shimmering sun shadows, at the cost of additional render-target memory and unknown GPU time. It also adds automatic depth bias for maps larger than 4096. **Blocking (1)**: must change before merging. 1. **L7**: 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) - **L5** `host/nn_applet.c:218`: The pool grows on every preset, including cards that never select Highest automatically. *When:* A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. **Do:** Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets. - **L6** `gpu/vk/vk_draw.cpp:6145`: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. *When:* The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. **Do:** Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems. **Since the last review** (on 1a8cbac234cd) Still open: L5 (The pool grows on every preset, including cards that never select Highest automatically.); L6 (The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vend…) New: L7 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) **Checks:** Failing on this head, which is behind its base, where it passes: `PR description / Description follows the template (pull_request_target)`. `@rebase` (or `@fix`) brings it up to date and runs it again; not held against it. <details> <summary>Also noticed (3; not asked for, not blocking)</summary> - The pull request description's listed screenshots are placeholders rather than attached before-and-after evidence. - The Linux host build remains unverified. - The supplied base-to-head diff includes changes from other commits as well as the shadow change. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven across affected systems. The author reports visibly sharper, more stable shadows on Windows with an RTX 3090 at 32:9 and 16:9; the reported pool increases are 192 MB and 84 MB respectively. Matching base timing numbers and cross-vendor visual results are missing. **Other systems:** The changes affect shadow rendering and pool memory on Windows and Linux, across GPU vendors and presets. AMD and Intel visual runs, Linux compilation, and an 8 GB Auto/High run remain unreported. **Switches:** HOS_SHADOW_RES is added: by default Highest scales from 4096 to 5120 when pool space permits; 0 restores menu sizes and a numeric value forces a size. HOS_SHADOW_SPLITS is added: defaults to 15–12 m and 45 m; 0 restores the game's splits and a pair overrides them. RX_VK_CASCADE_BIAS now defaults to 3,4 for maps above 4096, otherwise 0,0; an explicit value overrides it. The defaults still need the ledger's measurements and visual runs. **Reviewed:** 1a8cbac234cd against 6123c76adc00: Read repository rules, the PR template, standards, the diff and the ledger-relevant pool and shadow-resolution paths. Skimmed the remaining changed code, documentation and tests; did not read vk_draw.cpp or all changed test files in full. The requested review checklist and adjacent Tooling rules file were not present.; nothing run (a code review). **Checked and fine:** - The author reports an in-game comparison on Windows with an RTX 3090 at 32:9 and 16:9. - The new and changed switches have entries in gpu/vk/switches.def. **Testing:** No commands that build or run project code were executed. The author reports passing affected tests and lint, with remaining suite failures also present on main; the PR lists Linux, 21:9, 8 GB and AMD/Intel runs as outstanding. **Overlaps and merge order:** Not checked; network unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
Member
@fix
BeanBot force-pushed fix/2274-ultrawide-shadows from 1a8cbac234
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
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
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
CI / Workflow lint (actionlint) (pull_request) Successful in 21s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 21s
Third-party parts / As their notes say (pull_request) Successful in 22s
Website / Website builds (pull_request) Successful in 1m33s
CI / Website build and checks (pull_request) Successful in 1m51s
PR description / Description follows the template (pull_request_target) Failing after 21s
to a3489f8912
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 11s
CI / Conventional Commit title (pull_request) Successful in 16s
CI / What the change needs (pull_request) Successful in 16s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 24s
CI / Workflow lint (actionlint) (pull_request) Successful in 24s
Third-party parts / As their notes say (pull_request) Successful in 26s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 2m43s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Successful in 1m56s
CI / Website build and checks (pull_request) Successful in 3m1s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Successful in 5m55s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m26s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Successful in 3m55s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 1m3s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m18s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Successful in 14m37s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 18m30s
PR description / Title and description (pull_request_target) Failing after 9s
2026-11-25 19:47:18 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The reported visual improvement is encouraging, but the larger shadow maps reserve extra pool memory on lower presets and their timing cost and cross-vendor appearance remain unmeasured. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is a3489f8912. I rebased it onto main (68ab0bc7ba).

Conflicts resolved

  • docs/dev/reference/switches.md: Kept the new shadow switches and the base branch’s hook references.
  • game/oot_shadow.c: Kept the wider shadow resolution behavior with the base branch’s game-host interface.
  • game/oot_shadow_fit.c: Kept the cascade split changes with the base branch’s game-host interface.
  • nx2/oot_shadow_fit.py: Kept the base branch’s deletion; moved the split hook to the site registry.
  • game/oot_sites.c: Added the split hook callback at the new hook location.
  • game/sites.def: Registered the split hook.
  • game/sites/sites.toml: Added the split hook definition.
  • game/sites/e0f3ccfaf50065ae4ea01eb5aeb13b1a45da3348/locations.toml: Added the split hook location and instruction signature.
  • host/game_host.h: Exposed the shared shadow resolution helpers to game code.
  • tests/test_oot_shadow.py: Kept the new resolution cases using the base branch’s site hooks.
  • tests/test_oot_shadow_fit.py: Kept the base branch’s site tests and added the split site.
  • tests/test_oot_shadow_splits.py: Carried the split fixture to the new site hook mechanism. No builds or tests were run.
  • Also changed, beyond the conflict: game/oot_sites.c, game/sites.def, game/sites/e0f3ccfaf50065ae4ea01eb5aeb13b1a45da3348/locations.toml, game/sites/sites.toml, host/game_host.h, tests/test_oot_shadow_splits.py
  • tests/test_oot_shadow_splits.py: Kept Clang as the default compiler and retained the explicit --cc override.

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

The change increases sun-shadow resolution and moves cascade splits to reduce shimmer and visible seams, at the cost of additional render-target memory and potentially more GPU work.

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

  • L5 host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.
  • L6 gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.

Checks: they run again on this head (PR description / Description follows the template (pull_request_target) failed on the last one); a failure shows on the pull request.

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

Does it help: Unproven against the required comparison: the author reports sharper, more stable shadows on an RTX 3090 at 16:9 and 32:9, but the matching base timing results are still TBD. The reported pool increases are 84 MB and 192 MB respectively.

Other systems: The changes affect shadow rendering and render-target memory across GPUs and operating systems. AMD and Intel visual runs, an 8 GB Auto/High run, and a Linux build remain unreported.

Switches: HOS_SHADOW_RES defaults to automatic scaling on Highest; 0 restores menu sizes and a numeric value forces a size. HOS_SHADOW_SPLITS defaults to aspect-dependent splits; 0 restores the game's splits and a pair overrides them. RX_VK_CASCADE_BIAS defaults to 3,4 for maps above 4096 and otherwise 0,0; an explicit value overrides it. The defaults still need the measurements and cross-vendor runs in L6.

Reviewed: a3489f8912 against 68ab0bc7ba: Read the repository agent and contribution rules, pull request template, current shadow resolution and pool code, the rebased game shadow and hook-site diff, and the supplied review history and test reports. Skimmed the range-diff and test changes; did not read every changed file in full. The review checklist file was absent.; nothing run (a code review).

Checked and fine:

  • The rebased split hook is registered at the declared site and calls the split handler with the view.
  • An explicit render-target pool disables the automatic shadow-size grant.

Testing: No commands from the project or tests were run. The author reports Windows RTX 3090 gameplay and passing affected tests; 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.

**Recommendation: Approve.** The code is ready: only testing is left. The reported visual improvement is encouraging, but the larger shadow maps reserve extra pool memory on lower presets and their timing cost and cross-vendor appearance remain unmeasured. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is a3489f89124e. I rebased it onto `main` (68ab0bc7bac6). **Conflicts resolved** - docs/dev/reference/switches.md: Kept the new shadow switches and the base branch’s hook references. - game/oot_shadow.c: Kept the wider shadow resolution behavior with the base branch’s game-host interface. - game/oot_shadow_fit.c: Kept the cascade split changes with the base branch’s game-host interface. - nx2/oot_shadow_fit.py: Kept the base branch’s deletion; moved the split hook to the site registry. - game/oot_sites.c: Added the split hook callback at the new hook location. - game/sites.def: Registered the split hook. - game/sites/sites.toml: Added the split hook definition. - game/sites/e0f3ccfaf50065ae4ea01eb5aeb13b1a45da3348/locations.toml: Added the split hook location and instruction signature. - host/game_host.h: Exposed the shared shadow resolution helpers to game code. - tests/test_oot_shadow.py: Kept the new resolution cases using the base branch’s site hooks. - tests/test_oot_shadow_fit.py: Kept the base branch’s site tests and added the split site. - tests/test_oot_shadow_splits.py: Carried the split fixture to the new site hook mechanism. No builds or tests were run. - Also changed, beyond the conflict: `game/oot_sites.c`, `game/sites.def`, `game/sites/e0f3ccfaf50065ae4ea01eb5aeb13b1a45da3348/locations.toml`, `game/sites/sites.toml`, `host/game_host.h`, `tests/test_oot_shadow_splits.py` - tests/test_oot_shadow_splits.py: Kept Clang as the default compiler and retained the explicit --cc override. Nothing was built or run: the checks run again on the new head. The change increases sun-shadow resolution and moves cascade splits to reduce shimmer and visible seams, at the cost of additional render-target memory and potentially more GPU work. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L5** `host/nn_applet.c:218`: The pool grows on every preset, including cards that never select Highest automatically. *When:* A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. **Do:** Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets. - **L6** `gpu/vk/vk_draw.cpp:6145`: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. *When:* The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. **Do:** Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems. **Checks:** they run again on this head (`PR description / Description follows the template (pull_request_target)` failed on the last one); a failure shows on the pull request. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven against the required comparison: the author reports sharper, more stable shadows on an RTX 3090 at 16:9 and 32:9, but the matching base timing results are still TBD. The reported pool increases are 84 MB and 192 MB respectively. **Other systems:** The changes affect shadow rendering and render-target memory across GPUs and operating systems. AMD and Intel visual runs, an 8 GB Auto/High run, and a Linux build remain unreported. **Switches:** HOS_SHADOW_RES defaults to automatic scaling on Highest; 0 restores menu sizes and a numeric value forces a size. HOS_SHADOW_SPLITS defaults to aspect-dependent splits; 0 restores the game's splits and a pair overrides them. RX_VK_CASCADE_BIAS defaults to 3,4 for maps above 4096 and otherwise 0,0; an explicit value overrides it. The defaults still need the measurements and cross-vendor runs in L6. **Reviewed:** a3489f89124e against 68ab0bc7bac6: Read the repository agent and contribution rules, pull request template, current shadow resolution and pool code, the rebased game shadow and hook-site diff, and the supplied review history and test reports. Skimmed the range-diff and test changes; did not read every changed file in full. The review checklist file was absent.; nothing run (a code review). **Checked and fine:** - The rebased split hook is registered at the declared site and calls the split handler with the view. - An explicit render-target pool disables the automatic shadow-size grant. **Testing:** No commands from the project or tests were run. The author reports Windows RTX 3090 gameplay and passing affected tests; CI has not run on this head. **Overlaps and merge order:** Not checked; network access is closed. </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>
Owner

Can you check what BeanBot said?

Can you check what BeanBot said?
Author
First-time contributor

Before and after screenshots for the description (main @ 6b928cb4 and this PR @ 1a8cbac2), stat screen open in each.

32:9 (5120x1440)

Castle wall by the river
main @ 6b928cb4, 32:9, castle wall by the river
this PR @ 1a8cbac2, 32:9, castle wall by the river

Castle in the field
main @ 6b928cb4, 32:9, castle in the field
this PR @ 1a8cbac2, 32:9, castle in the field

Drawbridge chains
main @ 6b928cb4, 32:9, drawbridge chains
this PR @ 1a8cbac2, 32:9, drawbridge chains

16:9 (2560x1440)

Castle gate
main @ 6b928cb4, 16:9, castle gate
this PR @ 1a8cbac2, 16:9, castle gate

Castle wall by the river
main @ 6b928cb4, 16:9, castle wall by the river
this PR @ 1a8cbac2, 16:9, castle wall by the river

Before and after screenshots for the description (main @ 6b928cb4 and this PR @ 1a8cbac2), stat screen open in each. **32:9 (5120x1440)** Castle wall by the river ![main @ 6b928cb4, 32:9, castle wall by the river](https://git.magicbean.dev/attachments/7683e906-589e-4fab-a741-7c7b17da812a) ![this PR @ 1a8cbac2, 32:9, castle wall by the river](https://git.magicbean.dev/attachments/1cf7bf41-7966-4c71-875f-3e1a253c3e47) Castle in the field ![main @ 6b928cb4, 32:9, castle in the field](https://git.magicbean.dev/attachments/94240c2e-c9ce-4460-a143-829e69a8028c) ![this PR @ 1a8cbac2, 32:9, castle in the field](https://git.magicbean.dev/attachments/cf4b7367-1a59-405c-8655-76881b1bd1b0) Drawbridge chains ![main @ 6b928cb4, 32:9, drawbridge chains](https://git.magicbean.dev/attachments/4b0fec73-3495-40be-aae9-255740527518) ![this PR @ 1a8cbac2, 32:9, drawbridge chains](https://git.magicbean.dev/attachments/b9d266fe-fdbe-49bc-aa07-92a938bdce52) **16:9 (2560x1440)** Castle gate ![main @ 6b928cb4, 16:9, castle gate](https://git.magicbean.dev/attachments/ac42ddd5-d61e-4209-93ac-a0e332f5859f) ![this PR @ 1a8cbac2, 16:9, castle gate](https://git.magicbean.dev/attachments/34dfe66f-b48e-4231-a2a1-268318c3d49f) Castle wall by the river ![main @ 6b928cb4, 16:9, castle wall by the river](https://git.magicbean.dev/attachments/5584b812-a4d9-443b-b182-5f885d5a7b55) ![this PR @ 1a8cbac2, 16:9, castle wall by the river](https://git.magicbean.dev/attachments/6087a452-8600-4d75-babe-8db582dcf9ad)
HumanBean force-pushed fix/2274-ultrawide-shadows from a3489f8912
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 11s
CI / Conventional Commit title (pull_request) Successful in 16s
CI / What the change needs (pull_request) Successful in 16s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 24s
CI / Workflow lint (actionlint) (pull_request) Successful in 24s
Third-party parts / As their notes say (pull_request) Successful in 26s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 2m43s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Successful in 1m56s
CI / Website build and checks (pull_request) Successful in 3m1s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Successful in 5m55s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m26s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Successful in 3m55s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 1m3s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m18s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Successful in 14m37s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 18m30s
PR description / Title and description (pull_request_target) Failing after 9s
to 56517e3af8
Some checks failed
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 15s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 16s
Third-party parts / As their notes say (pull_request) Successful in 19s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 20s
CI / What the change needs (pull_request) Successful in 46s
CI / Website build and checks (pull_request) Failing after 2m15s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 6m24s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m43s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 7m34s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 5m1s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 8m26s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 55s
PR description / Title and description (pull_request_target) Has been cancelled
PR description / Description follows the template (pull_request_target) Failing after 5s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 10m7s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 13m46s
2026-11-26 19:57:19 +00:00
Compare
HumanBean changed target branch from main to mod-api 2026-11-26 20:06:51 +00:00
Owner

Rebased and ported onto mod-api; this PR now targets mod-api. Old head: a3489f89 (on main). New head: 56517e3a (your two commits kept, plus three port commits on top). What moved where is at the top of the description.

Rebased and ported onto mod-api; this PR now targets mod-api. Old head: a3489f89 (on main). New head: 56517e3a (your two commits kept, plus three port commits on top). What moved where is at the top of the description.
Owner
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The larger shadow maps and moved splits have shown a visual improvement on the author's RTX 3090, but matching timing and cross-vendor visual runs are still needed. The pool also reserves extra memory for presets that cannot use the larger maps. Recommend approval; not approved on the forge.

The change increases Highest sun-shadow resolution and moves cascade splits to make shadows sharper and steadier, especially on ultrawide displays. It costs additional render-target memory and may increase shadow-pass GPU work; the port moves the game-side logic into the Shadows system mod.

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

  • L5 host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.
  • L6 gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.

Since the last review (on a3489f8912)
Still open: L5 (The pool grows on every preset, including cards that never select Highest automatically.); L6 (The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vend…); L8 (The check PR description / Description follows the template (pull_request_target) fails…)

Checks: Failing on this head, which is behind its base, where they pass: Guide screenshots / Guide images and local UI source review (pull_request), CI / Lint (pre-commit, ShellCheck) (pull_request), CI / Website build and checks (pull_request), CI / Game-free checks (run_all.py, part 2/4) (pull_request), CI / Game-free checks (run_all.py, part 3/4) (pull_request), CI / Game-free checks (run_all.py, part 4/4) (pull_request), CI / Rust (rustfmt, clippy, cargo test) (pull_request), CI / Game-free checks (run_all.py, part 1/4) (pull_request), PR description / Description follows the template (pull_request_target). @rebase (or @fix) brings it up to date and runs them again; not held against it. Cancelled on this head (no result): PR description / Title and description (pull_request_target). Still running: CI / longshot-builder end to end (synthetic game) (pull_request), CI / Host C for Windows (llvm-mingw, compile only) (pull_request).

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

Does it help: Unproven on the current head: the author reports sharper, steadier shadows on Windows at 16:9 and 32:9 on an earlier head. Single readings show up to 0.5 ms more GPU time and pool increases of 84 MB and 192 MB respectively, but the before and after runs used different switches and were not interleaved.

Other systems: The change affects sun-shadow rendering across GPUs and operating systems, as well as render-target memory on lower presets. The current-head Linux RTX 3090 run reports the expected sizes and no visible seam; AMD and Intel visual results and matching performance runs remain outstanding.

Switches: HOS_SHADOW_RES defaults to automatic enlargement on Highest, with 0 restoring menu sizes and a numeric value forcing a size. HOS_SHADOW_SPLITS defaults to the new aspect-dependent splits, with 0 restoring the game's splits and a pair overriding them. RX_VK_CASCADE_BIAS defaults to an added 3,4 above 4096 texels unless explicitly set. The defaults still need the runs described in L6.

Reviewed: 56517e3af8 against 8efb4b3eb4: Read AGENTS.md, CONTRIBUTING.md and the pull request template; inspected the pool, shadow-resolution bridge, split logic, hook changes and renderer bias diff. The full changed files and remaining diff were not read in full; recorded screenshots and runs were considered from their descriptions.; nothing run (a code review).

Checked and fine:

  • The host pool and Shadows mod use the same resolution-switch parser and wide-size calculation.
  • An explicit pool size disables automatic enlargement, and a forced shadow size bypasses the automatic pool cap.

Testing: No commands that build or run project code were executed. The author reports a current-head Linux game build and headless shots; Windows gameplay and timing reports are from an earlier head. CI still has two checks running.

Overlaps and merge order: The PR targets mod-api and depends on that branch.


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

**Recommendation: Approve.** The code is ready: only testing is left. The larger shadow maps and moved splits have shown a visual improvement on the author's RTX 3090, but matching timing and cross-vendor visual runs are still needed. The pool also reserves extra memory for presets that cannot use the larger maps. Recommend approval; not approved on the forge. The change increases Highest sun-shadow resolution and moves cascade splits to make shadows sharper and steadier, especially on ultrawide displays. It costs additional render-target memory and may increase shadow-pass GPU work; the port moves the game-side logic into the Shadows system mod. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L5** `host/nn_applet.c:218`: The pool grows on every preset, including cards that never select Highest automatically. *When:* A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. **Do:** Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets. - **L6** `gpu/vk/vk_draw.cpp:6145`: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. *When:* The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. **Do:** Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems. **Since the last review** (on a3489f89124e) Still open: L5 (The pool grows on every preset, including cards that never select Highest automatically.); L6 (The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vend…); L8 (The check `PR description / Description follows the template (pull_request_target)` fails…) **Checks:** Failing on this head, which is behind its base, where they pass: `Guide screenshots / Guide images and local UI source review (pull_request)`, `CI / Lint (pre-commit, ShellCheck) (pull_request)`, `CI / Website build and checks (pull_request)`, `CI / Game-free checks (run_all.py, part 2/4) (pull_request)`, `CI / Game-free checks (run_all.py, part 3/4) (pull_request)`, `CI / Game-free checks (run_all.py, part 4/4) (pull_request)`, `CI / Rust (rustfmt, clippy, cargo test) (pull_request)`, `CI / Game-free checks (run_all.py, part 1/4) (pull_request)`, `PR description / Description follows the template (pull_request_target)`. `@rebase` (or `@fix`) brings it up to date and runs them again; not held against it. Cancelled on this head (no result): `PR description / Title and description (pull_request_target)`. Still running: `CI / longshot-builder end to end (synthetic game) (pull_request)`, `CI / Host C for Windows (llvm-mingw, compile only) (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current head: the author reports sharper, steadier shadows on Windows at 16:9 and 32:9 on an earlier head. Single readings show up to 0.5 ms more GPU time and pool increases of 84 MB and 192 MB respectively, but the before and after runs used different switches and were not interleaved. **Other systems:** The change affects sun-shadow rendering across GPUs and operating systems, as well as render-target memory on lower presets. The current-head Linux RTX 3090 run reports the expected sizes and no visible seam; AMD and Intel visual results and matching performance runs remain outstanding. **Switches:** HOS_SHADOW_RES defaults to automatic enlargement on Highest, with 0 restoring menu sizes and a numeric value forcing a size. HOS_SHADOW_SPLITS defaults to the new aspect-dependent splits, with 0 restoring the game's splits and a pair overriding them. RX_VK_CASCADE_BIAS defaults to an added 3,4 above 4096 texels unless explicitly set. The defaults still need the runs described in L6. **Reviewed:** 56517e3af8ef against 8efb4b3eb496: Read AGENTS.md, CONTRIBUTING.md and the pull request template; inspected the pool, shadow-resolution bridge, split logic, hook changes and renderer bias diff. The full changed files and remaining diff were not read in full; recorded screenshots and runs were considered from their descriptions.; nothing run (a code review). **Checked and fine:** - The host pool and Shadows mod use the same resolution-switch parser and wide-size calculation. - An explicit pool size disables automatic enlargement, and a forced shadow size bypasses the automatic pool cap. **Testing:** No commands that build or run project code were executed. The author reports a current-head Linux game build and headless shots; Windows gameplay and timing reports are from an earlier head. CI still has two checks running. **Overlaps and merge order:** The PR targets mod-api and depends on that branch. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner

Description: the files to read first now name the mod-api paths (game/mods/shadows).

Description: the files to read first now name the mod-api paths (game/mods/shadows).
Some checks failed
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 15s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 16s
Third-party parts / As their notes say (pull_request) Successful in 19s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 20s
CI / What the change needs (pull_request) Successful in 46s
CI / Website build and checks (pull_request) Failing after 2m15s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 6m24s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m43s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 7m34s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 5m1s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 8m26s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 55s
PR description / Title and description (pull_request_target) Has been cancelled
PR description / Description follows the template (pull_request_target) Failing after 5s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 10m7s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 13m46s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/2274-ultrawide-shadows:Wrath-fix/2274-ultrawide-shadows'
git switch 'Wrath-fix/2274-ultrawide-shadows'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'mod-api'
git merge --no-ff 'Wrath-fix/2274-ultrawide-shadows'
git switch 'Wrath-fix/2274-ultrawide-shadows'
git rebase 'mod-api'
git switch 'mod-api'
git merge --ff-only 'Wrath-fix/2274-ultrawide-shadows'
git switch 'Wrath-fix/2274-ultrawide-shadows'
git rebase 'mod-api'
git switch 'mod-api'
git merge --no-ff 'Wrath-fix/2274-ultrawide-shadows'
git switch 'mod-api'
git merge --squash 'Wrath-fix/2274-ultrawide-shadows'
git switch 'mod-api'
git merge --ff-only 'Wrath-fix/2274-ultrawide-shadows'
git switch 'mod-api'
git merge 'Wrath-fix/2274-ultrawide-shadows'
git push origin 'mod-api'
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!2431
No description provided.