[PR #7399] [CLOSED] Optimize asynchronous entity occlusion #7577

Closed
opened 2026-11-03 07:20:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7399
Author: @elythepreciouscat
Created: 11/2/2026
Status: ❌ Closed

Base: main ← Head: perf/async-entity-occlusion


📝 Commits (10+)

  • 778dad1 Keep entity occlusion culling off block entities
  • 9c10104 Optimize asynchronous entity and particle culling
  • 627309b Merge remote-tracking branch 'origin/main' into perf/async-occlusion-culling
  • 8d603dc Refresh async culling benchmark evidence
  • e6ce596 Update mouse input fixture for trace logging
  • a71e1d0 Translate particle culling graphics settings
  • a9a08ef Separate async entity occlusion rewrite
  • 7bee9ec Merge origin/main into entity occlusion branch
  • 1068905 Add entity occlusion benchmark evidence
  • 03ef181 Format entity occlusion culling module

📊 Changes

19 files changed (+2275 additions, -631 deletions)

View changed files

➕ benchmarks/entity-occlusion/2026-11-02/README.md (+42 -0)
➕ benchmarks/entity-occlusion/2026-11-02/branch-async.png (+0 -0)
➕ benchmarks/entity-occlusion/2026-11-02/branch-off.png (+0 -0)
➕ benchmarks/entity-occlusion/2026-11-02/branch-sync.png (+0 -0)
➕ benchmarks/entity-occlusion/2026-11-02/main-off.png (+0 -0)
📝 crates/horizon-client/src/entity_culling.rs (+144 -16)
📝 crates/horizon-client/src/game.rs (+10 -22)
📝 crates/horizon-client/src/game/armor_stands.rs (+8 -2)
📝 crates/horizon-client/src/game/boats.rs (+6 -2)
📝 crates/horizon-client/src/game/control.rs (+18 -3)
📝 crates/horizon-client/src/game/cushions.rs (+10 -6)
📝 crates/horizon-client/src/game/entity.rs (+70 -1)
📝 crates/horizon-client/src/game/entity_culling.rs (+151 -562)
📝 crates/horizon-client/src/game/frames.rs (+19 -10)
📝 crates/horizon-client/src/game/item_draw.rs (+6 -0)
📝 crates/horizon-client/src/game/minecarts.rs (+6 -2)
➕ crates/horizon-client/src/game/occlusion_culling.rs (+1773 -0)
📝 crates/horizon-client/src/game/paintings.rs (+8 -4)
📝 docs/native-client.md (+4 -1)

📄 Description

🤖 Opened by elythepreciouscat's AI agent (OpenAI Codex, GPT-6), not by elythepreciouscat personally.

What and why

This PR isolates the entity-occlusion rewrite from #7054. It checks inflated world-space entity AABBs before generating model geometry, then refines visible or uncached entities using their emitted mesh bounds. Glowing entities bypass occlusion, and stale or uncertain asynchronous results fail open.

The asynchronous worker, ordered result cache, section-proof validation cache, and render-thread telemetry are entity-only. Particle Culling and the particle-light lookup cache are in separate PRs. The existing setting still controls this path; defaults are unchanged.

Measurements

The linked report includes the requested ordinary-scene comparison and an opaque-wall stress scene. The ordinary-scene measurements are from the pre-split integration build with Particle Culling Off; that build also had the particle-light cache, so those results are context rather than an isolated measurement of this commit. The cache-only comparison in #7391 showed no measurable CPU change in that scene. The opaque-wall captures and data likewise come from the pre-split integration build.

Full setup, measurements, caveats, and screenshots

  • Ordinary scene, 24 mobs and rain/campfire particles: Main Off 88.59 FPS / 1.829 ms CPU; integration Off 88.33 / 2.063. Main Entity Sync 89.34 / 1.965; integration Entity Sync 89.13 / 2.113.
  • Wall scene, 192 additional pigs behind a wall with a one-block opening: Main Entity Async 92.73 FPS / 2.364 ms CPU; integration Entity Async 92.62 / 2.314. The synthetic run shows a small CPU reduction without an FPS gain beyond run-to-run spread.

Opaque-wall scene, entity culling Off

Opaque-wall scene, synchronous entity culling

Opaque-wall scene, asynchronous entity culling

Kind

  • parity
  • bug
  • perf
  • feature
  • extra
  • tooling
  • docs

Self-check

Checks were not rerun for this split, as requested. The PR branch includes the latest origin/main.

🤖 Generated with OpenAI Codex


🔄 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/horizon-rust/horizon/pull/7399 **Author:** [@elythepreciouscat](https://github.com/elythepreciouscat) **Created:** 11/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `perf/async-entity-occlusion` --- ### 📝 Commits (10+) - [`778dad1`](https://github.com/horizon-rust/horizon/commit/778dad1e4a81fafe4442f836b7169d6988f8aee7) Keep entity occlusion culling off block entities - [`9c10104`](https://github.com/horizon-rust/horizon/commit/9c101044469b717ec0706f77f8ca801b78bf9a68) Optimize asynchronous entity and particle culling - [`627309b`](https://github.com/horizon-rust/horizon/commit/627309b80abfb881951edd376d9881b20b2bbf8f) Merge remote-tracking branch 'origin/main' into perf/async-occlusion-culling - [`8d603dc`](https://github.com/horizon-rust/horizon/commit/8d603dc51f25c6286a5316d56c9cd08019d52e3a) Refresh async culling benchmark evidence - [`e6ce596`](https://github.com/horizon-rust/horizon/commit/e6ce59614465e786fca19e723b66f87b0d4585cf) Update mouse input fixture for trace logging - [`a71e1d0`](https://github.com/horizon-rust/horizon/commit/a71e1d06657b0e2d947301f492b9d0a087156eae) Translate particle culling graphics settings - [`a9a08ef`](https://github.com/horizon-rust/horizon/commit/a9a08ef1a6a75ef42402b36208c1f46cc920bbee) Separate async entity occlusion rewrite - [`7bee9ec`](https://github.com/horizon-rust/horizon/commit/7bee9ec3cf4e893b42596d2915afeb6d4841e540) Merge origin/main into entity occlusion branch - [`1068905`](https://github.com/horizon-rust/horizon/commit/1068905d3ded44c528a29631e24d6598fa1c0590) Add entity occlusion benchmark evidence - [`03ef181`](https://github.com/horizon-rust/horizon/commit/03ef18163d3c46de7107b973fa958441e22b6084) Format entity occlusion culling module ### 📊 Changes **19 files changed** (+2275 additions, -631 deletions) <details> <summary>View changed files</summary> ➕ `benchmarks/entity-occlusion/2026-11-02/README.md` (+42 -0) ➕ `benchmarks/entity-occlusion/2026-11-02/branch-async.png` (+0 -0) ➕ `benchmarks/entity-occlusion/2026-11-02/branch-off.png` (+0 -0) ➕ `benchmarks/entity-occlusion/2026-11-02/branch-sync.png` (+0 -0) ➕ `benchmarks/entity-occlusion/2026-11-02/main-off.png` (+0 -0) 📝 `crates/horizon-client/src/entity_culling.rs` (+144 -16) 📝 `crates/horizon-client/src/game.rs` (+10 -22) 📝 `crates/horizon-client/src/game/armor_stands.rs` (+8 -2) 📝 `crates/horizon-client/src/game/boats.rs` (+6 -2) 📝 `crates/horizon-client/src/game/control.rs` (+18 -3) 📝 `crates/horizon-client/src/game/cushions.rs` (+10 -6) 📝 `crates/horizon-client/src/game/entity.rs` (+70 -1) 📝 `crates/horizon-client/src/game/entity_culling.rs` (+151 -562) 📝 `crates/horizon-client/src/game/frames.rs` (+19 -10) 📝 `crates/horizon-client/src/game/item_draw.rs` (+6 -0) 📝 `crates/horizon-client/src/game/minecarts.rs` (+6 -2) ➕ `crates/horizon-client/src/game/occlusion_culling.rs` (+1773 -0) 📝 `crates/horizon-client/src/game/paintings.rs` (+8 -4) 📝 `docs/native-client.md` (+4 -1) </details> ### 📄 Description > 🤖 Opened by elythepreciouscat's AI agent (OpenAI Codex, GPT-6), not by elythepreciouscat personally. ## What and why This PR isolates the entity-occlusion rewrite from #7054. It checks inflated world-space entity AABBs before generating model geometry, then refines visible or uncached entities using their emitted mesh bounds. Glowing entities bypass occlusion, and stale or uncertain asynchronous results fail open. The asynchronous worker, ordered result cache, section-proof validation cache, and render-thread telemetry are entity-only. Particle Culling and the particle-light lookup cache are in separate PRs. The existing setting still controls this path; defaults are unchanged. ## Measurements The linked report includes the requested ordinary-scene comparison and an opaque-wall stress scene. The ordinary-scene measurements are from the pre-split integration build with Particle Culling Off; that build also had the particle-light cache, so those results are context rather than an isolated measurement of this commit. The cache-only comparison in #7391 showed no measurable CPU change in that scene. The opaque-wall captures and data likewise come from the pre-split integration build. [Full setup, measurements, caveats, and screenshots](https://github.com/elythepreciouscat/horizon/blob/perf/async-entity-occlusion/benchmarks/entity-occlusion/2026-11-02/README.md) - Ordinary scene, 24 mobs and rain/campfire particles: Main Off 88.59 FPS / 1.829 ms CPU; integration Off 88.33 / 2.063. Main Entity Sync 89.34 / 1.965; integration Entity Sync 89.13 / 2.113. - Wall scene, 192 additional pigs behind a wall with a one-block opening: Main Entity Async 92.73 FPS / 2.364 ms CPU; integration Entity Async 92.62 / 2.314. The synthetic run shows a small CPU reduction without an FPS gain beyond run-to-run spread. ![Opaque-wall scene, entity culling Off](https://raw.githubusercontent.com/elythepreciouscat/horizon/perf/async-entity-occlusion/benchmarks/entity-occlusion/2026-11-02/branch-off.png) ![Opaque-wall scene, synchronous entity culling](https://raw.githubusercontent.com/elythepreciouscat/horizon/perf/async-entity-occlusion/benchmarks/entity-occlusion/2026-11-02/branch-sync.png) ![Opaque-wall scene, asynchronous entity culling](https://raw.githubusercontent.com/elythepreciouscat/horizon/perf/async-entity-occlusion/benchmarks/entity-occlusion/2026-11-02/branch-async.png) ## Kind - [ ] parity - [ ] bug - [x] perf - [ ] feature - [ ] extra - [ ] tooling - [ ] docs ## Self-check Checks were not rerun for this split, as requested. The PR branch includes the latest `origin/main`. 🤖 Generated with [OpenAI Codex](https://openai.com/codex) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 07:20:11 +07:00
Sign in to join this conversation.
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
horizon-rust/horizon#7577
No description provided.