[PR #10] [MERGED] Wake idle distant-terrain queues when new work arrives #2260

Closed
opened 2026-11-02 15:54:26 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/10
Author: @ludovic111
Created: 10/3/2026
Status: ✅ Merged
Merged: 10/3/2026
Merged by: @ludovic111

Base: main ← Head: wakeable-terrain-idle


📝 Commits (2)

  • 846490e Wake idle terrain queues on incoming work while preserving interruption and maintenance
  • f901c94 Record hosted wake-latency results and final idle-hook game validation

📊 Changes

17 files changed (+388 additions, -7 deletions)

View changed files

📝 .github/workflows/ci.yml (+3 -0)
📝 README.md (+5 -1)
➕ benchmarks/idle-queue-2026-10-03/macos-26.txt (+42 -0)
➕ benchmarks/idle-queue-2026-10-03/ubuntu-latest.txt (+42 -0)
➕ benchmarks/idle-queue-2026-10-03/windows-latest.txt (+42 -0)
📝 docs/debounce-queue.md (+40 -4)
📝 docs/playable-validation.md (+14 -0)
➕ mods/horizon-lab/src/main/java/dev/horizonlab/budget/WakeableIdleWait.java (+15 -0)
📝 mods/horizon-lab/src/main/java/dev/horizonlab/client/HorizonClient.java (+1 -0)
📝 mods/horizon-lab/src/main/java/dev/horizonlab/mixin/DhDebounceWaitMixin.java (+25 -0)
📝 mods/horizon-lab/src/main/resources/fabric.mod.json (+1 -1)
➕ mods/horizon-lab/src/test/java/dev/horizonlab/budget/IdleQueueBenchmark.java (+63 -0)
➕ mods/horizon-lab/src/test/java/dev/horizonlab/budget/WakeableIdleWaitTest.java (+70 -0)
📝 packs/START-HERE.txt (+2 -0)
📝 packs/mods.lock.json (+1 -1)
📝 tools/Compare-Benchmarks.html (+1 -0)
📝 tools/build_mod.py (+21 -0)

📄 Description

An empty distant-terrain queue slept for 50 ms even after incoming work arrived. In the optional queue experiment, replace that idle sleep with an arrival-wakeable park bounded by the cache-maintenance deadline. Preserve Thread.sleep-style interruption handling and prevent early wakeups from increasing cache-maintenance frequency. Existing debounce timestamps, dispatch, queue identity/priority, overload policy and gameplay remain in use.

Add actual publisher-queue wake-latency measurements with discarded warm-up and 20 alternating trials, plus concurrency checks for early/unparked arrivals and interruption. Capture the enabled idle hook in frame metadata and show it in the offline viewer. Prepare version 0.9.0 packs.

Validation: local policy/concurrency and 20 Python checks passed. Local isolated median publication-to-pop latency: upstream 45.181 ms, wakeable 0.199 ms. This is not visible-terrain latency or FPS. Cross-platform builds, concurrency tests and publisher queue benchmarks passed on Linux, Windows and hosted Apple Silicon macOS. The exact final JAR ran the combined profile with render/simulation 12/12; thread inspection reached the idle hook in all dimensions, 806 frames and 2,411 ticks match CSV, the viewer shows the flag, and worlds/databases/workers closed cleanly. Hosted results and scheduler outliers are committed with limits.


🔄 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/10 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/3/2026 **Status:** ✅ Merged **Merged:** 10/3/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `wakeable-terrain-idle` --- ### 📝 Commits (2) - [`846490e`](https://github.com/horizon-rust/horizon/commit/846490e1992619b6c614092cc4c469b4ab09accc) Wake idle terrain queues on incoming work while preserving interruption and maintenance - [`f901c94`](https://github.com/horizon-rust/horizon/commit/f901c946929e70eb77341e725a82884e93a02c5c) Record hosted wake-latency results and final idle-hook game validation ### 📊 Changes **17 files changed** (+388 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+3 -0) 📝 `README.md` (+5 -1) ➕ `benchmarks/idle-queue-2026-10-03/macos-26.txt` (+42 -0) ➕ `benchmarks/idle-queue-2026-10-03/ubuntu-latest.txt` (+42 -0) ➕ `benchmarks/idle-queue-2026-10-03/windows-latest.txt` (+42 -0) 📝 `docs/debounce-queue.md` (+40 -4) 📝 `docs/playable-validation.md` (+14 -0) ➕ `mods/horizon-lab/src/main/java/dev/horizonlab/budget/WakeableIdleWait.java` (+15 -0) 📝 `mods/horizon-lab/src/main/java/dev/horizonlab/client/HorizonClient.java` (+1 -0) 📝 `mods/horizon-lab/src/main/java/dev/horizonlab/mixin/DhDebounceWaitMixin.java` (+25 -0) 📝 `mods/horizon-lab/src/main/resources/fabric.mod.json` (+1 -1) ➕ `mods/horizon-lab/src/test/java/dev/horizonlab/budget/IdleQueueBenchmark.java` (+63 -0) ➕ `mods/horizon-lab/src/test/java/dev/horizonlab/budget/WakeableIdleWaitTest.java` (+70 -0) 📝 `packs/START-HERE.txt` (+2 -0) 📝 `packs/mods.lock.json` (+1 -1) 📝 `tools/Compare-Benchmarks.html` (+1 -0) 📝 `tools/build_mod.py` (+21 -0) </details> ### 📄 Description An empty distant-terrain queue slept for 50 ms even after incoming work arrived. In the optional queue experiment, replace that idle sleep with an arrival-wakeable park bounded by the cache-maintenance deadline. Preserve Thread.sleep-style interruption handling and prevent early wakeups from increasing cache-maintenance frequency. Existing debounce timestamps, dispatch, queue identity/priority, overload policy and gameplay remain in use. Add actual publisher-queue wake-latency measurements with discarded warm-up and 20 alternating trials, plus concurrency checks for early/unparked arrivals and interruption. Capture the enabled idle hook in frame metadata and show it in the offline viewer. Prepare version 0.9.0 packs. Validation: local policy/concurrency and 20 Python checks passed. Local isolated median publication-to-pop latency: upstream 45.181 ms, wakeable 0.199 ms. This is not visible-terrain latency or FPS. Cross-platform builds, concurrency tests and publisher queue benchmarks passed on Linux, Windows and hosted Apple Silicon macOS. The exact final JAR ran the combined profile with render/simulation 12/12; thread inspection reached the idle hook in all dimensions, 806 frames and 2,411 ticks match CSV, the viewer shows the flag, and worlds/databases/workers closed cleanly. Hosted results and scheduler outliers are committed with limits. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:54:26 +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#2260
No description provided.