[PR #961] [MERGED] Read GPU readbacks without assuming the mapping's alignment (fixes the Vega 11 launch crash) #2942

Closed
opened 2026-11-02 16:00:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/readback-alignment


📝 Commits (1)

  • f62e07c Read GPU readbacks without assuming the mapping's alignment

📊 Changes

2 files changed (+6 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/gfx/cull.rs (+4 -2)
📝 crates/horizon-client/src/gfx/timing.rs (+2 -1)

📄 Description

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

A player on Windows 10 with a Ryzen 5 3400G (Vega 11, Vulkan) crashes about 1.5 s after launch since 2026.10.18.27:

panicked at bytemuck-1.25.2/src/internal.rs:33:3:
cast_slice>TargetAlignmentGreaterAndInputNotAligned

Only two places in the workspace cast bytes to a wider type with cast_slice, and both read GPU readbacks in place from get_mapped_range():

  • gfx/cull.rs: the occlusion section-test results (&[u32]), new in 2026.10.18.26 (#939), the first release this player had trouble with;
  • gfx/timing.rs: the GPU timer's two timestamps (&[u64]).

The driver doesn't promise the mapping is 4- or 8-byte aligned, so this copies the words out (pod_collect_to_vec, pod_read_unaligned). The values and the logic are unchanged.

Checks: cargo fmt --check, cargo clippy -p horizon-client --all-targets -D warnings. It can't be reproduced on the Mac mini (Metal); the player will be asked to confirm on the release.

Fixes #953

🤖 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/961 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/readback-alignment` --- ### 📝 Commits (1) - [`f62e07c`](https://github.com/horizon-rust/horizon/commit/f62e07c36ae955c5bb025ea70a731c8b693e38e0) Read GPU readbacks without assuming the mapping's alignment ### 📊 Changes **2 files changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/gfx/cull.rs` (+4 -2) 📝 `crates/horizon-client/src/gfx/timing.rs` (+2 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. A player on Windows 10 with a Ryzen 5 3400G (Vega 11, Vulkan) crashes about 1.5 s after launch since 2026.10.18.27: ``` panicked at bytemuck-1.25.2/src/internal.rs:33:3: cast_slice>TargetAlignmentGreaterAndInputNotAligned ``` Only two places in the workspace cast bytes to a wider type with `cast_slice`, and both read GPU readbacks in place from `get_mapped_range()`: - `gfx/cull.rs`: the occlusion section-test results (`&[u32]`), new in 2026.10.18.26 (#939), the first release this player had trouble with; - `gfx/timing.rs`: the GPU timer's two timestamps (`&[u64]`). The driver doesn't promise the mapping is 4- or 8-byte aligned, so this copies the words out (`pod_collect_to_vec`, `pod_read_unaligned`). The values and the logic are unchanged. Checks: `cargo fmt --check`, `cargo clippy -p horizon-client --all-targets -D warnings`. It can't be reproduced on the Mac mini (Metal); the player will be asked to confirm on the release. Fixes #953 🤖 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-02 16:00:17 +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#2942
No description provided.