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

Closed
leonida/mandy
Andretuta wants to merge 0 commits from old-pr/9772 into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

Andretuta commented 2026-11-24 02:07:47 +00:00

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.
> 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.
aslan2142 commented 2026-12-01 12:05:01 +00:00

Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. *(AI-assisted triage.)*
aslan2142 commented 2026-12-01 16:20:23 +00:00

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
Sign in to join this conversation.
No description provided.