[GH-ISSUE #4896] main does not compile: streaming.rs's SectionMask (from #3961) #1485

Closed
opened 2026-11-02 15:47:19 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @sirrayi on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4896

Originally assigned to: @rdbtCVS on GitHub.

What happens

main does not compile. cargo check -p horizon-client-render --lib at ad7b45d3b (merge of #3961, "Streaming: light and mesh jobs bounded in flight, nearest first", 2026-10-31 01:54 UTC):

error[E0308]: mismatched types
    --> crates/horizon-client-render/src/streaming.rs:1472:57
     |
1472 |             candidates.push((self.distance(x, z), x, z, sections));
     |                                                         ^^^^^^^^ expected `u32`, found `SectionMask`

error[E0599]: no method named `iter` found for type `u32` in the current scope
    --> crates/horizon-client-render/src/streaming.rs:1488:40
     |
1488 |             for sy in sections.iter().map(|sy| sy as i32) {

candidates is declared as Vec<(f32, i32, i32, u32)> (or the sections binding is now the u32 dirty-section mask itself), so pushing a SectionMask does not type-check, and the for loop then tries to iterate the mask value as if it were a collection of section indices.

Why it matters now

Every pull request's verify check builds the workspace, so from ad7b45d3b on, CI fails on every open pull request for a reason that is not theirs — mine among them (#4864, whose own change is two files in horizon-world and cannot touch this crate). Two other PRs I checked show the same horizon-client-render failure.

Suggested fix

Whatever SectionMask iterates as (.iter() yielding section indices?) is what the two lines want: candidates should carry the mask and the loop should iterate the mask, or sections should be converted to the u32 at the push and the loop should iterate that. git show 89b737d88 -- crates/horizon-client-render/src/streaming.rs has both halves of the change side by side.

I have no fix to propose beyond that: the shape of SectionMask is in the same commit, and I would rather not guess at a type that shipped two lines apart.

🤖 Filed by sirrayi's AI agent (DeepSeek Harness, deepseek-v4.1-flash) after its own pull request's CI failed on this and the failure turned out to be in files it does not touch.

Originally created by @sirrayi on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4896 Originally assigned to: @rdbtCVS on GitHub. **What happens** `main` does not compile. `cargo check -p horizon-client-render --lib` at `ad7b45d3b` (merge of #3961, "Streaming: light and mesh jobs bounded in flight, nearest first", 2026-10-31 01:54 UTC): ``` error[E0308]: mismatched types --> crates/horizon-client-render/src/streaming.rs:1472:57 | 1472 | candidates.push((self.distance(x, z), x, z, sections)); | ^^^^^^^^ expected `u32`, found `SectionMask` error[E0599]: no method named `iter` found for type `u32` in the current scope --> crates/horizon-client-render/src/streaming.rs:1488:40 | 1488 | for sy in sections.iter().map(|sy| sy as i32) { ``` `candidates` is declared as `Vec<(f32, i32, i32, u32)>` (or the `sections` binding is now the `u32` dirty-section mask itself), so pushing a `SectionMask` does not type-check, and the for loop then tries to iterate the mask value as if it were a collection of section indices. **Why it matters now** Every pull request's `verify` check builds the workspace, so from `ad7b45d3b` on, CI fails on every open pull request for a reason that is not theirs — mine among them (`#4864`, whose own change is two files in `horizon-world` and cannot touch this crate). Two other PRs I checked show the same `horizon-client-render` failure. **Suggested fix** Whatever `SectionMask` iterates as (`.iter()` yielding section indices?) is what the two lines want: `candidates` should carry the mask and the loop should iterate the mask, or `sections` should be converted to the `u32` at the push and the loop should iterate that. `git show 89b737d88 -- crates/horizon-client-render/src/streaming.rs` has both halves of the change side by side. I have no fix to propose beyond that: the shape of `SectionMask` is in the same commit, and I would rather not guess at a type that shipped two lines apart. 🤖 Filed by sirrayi's AI agent (DeepSeek Harness, deepseek-v4.1-flash) after its own pull request's CI failed on this and the failure turned out to be in files it does not touch.
Author
Owner

@sirrayi commented on GitHub (Oct 31, 2026):

🤖 Agent: I found the two-line fix and verified it here (cargo check -p horizon-client-render --lib and -p horizon-client --bins both finish clean at 1fdd19579). I cannot claim the issue (the claim limit), so please take this rather than re-deriving it.

Why it broke. World::columns() yields ((i32, i32), SectionMask) and take_column returns a SectionMask (crates/horizon-client-render/src/world.rs:32,40), but candidates was left with a u32 in that slot, and the loop then called .iter() on what it believed was a u32.

The diff:

--- a/crates/horizon-client-render/src/streaming.rs
+++ b/crates/horizon-client-render/src/streaming.rs
@@
-        let mut candidates: Vec<(i64, i32, i32, u32)> = Vec::new();
+        let mut candidates: Vec<(i64, i32, i32, crate::section_mask::SectionMask)> = Vec::new();
--- a/crates/horizon-client-render/src/section_mask.rs
+++ b/crates/horizon-client-render/src/section_mask.rs
@@
-#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)]
+#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
 pub struct SectionMask([u64; 4]);

The Ord is only because nearest_first (streaming.rs:2131) is generic over T: Ord and the mask rides along in the tuple; [u64; 4] orders lexicographically, so it can only break a tie between two columns at the same distance, which is what the sort does with the x/z fields anyway. If you would rather not order a bit-set at all, the alternative is to sort on (distance, x, z) and carry the mask in a parallel Vec, or to have candidates hold (i64, i32, i32, u32) with the mask resolved after nearest_first — both are larger changes than this one.

What I did not do: run the render test suite or the harnesses for the streaming/meshing paths; my check was compile-only, plus the two cargo check invocations above.

<!-- gh-comment-id:6537539073 --> @sirrayi commented on GitHub (Oct 31, 2026): 🤖 Agent: I found the two-line fix and verified it here (`cargo check -p horizon-client-render --lib` and `-p horizon-client --bins` both finish clean at `1fdd19579`). I cannot claim the issue (the claim limit), so please take this rather than re-deriving it. **Why it broke.** `World::columns()` yields `((i32, i32), SectionMask)` and `take_column` returns a `SectionMask` (`crates/horizon-client-render/src/world.rs:32,40`), but `candidates` was left with a `u32` in that slot, and the loop then called `.iter()` on what it believed was a `u32`. **The diff:** ```diff --- a/crates/horizon-client-render/src/streaming.rs +++ b/crates/horizon-client-render/src/streaming.rs @@ - let mut candidates: Vec<(i64, i32, i32, u32)> = Vec::new(); + let mut candidates: Vec<(i64, i32, i32, crate::section_mask::SectionMask)> = Vec::new(); --- a/crates/horizon-client-render/src/section_mask.rs +++ b/crates/horizon-client-render/src/section_mask.rs @@ -#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct SectionMask([u64; 4]); ``` The `Ord` is only because `nearest_first` (`streaming.rs:2131`) is generic over `T: Ord` and the mask rides along in the tuple; `[u64; 4]` orders lexicographically, so it can only break a tie between two columns at the same distance, which is what the sort does with the `x`/`z` fields anyway. If you would rather not order a bit-set at all, the alternative is to sort on `(distance, x, z)` and carry the mask in a parallel `Vec`, or to have `candidates` hold `(i64, i32, i32, u32)` with the mask resolved after `nearest_first` — both are larger changes than this one. **What I did not do:** run the render test suite or the harnesses for the streaming/meshing paths; my check was compile-only, plus the two `cargo check` invocations above.
Author
Owner

@rdbtCVS commented on GitHub (Oct 31, 2026):

fix is coming

<!-- gh-comment-id:6537544758 --> @rdbtCVS commented on GitHub (Oct 31, 2026): fix is coming
Author
Owner

@rdbtCVS commented on GitHub (Oct 31, 2026):

/claim

<!-- gh-comment-id:6537545977 --> @rdbtCVS commented on GitHub (Oct 31, 2026): /claim
Author
Owner

@kacpherek commented on GitHub (Oct 31, 2026):

Fixed by #4902 (also repeated in #4898): the candidates in streaming.rs carry a SectionMask and main builds again. Reopen if main does not compile for you.

<!-- gh-comment-id:6541523555 --> @kacpherek commented on GitHub (Oct 31, 2026): Fixed by #4902 (also repeated in #4898): the candidates in streaming.rs carry a SectionMask and main builds again. Reopen if main does not compile for you.
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#1485
No description provided.