[PR #6548] [MERGED] Atlas layout: first-fit shelves when the plain ones do not fit #6942

Closed
opened 2026-11-03 06:29:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/atlas-fit


📝 Commits (1)

  • 4673402 Atlas layout: fall back to first-fit shelves before giving up on a pack

📊 Changes

1 file changed (+51 additions, -15 deletions)

View changed files

📝 crates/horizon-client-render/src/hud.rs (+51 -15)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally.

Fixes #6525

The reporter's server pack (9852 images) failed with "do not fit a 16384x16384 atlas" at 161 to 238 million texels, i.e. 60 to 89 % of the 268 million the atlas holds. HudAtlas::layout put each image on the last shelf or opened a new one, so on a pack of mixed sizes the unused end of every shelf (an image 9000 wide leaves 7383 of 16384) was lost.

Now, at each width, the plain shelves are tried first (so every pack that fits today keeps exactly its layout), then the same shelves with each image going to the first shelf that is tall enough and has room (HudAtlas::shelves). Only then does the width grow, and the error stays for packs that really are too big.

Test: mixed_sizes_fill_the_ends_of_the_shelves (15 images 9000x1000 and 15 of 4000x1000: 19 shelves with the old layout, 15 with the new one). cargo test -p horizon-client-render --lib hud::, clippy.

Not verified: I do not have the OPSUCHT pack. If its images are too many texels even packed tightly (the 238M first attempt is 89 % of the atlas), it still fails with the same message; the texel count in the log (it fell from 238M to 161M over the four attempts, which I did not trace) says which. The missing ia:5180 and ia:5182 textures in the log are a separate message and do not stop the load.

🤖 Generated with Claude Code


🔄 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/6548 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/atlas-fit` --- ### 📝 Commits (1) - [`4673402`](https://github.com/horizon-rust/horizon/commit/4673402d9b40f3b1fd697ff9960bcd210b4772b4) Atlas layout: fall back to first-fit shelves before giving up on a pack ### 📊 Changes **1 file changed** (+51 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/hud.rs` (+51 -15) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally. Fixes #6525 The reporter's server pack (9852 images) failed with "do not fit a 16384x16384 atlas" at 161 to 238 million texels, i.e. 60 to 89 % of the 268 million the atlas holds. `HudAtlas::layout` put each image on the last shelf or opened a new one, so on a pack of mixed sizes the unused end of every shelf (an image 9000 wide leaves 7383 of 16384) was lost. Now, at each width, the plain shelves are tried first (so every pack that fits today keeps exactly its layout), then the same shelves with each image going to the first shelf that is tall enough and has room (`HudAtlas::shelves`). Only then does the width grow, and the error stays for packs that really are too big. Test: `mixed_sizes_fill_the_ends_of_the_shelves` (15 images 9000x1000 and 15 of 4000x1000: 19 shelves with the old layout, 15 with the new one). `cargo test -p horizon-client-render --lib hud::`, clippy. Not verified: I do not have the OPSUCHT pack. If its images are too many texels even packed tightly (the 238M first attempt is 89 % of the atlas), it still fails with the same message; the texel count in the log (it fell from 238M to 161M over the four attempts, which I did not trace) says which. The missing `ia:5180` and `ia:5182` textures in the log are a separate message and do not stop the load. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:29:58 +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#6942
No description provided.