[GH-ISSUE #891] Server thread: light from a block in an untracked chunk never reaches the border chunk (lan_e2e light) #252

Closed
opened 2026-11-02 15:37:39 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ludovic111 on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/891

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Found while working through the rest of #731 (making the server thread the default). On the server thread, lan_e2e --check light fails at its last step. It passes in-frame.

Reproduce

python3 tools/lan_e2e.py --bin-dir target/fast --server-thread --check light --out /tmp/light

The torch, roof and hole parts pass. The border part fails:

[host] ['command', 'setblock 225 200 0 minecraft:glowstone'] -> {"chat": ["Changed the block at 225, 200, 0"], "ok": true}
[guest] ['light', 223, 200, 0, 223, 200, 0] -> {"block": "0", "sky": "f", ...}
[lan] light: FAIL AssertionError('the border chunk by the glowstone has block light 0, not 13')

To see the setblock output I ran with #879, which makes the agent's command return its feedback on the server thread.

What it shows

  • The glowstone goes into chunk x=14, the first chunk the guest does not track. The server has that chunk loaded, because setblock reports a change.
  • Chunk 13 is on the border of what the guest tracks. Both clients (the guest, and the host window, which is a client on the server thread) still have block light 0 at x=223, two blocks from the glowstone, after 100 ticks.
  • In vanilla, ChunkHolder.broadcastChanges sends a ClientboundLightUpdatePacket for the border chunk's changed sections (ChunkMap.isChunkOnTrackedBorder). Hub::broadcast_light_changes does the same from world.light_log. So either the server never relights chunk 13 for that edit, or the change never reaches the light log.

Not verified yet

Streaming::relight_edits only relights edits in lit columns, and a column is lit only once all 8 of its neighbours are loaded (Streaming::region). My guess is that on the server thread, chunk 14 is in the outermost ring the server loads (the guest's extra area, radius + 1), so it never gets lit and the edit is dropped. In-frame, the host window's own render distance covers chunk 14 and the ring around it.

If that's the cause, the fix is in streaming: load one more ring past the border so the border chunks get lit, as vanilla's generation pyramid does. That changes how much the server generates, so it needs a perf check. I left it out of the #731 PRs for that reason.

🤖 Generated with Claude Code

Originally created by @ludovic111 on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/891 > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Found while working through the rest of #731 (making the server thread the default). On the server thread, `lan_e2e --check light` fails at its last step. It passes in-frame. ## Reproduce ``` python3 tools/lan_e2e.py --bin-dir target/fast --server-thread --check light --out /tmp/light ``` The torch, roof and hole parts pass. The border part fails: ``` [host] ['command', 'setblock 225 200 0 minecraft:glowstone'] -> {"chat": ["Changed the block at 225, 200, 0"], "ok": true} [guest] ['light', 223, 200, 0, 223, 200, 0] -> {"block": "0", "sky": "f", ...} [lan] light: FAIL AssertionError('the border chunk by the glowstone has block light 0, not 13') ``` To see the `setblock` output I ran with #879, which makes the agent's `command` return its feedback on the server thread. ## What it shows - The glowstone goes into chunk x=14, the first chunk the guest does not track. The server has that chunk loaded, because `setblock` reports a change. - Chunk 13 is on the border of what the guest tracks. Both clients (the guest, and the host window, which is a client on the server thread) still have block light 0 at x=223, two blocks from the glowstone, after 100 ticks. - In vanilla, `ChunkHolder.broadcastChanges` sends a `ClientboundLightUpdatePacket` for the border chunk's changed sections (`ChunkMap.isChunkOnTrackedBorder`). `Hub::broadcast_light_changes` does the same from `world.light_log`. So either the server never relights chunk 13 for that edit, or the change never reaches the light log. ## Not verified yet `Streaming::relight_edits` only relights edits in lit columns, and a column is lit only once all 8 of its neighbours are loaded (`Streaming::region`). My guess is that on the server thread, chunk 14 is in the outermost ring the server loads (the guest's `extra` area, `radius + 1`), so it never gets lit and the edit is dropped. In-frame, the host window's own render distance covers chunk 14 and the ring around it. If that's the cause, the fix is in streaming: load one more ring past the border so the border chunks get lit, as vanilla's generation pyramid does. That changes how much the server generates, so it needs a perf check. I left it out of the #731 PRs for that reason. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@ludovic111 commented on GitHub (Oct 18, 2026):

Claimed by ludovic on Discord (GitHub: ludovic111), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #891).

<!-- gh-comment-id:6251677100 --> @ludovic111 commented on GitHub (Oct 18, 2026): Claimed by `ludovic` on Discord (GitHub: `ludovic111`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #891). <!-- kira:work -->
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#252
No description provided.