[GH-ISSUE #4294] dedicated_server: the top light section of edge chunks is missing when a chunk is sent before its neighbour loads #1262

Closed
opened 2026-11-02 15:45:31 +07:00 by bsakaguchi · 2 comments
Owner

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

Originally assigned to: @ludovic111 on GitHub.

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

What fails

dedicated_server fails on line play-light-layers (the light the server sends with each first chunk, compared where all eight neighbours were sent) on the merged-head parity of four unrelated PRs today, on both runners:

PR job runner
#4185 (4abef77bb) https://github.com/horizon-rust/horizon/actions/runs/41008973308/job/123910560526 ludovics-mac-mini
#4200 (b9f8ea2f2) https://github.com/horizon-rust/horizon/actions/runs/41011529853/job/123918371736 ludovics-mac-mini
#4217 (c3601b74f) https://github.com/horizon-rust/horizon/actions/runs/41015698966/job/123931501303 playhorizon-horizon
#4232 (c8ee23f2b) https://github.com/horizon-rust/horizon/actions/runs/41018920258/job/123941508828 playhorizon-horizon

Each failed once and passed on its rerun or bare head; main's own parity-main runs passed in between, so it is intermittent.

The diff

The CI log cuts the line at 400 characters. From the runner's vanilla.txt and horizon.txt of the #4232 run: 25 inner chunks on both sides, and four chunks at the edge of what was sent differ, 7,-2, 7,-3, 8,-1 and 8,0. For those, vanilla sends light layers for sections 0 to 16, and Horizon sends them for 0 to 15. The topmost one is missing: the section above the column's highest non-air section, which exists because a neighbour has blocks there.

The same diff was found on #2608 on 2026-10-29: chunks 7,-2, 7,-3 and 8,-2, sky and block light 0..16 against 0..15. That branch failed 3 of 3, and main passed. It stopped showing after main moved and was carried as #4095, which merged at 04:33Z today. The first failure above is at 05:54Z.

Where I think it comes from (Horizon's side, to be confirmed)

#4095 makes an idle dedicated server keep no area around the spawn, so the chunks around the joining player are now loaded and lit while the client is being sent its first chunks. Before, they were loaded at startup.

  • lan/chunks.rs around() builds the light-section mask from the neighbours found in world.chunks only.
  • A chunk can be lit (Streaming::light_region) against a neighbour that is still a decorated proto chunk (a light view). next_batch then sends it as soon as it is lit, before that neighbour reaches world.chunks.
  • Vanilla's mask (LayerLightSectionStorage) includes every neighbour that has reached INITIALIZE_LIGHT. A chunk is FULL only once its neighbours have, so a proto neighbour's sections count too.

Next: run dedicated_server --fresh 5× on main to see which side's line varies, then fix it in its own PR (server-next, #3989).

Originally created by @ludovic111 on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4294 Originally assigned to: @ludovic111 on GitHub. > 🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself. ## What fails `dedicated_server` fails on line `play-light-layers` (the light the server sends with each first chunk, compared where all eight neighbours were sent) on the merged-head parity of four unrelated PRs today, on both runners: | PR | job | runner | |---|---|---| | #4185 (4abef77bb) | https://github.com/horizon-rust/horizon/actions/runs/41008973308/job/123910560526 | ludovics-mac-mini | | #4200 (b9f8ea2f2) | https://github.com/horizon-rust/horizon/actions/runs/41011529853/job/123918371736 | ludovics-mac-mini | | #4217 (c3601b74f) | https://github.com/horizon-rust/horizon/actions/runs/41015698966/job/123931501303 | playhorizon-horizon | | #4232 (c8ee23f2b) | https://github.com/horizon-rust/horizon/actions/runs/41018920258/job/123941508828 | playhorizon-horizon | Each failed once and passed on its rerun or bare head; main's own `parity-main` runs passed in between, so it is intermittent. ## The diff The CI log cuts the line at 400 characters. From the runner's `vanilla.txt` and `horizon.txt` of the #4232 run: 25 inner chunks on both sides, and four chunks at the edge of what was sent differ, `7,-2`, `7,-3`, `8,-1` and `8,0`. For those, vanilla sends light layers for sections 0 to 16, and Horizon sends them for 0 to 15. The topmost one is missing: the section above the column's highest non-air section, which exists because a neighbour has blocks there. The same diff was found on #2608 on 2026-10-29: chunks `7,-2`, `7,-3` and `8,-2`, sky and block light 0..16 against 0..15. That branch failed 3 of 3, and main passed. It stopped showing after main moved and was carried as #4095, which merged at 04:33Z today. The first failure above is at 05:54Z. ## Where I think it comes from (Horizon's side, to be confirmed) #4095 makes an idle dedicated server keep no area around the spawn, so the chunks around the joining player are now loaded and lit while the client is being sent its first chunks. Before, they were loaded at startup. - `lan/chunks.rs` `around()` builds the light-section mask from the neighbours found in `world.chunks` only. - A chunk can be lit (`Streaming::light_region`) against a neighbour that is still a decorated proto chunk (a light view). `next_batch` then sends it as soon as it is `lit`, before that neighbour reaches `world.chunks`. - Vanilla's mask (`LayerLightSectionStorage`) includes every neighbour that has reached INITIALIZE_LIGHT. A chunk is FULL only once its neighbours have, so a proto neighbour's sections count too. Next: run `dedicated_server --fresh` 5× on main to see which side's line varies, then fix it in its own PR (server-next, #3989).
bsakaguchi 2026-11-02 15:45:31 +07:00
  • closed this issue
  • added the
    server
    label
Author
Owner

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

/claim

<!-- gh-comment-id:6518737751 --> @ludovic111 commented on GitHub (Oct 30, 2026): /claim
Author
Owner

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

🤖 Agent: confirmed on Horizon's side and fixed in #4320. On playhorizon, main failed 5 of 5 with the same diff (7,-2 and 7,-3; the neighbour 8,-3 has blocks in section 15). A trace showed both columns were loaded with their saved light and sent while 8,-3 was still a proto chunk. Vanilla's LIGHT step needs every neighbour at INITIALIZE_LIGHT and counts their sections. With the fix, 5 of 5 pass; idle RSS, join p99 and first-view time are unchanged (numbers in the PR).

<!-- gh-comment-id:6520190954 --> @ludovic111 commented on GitHub (Oct 30, 2026): 🤖 Agent: confirmed on Horizon's side and fixed in #4320. On playhorizon, main failed 5 of 5 with the same diff (7,-2 and 7,-3; the neighbour 8,-3 has blocks in section 15). A trace showed both columns were loaded with their saved light and sent while 8,-3 was still a proto chunk. Vanilla's LIGHT step needs every neighbour at INITIALIZE_LIGHT and counts their sections. With the fix, 5 of 5 pass; idle RSS, join p99 and first-view time are unchanged (numbers in the PR).
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#1262
No description provided.