[PR #50] Exclude oversized sheets from sandbox ground bounds (BUILD-3983) #102

Open
opened 2026-11-26 20:16:48 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/50
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9772


📝 Commits (1)

  • 6e067f9 Keep oversized sheets out of sandbox ground bounds

📊 Changes

2 files changed (+66 additions, -14 deletions)

View changed files

📝 runtime/CMakeLists.txt (+1 -0)
📝 runtime/test/vk_sandbox.cpp (+65 -14)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/50 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9772` --- ### 📝 Commits (1) - [`6e067f9`](https://github.com/ubiquitarianism/leonida/commit/6e067f94afac7fcc9d1f541228a52caa1e6fe2b3) Keep oversized sheets out of sandbox ground bounds ### 📊 Changes **2 files changed** (+66 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+1 -0) 📝 `runtime/test/vk_sandbox.cpp` (+65 -14) </details> ### 📄 Description > 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
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
starred/leonida#102
No description provided.