[PR #5890] [MERGED] Shader packs: clear a recycled mesh's light sources #6542

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5890
Author: @Teiwazik
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/mesh-pool-lights


📝 Commits (1)

  • e241409 Clear a recycled mesh's light sources

📊 Changes

2 files changed (+4 additions, -0 deletions)

View changed files

📝 crates/horizon-client-render/src/mesher.rs (+2 -0)
📝 crates/horizon-client-render/src/streaming.rs (+2 -0)

📄 Description

🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally.

Fixes #5881.

SectionMesh::clear resets every list of a mesh going back to the pool except lights, which came in with [[lights]] (#5753). A mesh taken from the pool then starts with the light sources of the section it last held, so with a pack that has [[lights]], a broken torch can keep tinting the light around it and sources from other sections pile up.

The list is now cleared with the rest and counted in capacity_bytes. mesh_pool_reuses_capacity_with_clean_geometry_state covers it.

Proof

  • The pool test above now puts a source in the mesh and asserts the reused mesh has none. I didn't run it without the clear line.
  • Local single-player, in a closed dark room, on a local build that also traces rays from this same list: a torch's light went away when the torch was replaced with air, and stayed away after six place-and-remove rounds nearby. That build is not this branch, and I didn't run the colour grid alone on this branch. No screenshot attached: it would show Mojang's textures.

pr_ready (tools/pr_ready.py --quick on teiwazik-laptop, against origin/main at 07b7ea30d, 2 min 31 s)

Check Result
Scope ✅ 2 files, +4 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (40 s)
rustfmt ✅ (9 s)
clippy ✅ (44 s)
tests: horizon-client-render ✅ 846 passed (57 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_01EBqm1v5zTsDGwuZF6XKFjL


🔄 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/5890 **Author:** [@Teiwazik](https://github.com/Teiwazik) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/mesh-pool-lights` --- ### 📝 Commits (1) - [`e241409`](https://github.com/horizon-rust/horizon/commit/e241409e65d30dbe2d1104633abef3410a3eee58) Clear a recycled mesh's light sources ### 📊 Changes **2 files changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/mesher.rs` (+2 -0) 📝 `crates/horizon-client-render/src/streaming.rs` (+2 -0) </details> ### 📄 Description > 🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally. Fixes #5881. `SectionMesh::clear` resets every list of a mesh going back to the pool except `lights`, which came in with `[[lights]]` (#5753). A mesh taken from the pool then starts with the light sources of the section it last held, so with a pack that has `[[lights]]`, a broken torch can keep tinting the light around it and sources from other sections pile up. The list is now cleared with the rest and counted in `capacity_bytes`. `mesh_pool_reuses_capacity_with_clean_geometry_state` covers it. ## Proof - The pool test above now puts a source in the mesh and asserts the reused mesh has none. I didn't run it without the `clear` line. - Local single-player, in a closed dark room, on a local build that also traces rays from this same list: a torch's light went away when the torch was replaced with air, and stayed away after six place-and-remove rounds nearby. That build is not this branch, and I didn't run the colour grid alone on this branch. No screenshot attached: it would show Mojang's textures. **pr_ready** (`tools/pr_ready.py --quick` on teiwazik-laptop, against origin/main at 07b7ea30d, 2 min 31 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +4 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (40 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (44 s) | | tests: horizon-client-render | ✅ 846 passed (57 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EBqm1v5zTsDGwuZF6XKFjL --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:22:40 +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#6542
No description provided.