[PR #7463] [MERGED] Sort forceload query replies by signed packed chunk IDs #7616

Closed
opened 2026-11-03 07:20:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7463
Author: @TheMrZZ
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/forceload-query-order


📝 Commits (1)

  • 72817d3 Sort forceload query replies by signed packed chunk IDs

📊 Changes

2 files changed (+25 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/commands/terrain_cmds.rs (+3 -2)
📝 tools/command_exec_corpus.py (+22 -0)

📄 Description

🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

What and why

/forceload query now orders its list by signed packed chunk IDs, matching Java 26.3. For chunks [2,0], [-1,0], and [0,-1], the reply becomes [0,-1], [2,0], [-1,0] instead of coordinate-tuple order.

The only gameplay change is the query's sort key, using the existing ChunkPos::pack(). Counts, point queries, chunk-loading behavior, and backing-set storage are unchanged. No chunk-readiness claim is made.

Fixes #7451.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

Official Java 26.3 ForceLoadCommand calls ServerLevel.getForceLoadedChunks().longStream().sorted() before formatting the chunk positions. ChunkPos.pack(x,z) stores unsigned x bits in the low 32 bits and unsigned z bits in the high 32 bits, and the stream sorts the resulting signed long values. Backing-set iteration/history therefore does not determine this reply order.

Other projects' code

None.

Self-check

The command-execution corpus now covers empty and singleton list replies, the mixed-sign order, point queries before/after add and remove, and remove-all cleanup. Existing positive-coordinate cases remain. Full native command runtime parity requires prepared game data and remains unrun locally.

pr_ready (tools/pr_ready.py --quick on a local runner, against origin/main at f696adc89, 5 min 21 s)

Check Result
Scope ✅ 2 files, +25 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (1 min 30 s)
rustfmt ✅ (12 s)
clippy ✅ (2 min 6 s)
tests: horizon-client ✅ 694 passed (1 min 16 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ✅ (14 s)
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 Codex.


🔄 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/7463 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/forceload-query-order` --- ### 📝 Commits (1) - [`72817d3`](https://github.com/horizon-rust/horizon/commit/72817d326e21355efa3077e633d7c48d7b0f506c) Sort forceload query replies by signed packed chunk IDs ### 📊 Changes **2 files changed** (+25 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands/terrain_cmds.rs` (+3 -2) 📝 `tools/command_exec_corpus.py` (+22 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why `/forceload query` now orders its list by signed packed chunk IDs, matching Java 26.3. For chunks `[2,0]`, `[-1,0]`, and `[0,-1]`, the reply becomes `[0,-1], [2,0], [-1,0]` instead of coordinate-tuple order. The only gameplay change is the query's sort key, using the existing `ChunkPos::pack()`. Counts, point queries, chunk-loading behavior, and backing-set storage are unchanged. No chunk-readiness claim is made. Fixes #7451. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference Official Java 26.3 `ForceLoadCommand` calls `ServerLevel.getForceLoadedChunks().longStream().sorted()` before formatting the chunk positions. `ChunkPos.pack(x,z)` stores unsigned x bits in the low 32 bits and unsigned z bits in the high 32 bits, and the stream sorts the resulting signed long values. Backing-set iteration/history therefore does not determine this reply order. ## Other projects' code None. ## Self-check The command-execution corpus now covers empty and singleton list replies, the mixed-sign order, point queries before/after add and remove, and remove-all cleanup. Existing positive-coordinate cases remain. Full native command runtime parity requires prepared game data and remains unrun locally. **pr_ready** (`tools/pr_ready.py --quick` on a local runner, against origin/main at f696adc89, 5 min 21 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +25 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (1 min 30 s) | | rustfmt | ✅ (12 s) | | clippy | ✅ (2 min 6 s) | | tests: horizon-client | ✅ 694 passed (1 min 16 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (14 s) | | 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 [Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 07:20:49 +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#7616
No description provided.