[PR #6] [MERGED] Avoid continuous retries during distant-terrain update debounce #2257

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/6
Author: @ludovic111
Created: 10/3/2026
Status: ✅ Merged
Merged: 10/3/2026
Merged by: @ludovic111

Base: main ← Head: distant-queue-wait


📝 Commits (3)

  • edadef3 Yield during pending distant-terrain debounce retries
  • 3d48385 Record cross-platform queue results and real game validation
  • 76e2644 Update starter pack count for queue experiments

📊 Changes

20 files changed (+352 additions, -9 deletions)

View changed files

📝 .github/workflows/ci.yml (+3 -0)
📝 README.md (+6 -2)
➕ benchmarks/debounce-queue-2026-10-03/macos-26.txt (+14 -0)
➕ benchmarks/debounce-queue-2026-10-03/ubuntu-latest.txt (+14 -0)
➕ benchmarks/debounce-queue-2026-10-03/windows-latest.txt (+14 -0)
➕ docs/debounce-queue.md (+83 -0)
📝 docs/playable-validation.md (+12 -0)
➕ mods/horizon-lab/src/main/java/dev/horizonlab/budget/DebounceWait.java (+14 -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 (+52 -0)
📝 mods/horizon-lab/src/main/java/dev/horizonlab/mixin/HorizonMixinPlugin.java (+21 -2)
📝 mods/horizon-lab/src/main/resources/fabric.mod.json (+1 -1)
📝 mods/horizon-lab/src/main/resources/horizonlab.mixins.json (+1 -1)
➕ mods/horizon-lab/src/test/java/dev/horizonlab/budget/DebounceQueueBenchmark.java (+50 -0)
➕ mods/horizon-lab/src/test/java/dev/horizonlab/budget/DebounceWaitTest.java (+30 -0)
📝 packs/START-HERE.txt (+8 -0)
📝 packs/mods.lock.json (+1 -1)
📝 tools/Compare-Benchmarks.html (+1 -1)
📝 tools/build_mod.py (+21 -0)
📝 tools/build_pack.py (+5 -1)

📄 Description

A DH update inside its existing 250 ms debounce window can be popped and reinserted continuously because its queue is nonempty. The local profile corroborated allocation on this queue thread, and the actual upstream queue microbenchmark reproduces redundant polling.

Add an opt-in hook for exact DH 3.3.4 that keeps the original reinsertion and requests up to 1 ms of parking, bounded by the remaining deadline, only on the queue worker when no preprocessing is pending. New arrivals unpark debounce waits. Queue entries, priority, timestamps, overload policy, executor retries and gameplay simulation remain unchanged. queue-wait isolates the hook; adaptive-queue combines the existing controls. Balanced remains the default.

Validation: policy/deadline/wrap tests, actual publisher queue microbenchmark with identity/priority/count checks on Linux, Windows and Apple Silicon macOS, 19 Python tests and original mod/native memory tests pass. The exact candidate JAR rendered the real demo world, wrote 643 frame and 2,408 tick samples with matching CSV/JSON, reached the injected parking path in thread inspection, updated DH terrain data and saved/quitted cleanly. All eleven packs have the exact original JAR, intended opt-in flags and unchanged simulation distance. Raw hosted results and timer overshoot are documented; the microbenchmark is not a game-FPS or block-update-latency claim. A baseline without DH is also being checked.


🔄 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/6 **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:** `distant-queue-wait` --- ### 📝 Commits (3) - [`edadef3`](https://github.com/horizon-rust/horizon/commit/edadef31ec205413e176cf24d014fb535a055859) Yield during pending distant-terrain debounce retries - [`3d48385`](https://github.com/horizon-rust/horizon/commit/3d4838582c21b85550474daa230858bf18c5c8ca) Record cross-platform queue results and real game validation - [`76e2644`](https://github.com/horizon-rust/horizon/commit/76e2644f03079e1e3d24e183c2cb7ed620275f8b) Update starter pack count for queue experiments ### 📊 Changes **20 files changed** (+352 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+3 -0) 📝 `README.md` (+6 -2) ➕ `benchmarks/debounce-queue-2026-10-03/macos-26.txt` (+14 -0) ➕ `benchmarks/debounce-queue-2026-10-03/ubuntu-latest.txt` (+14 -0) ➕ `benchmarks/debounce-queue-2026-10-03/windows-latest.txt` (+14 -0) ➕ `docs/debounce-queue.md` (+83 -0) 📝 `docs/playable-validation.md` (+12 -0) ➕ `mods/horizon-lab/src/main/java/dev/horizonlab/budget/DebounceWait.java` (+14 -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` (+52 -0) 📝 `mods/horizon-lab/src/main/java/dev/horizonlab/mixin/HorizonMixinPlugin.java` (+21 -2) 📝 `mods/horizon-lab/src/main/resources/fabric.mod.json` (+1 -1) 📝 `mods/horizon-lab/src/main/resources/horizonlab.mixins.json` (+1 -1) ➕ `mods/horizon-lab/src/test/java/dev/horizonlab/budget/DebounceQueueBenchmark.java` (+50 -0) ➕ `mods/horizon-lab/src/test/java/dev/horizonlab/budget/DebounceWaitTest.java` (+30 -0) 📝 `packs/START-HERE.txt` (+8 -0) 📝 `packs/mods.lock.json` (+1 -1) 📝 `tools/Compare-Benchmarks.html` (+1 -1) 📝 `tools/build_mod.py` (+21 -0) 📝 `tools/build_pack.py` (+5 -1) </details> ### 📄 Description A DH update inside its existing 250 ms debounce window can be popped and reinserted continuously because its queue is nonempty. The local profile corroborated allocation on this queue thread, and the actual upstream queue microbenchmark reproduces redundant polling. Add an opt-in hook for exact DH 3.3.4 that keeps the original reinsertion and requests up to 1 ms of parking, bounded by the remaining deadline, only on the queue worker when no preprocessing is pending. New arrivals unpark debounce waits. Queue entries, priority, timestamps, overload policy, executor retries and gameplay simulation remain unchanged. `queue-wait` isolates the hook; `adaptive-queue` combines the existing controls. Balanced remains the default. Validation: policy/deadline/wrap tests, actual publisher queue microbenchmark with identity/priority/count checks on Linux, Windows and Apple Silicon macOS, 19 Python tests and original mod/native memory tests pass. The exact candidate JAR rendered the real demo world, wrote 643 frame and 2,408 tick samples with matching CSV/JSON, reached the injected parking path in thread inspection, updated DH terrain data and saved/quitted cleanly. All eleven packs have the exact original JAR, intended opt-in flags and unchanged simulation distance. Raw hosted results and timer overshoot are documented; the microbenchmark is not a game-FPS or block-update-latency claim. A baseline without DH is also being checked. --- <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#2257
No description provided.