Exclude oversized sheets from sandbox ground bounds (BUILD-3983) #50

Open
github-bot wants to merge 1 commit from github-bot/gh-50 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:07 UTC · original
ubiquitarianism:old-pr/9772 → main · +66 −14 · 2 files · 1 commits · draft

Carried over from old PR 9772 by tcurtsinger in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9772, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
tcurtsinger: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed as BUILD-3983. Coordination claim · Original report from @shdann on #9706

What and why

A skydome or water sheet can move the sandbox collision grid's origin even when the builder later skips that sheet. In the reported example, a sheet reaching 20,000 m west puts the floor beyond the grid's 4,096-cell limit. Walk and Drive then miss the floor beneath the camera.

Apply the existing 64 m span check to each triangle after its draw transform and before it contributes to either grid dimension. Only eligible triangles enter the staging buffer. If none qualify, the grid is empty. Triangles spanning exactly 64 m remain eligible.

Tested

  • Added a CPU-only CTest, vk_sandbox_ground_bounds. With the same fixture on main at 5d74c2723, the grid had 135,168 cells and the floor query missed. With this change it has one cell and returns z = 0. The test also exercises a draw scaled to exactly 64 m and beyond it along each axis, including rebuilding a populated grid with only oversized sheets.
  • Windows x64, MSVC 19.44, NVIDIA GeForce RTX 4080, driver 621.01. Compared 18 windowed runs across two builds, three synthetic scenes and all three camera modes. With the floor and sheet together, Walk and Drive now settle at 1.70 m and 1.20 m. Built and tested the merge with #9706 as well, including repeated camera-mode switches.
  • All 25 sandbox Python tests passed. The full runtime built in RelWithDebInfo. CTest reported 226 passes, 12 skips, one disabled test and two failures (d3d12_vulkan_device and d3d12_depth_resolve), both previously reproduced on this same main.
  • The translator suite ran 5,957 tests across 447 files. The two failing files, test_image_atomics_guard and test_image_store_d16, produced the same 48 assertion failures as the clean baseline.

AI-assisted with OpenAI Codex.

Checklist

  • The changes contain only C++ and CMake source. scripts/check_no_game_data.py passed on both files.
**@⁠Andretuta** on GitHub · 2026-11-24 02:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/50) `ubiquitarianism:old-pr/9772` → `main` · +66 −14 · 2 files · 1 commits · draft > Carried over from **old PR 9772** by `tcurtsinger` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9772`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `tcurtsinger`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed as **BUILD-3983**. [Coordination claim](https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115290577) · [Original report from `@shdann` on `#9706`](https://github.com/ProjectLeonida/Leonida/pull/9706#issuecomment-7115208653) ### What and why A skydome or water sheet can move the sandbox collision grid's origin even when the builder later skips that sheet. In the reported example, a sheet reaching 20,000 m west puts the floor beyond the grid's 4,096-cell limit. Walk and Drive then miss the floor beneath the camera. Apply the existing 64 m span check to each triangle after its draw transform and before it contributes to either grid dimension. Only eligible triangles enter the staging buffer. If none qualify, the grid is empty. Triangles spanning exactly 64 m remain eligible. ### Tested - Added a CPU-only CTest, `vk_sandbox_ground_bounds`. With the same fixture on `main` at `5d74c2723`, the grid had 135,168 cells and the floor query missed. With this change it has one cell and returns `z = 0`. The test also exercises a draw scaled to exactly 64 m and beyond it along each axis, including rebuilding a populated grid with only oversized sheets. - Windows x64, MSVC 19.44, NVIDIA GeForce RTX 4080, driver 621.01. Compared 18 windowed runs across two builds, three synthetic scenes and all three camera modes. With the floor and sheet together, Walk and Drive now settle at 1.70 m and 1.20 m. Built and tested the merge with `#9706` as well, including repeated camera-mode switches. - All 25 sandbox Python tests passed. The full runtime built in `RelWithDebInfo`. CTest reported 226 passes, 12 skips, one disabled test and two failures (`d3d12_vulkan_device` and `d3d12_depth_resolve`), both previously reproduced on this same `main`. - The translator suite ran 5,957 tests across 447 files. The two failing files, `test_image_atomics_guard` and `test_image_store_d16`, produced the same 48 assertion failures as the clean baseline. AI-assisted with OpenAI Codex. ### Checklist - [x] The changes contain only C++ and CMake source. `scripts/check_no_game_data.py` passed on both files.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:42:21 +00:00
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 origin '+refs/pull/50/head:github-bot/gh-50'
git switch 'github-bot/gh-50'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-50'
git switch 'github-bot/gh-50'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-50'
git switch 'github-bot/gh-50'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-50'
git switch 'main'
git merge --squash 'github-bot/gh-50'
git switch 'main'
git merge --ff-only 'github-bot/gh-50'
git switch 'main'
git merge 'github-bot/gh-50'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.