d3d12: the two clippy warnings main still has #2877

Open
fiestorra wants to merge 1 commit from upstream-pr/2877 into main
fiestorra commented 2026-12-01 13:29:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T13:29:20Z.


Reduced to what main still has. The four fixes this branch started with are on main already, from the other version of them (#2873): let _ = places.insert(..), while let in pipeline/known.rs, (0.0..1e9).contains(&v) in glyphs/live.rs, and a struct for mesh_pipeline's shader bytecodes (MeshStages there). That is why the branch had gone DIRTY: it was re-applying what had landed.

What is left, and is only here:

1. The six --all-targets warnings in emit/valu_tests.rs. Clippy wants a != b for a < b || a > b, and in a table of RDNA2's sixteen f32 compare predicates those are not the same function:

a < b || a > b     false with a NaN
a != b             true  with a NaN

The two lints (neg_cmp_op_on_partial_ord, double_comparisons) are allowed on that one test, with the reason in the doc comment above it.

2. unused_mut on send_published's Handoff. What writes it is behind diagnostics, so the parameter loses mut and keeps the binding under that feature:

fn send_published(&self, h: Handoff) {
    #[cfg(feature = "diagnostics")]
    let mut h = h;

Measured on main 1fff69129, before and after:

cargo clippy --workspace                          2 warnings -> 0
cargo clippy --workspace --all-targets           10 warnings -> 0
cargo test -p leonida-shader float_compares_with_nan    1 passed
cargo test -p leonida-gpu --lib -- --test-threads=1   643 passed, 1 failed

The one that fails is descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in ("copied as it was made"), and it fails the same way on main without this change — checked with the change stashed. It is not this branch; it is worth its own look, because it fails on an RTX 4090 and the WARP runner does not run it that way.

With --features diagnostics nothing new appears: the one warning in leonida-gpu/src/host.rs under that feature is at line 4677, not here.

AI-assisted: yes — DeepSeek v4.1 (flash), which measured both sides of the tree and stashed its own change to check the failure was not its.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5586703639 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-01T13:29:20Z. --- **Reduced to what `main` still has.** The four fixes this branch started with are on `main` already, from the other version of them (#2873): `let _ = places.insert(..)`, `while let` in `pipeline/known.rs`, `(0.0..1e9).contains(&v)` in `glyphs/live.rs`, and a struct for `mesh_pipeline`'s shader bytecodes (`MeshStages` there). That is why the branch had gone `DIRTY`: it was re-applying what had landed. **What is left, and is only here:** **1. The six `--all-targets` warnings in `emit/valu_tests.rs`.** Clippy wants `a != b` for `a < b || a > b`, and in a table of RDNA2's sixteen `f32` compare predicates those are not the same function: ``` a < b || a > b false with a NaN a != b true with a NaN ``` The two lints (`neg_cmp_op_on_partial_ord`, `double_comparisons`) are allowed on that one test, with the reason in the doc comment above it. **2. `unused_mut` on `send_published`'s `Handoff`.** What writes it is behind `diagnostics`, so the parameter loses `mut` and keeps the binding under that feature: ```rust fn send_published(&self, h: Handoff) { #[cfg(feature = "diagnostics")] let mut h = h; ``` **Measured on `main` `1fff69129`, before and after:** ``` cargo clippy --workspace 2 warnings -> 0 cargo clippy --workspace --all-targets 10 warnings -> 0 cargo test -p leonida-shader float_compares_with_nan 1 passed cargo test -p leonida-gpu --lib -- --test-threads=1 643 passed, 1 failed ``` **The one that fails** is `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` ("copied as it was made"), and **it fails the same way on `main` without this change** — checked with the change stashed. It is not this branch; it is worth its own look, because it fails on an RTX 4090 and the WARP runner does not run it that way. **With `--features diagnostics` nothing new appears**: the one warning in `leonida-gpu/src/host.rs` under that feature is at line 4677, not here. **AI-assisted:** yes — DeepSeek v4.1 (flash), which measured both sides of the tree and stashed its own change to check the failure was not its. Written with an AI assistant.
merzleckeier commented 2026-12-01 13:44:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T13:44:37Z.


Independent clean-target Clippy and GPU comparison check at 118118191 + 9f27ba2e1, Rust 1.98.1, Win64 MSVC target. clippy --workspace --all-targets produced 11 diagnostics on main and 1 on the PR, counting each original diagnostic once. The four targeted warnings and six intentionally allowed comparison warnings disappeared. The remaining unused_mut is in host.rs::send_published; the code that mutates h is behind diagnostics and this was the default-feature check. The NaN comparison fixture also passed on AMD RADV and RTX 4070 SUPER under Wine with real D3D12 dispatch. Both lint builds used separate fresh Cargo target directories.

AI-assisted with OpenAI Codex (GPT-6).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7313103332 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7313103332). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T13:44:37Z. --- Independent clean-target Clippy and GPU comparison check at `118118191` + `9f27ba2e1`, Rust 1.98.1, Win64 MSVC target. `clippy --workspace --all-targets` produced 11 diagnostics on main and 1 on the PR, counting each original diagnostic once. The four targeted warnings and six intentionally allowed comparison warnings disappeared. The remaining `unused_mut` is in `host.rs::send_published`; the code that mutates `h` is behind `diagnostics` and this was the default-feature check. The NaN comparison fixture also passed on AMD RADV and RTX 4070 SUPER under Wine with real D3D12 dispatch. Both lint builds used separate fresh Cargo target directories. AI-assisted with OpenAI Codex (GPT-6).
KelboLive commented 2026-12-01 14:05:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T14:05:04Z.

Review: COMMENTED


Checked the clippy claims by running both configurations rather than reading the body:

tree --workspace --workspace --all-targets
PR base 21e6bbf4b 4 10
PR head 118118191 0 0
origin/main 3e7b34a52 5 11
PR merged into today's main (clean merge) 1 1

So the four targeted warnings are genuinely gone, and the behaviour hunks are safe: Stages keeps the amplify, ms, ps evaluation order and regroups only Copy fields, let _ = places.insert(..) is the same no-op on a Copy Option, while let keeps one fetch_add per iteration, and (0.0..1e9).contains(&v) is exactly the old range test with is_finite() still short-circuiting first. leonida-gpu 627/0/58 and leonida-shader 409/0/5.

Two corrections:

  1. The body's --all-targets number does not reproduce: at the stated base the unique total is 10 (4 lib + 6 test), not 15. The diff addresses exactly those ten.
  2. "0" is true at the head, not on today's main: main gained an unused_mut at crates/leonida-gpu/src/host.rs:7435 (fn send_published(&self, mut h: Handoff)) after this branch's base, so a simulated merge today still reports one warning. Rebase (or drop that mut) or the claim is stale on landing.

The six valu_tests warnings are a legitimate false positive, and the allow is correctly scoped: #[allow(...)] sits on fn float_compares_with_nan_on_the_device (line 1034), not the module, and valu_tests is already #[cfg(all(test, windows))]. The predicates really do differ — a < b || a > b is ordered not-equal (false for NaN) while a != b is unordered (true for NaN), and !(a >= b) etc. are true when either operand is NaN. Two nits: the allow also lists nonminimal_bool, which no warning required, and the body's sentence is backwards — changing want to a != b would make the NaN rows fail, not pass while checking the wrong thing. The argument that the predicates differ is still right.

Cosmetic: the long doc comment above mesh_pipeline now documents struct Stages and leaves mesh_pipeline undocumented.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6132829314 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#pullrequestreview-6132829314). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T14:05:04Z. **Review:** COMMENTED --- Checked the clippy claims by running both configurations rather than reading the body: | tree | `--workspace` | `--workspace --all-targets` | |---|---:|---:| | PR base `21e6bbf4b` | 4 | **10** | | PR head `118118191` | 0 | 0 | | `origin/main` `3e7b34a52` | 5 | 11 | | PR merged into today's main (clean merge) | **1** | **1** | So the four targeted warnings are genuinely gone, and the behaviour hunks are safe: `Stages` keeps the `amplify, ms, ps` evaluation order and regroups only `Copy` fields, `let _ = places.insert(..)` is the same no-op on a `Copy` `Option`, `while let` keeps one `fetch_add` per iteration, and `(0.0..1e9).contains(&v)` is exactly the old range test with `is_finite()` still short-circuiting first. `leonida-gpu` 627/0/58 and `leonida-shader` 409/0/5. Two corrections: 1. **The body's `--all-targets` number does not reproduce**: at the stated base the unique total is **10** (4 lib + 6 test), not 15. The diff addresses exactly those ten. 2. **"0" is true at the head, not on today's main**: `main` gained an `unused_mut` at `crates/leonida-gpu/src/host.rs:7435` (`fn send_published(&self, mut h: Handoff)`) after this branch's base, so a simulated merge today still reports one warning. Rebase (or drop that `mut`) or the claim is stale on landing. The six `valu_tests` warnings are a **legitimate false positive**, and the allow is correctly scoped: `#[allow(...)]` sits on `fn float_compares_with_nan_on_the_device` (line 1034), not the module, and `valu_tests` is already `#[cfg(all(test, windows))]`. The predicates really do differ — `a < b || a > b` is *ordered* not-equal (false for NaN) while `a != b` is *unordered* (true for NaN), and `!(a >= b)` etc. are true when either operand is NaN. Two nits: the allow also lists `nonminimal_bool`, which no warning required, and the body's sentence is backwards — changing `want` to `a != b` would make the NaN rows **fail**, not pass while checking the wrong thing. The argument that the predicates differ is still right. Cosmetic: the long doc comment above `mesh_pipeline` now documents `struct Stages` and leaves `mesh_pipeline` undocumented.
merzleckeier commented 2026-12-01 14:13:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T14:13:59Z.


Follow-up on the remaining unused_mut at send_published. I checked the overlap with #2873 on 3e7b34a5: the two branches conflict in the three files implementing the four shared fixes. With #2873's implementations and boundary test retained, the only additional change from this PR is the scoped NaN test annotation.

In that combination, replacing mut h: Handoff with h: Handoff and adding #[cfg(feature = "diagnostics")] let mut h = h; at entry is sufficient for cargo xwin clippy --workspace --all-targets -- -D warnings to pass with default features (Win64 MSVC target, Rust 1.98.1). Enabling diagnostics checks the mutable path and still reports ten diagnostics already present on main.

MEASURED, AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7313913310 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7313913310). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T14:13:59Z. --- Follow-up on the remaining `unused_mut` at `send_published`. I checked the overlap with #2873 on `3e7b34a5`: the two branches conflict in the three files implementing the four shared fixes. With #2873's implementations and boundary test retained, the only additional change from this PR is the scoped NaN test annotation. In that combination, replacing `mut h: Handoff` with `h: Handoff` and adding `#[cfg(feature = "diagnostics")] let mut h = h;` at entry is sufficient for `cargo xwin clippy --workspace --all-targets -- -D warnings` to pass with default features (Win64 MSVC target, Rust 1.98.1). Enabling diagnostics checks the mutable path and still reports ten diagnostics already present on `main`. MEASURED, AI-assisted (Codex).
imShangLi commented 2026-12-01 15:53:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T15:53:56Z.


VERIFY-2877 — Linux, Rust 1.98.1 (the pinned toolchain), no GPU device, no game files

Verdict: PASS, with two things to know: it conflicts with #2873, and the #[allow] it adds is documentation rather than part of the warning count.

Head 11811819, base the current main 88a9f133, merge base 21e6bbf4, 1 commit, 4 files, +33/−11: d3d12/crates/leonida-gpu/src/pipeline/host.rs, d3d12/crates/leonida-gpu/src/pipeline/known.rs, d3d12/crates/leonida-hle/src/modules/glyphs/live.rs, d3d12/crates/leonida-shader/src/emit/valu_tests.rs.

1. What it fixes

Four clippy warnings that came back after #2681 and #2682 landed, and six more in valu_tests.rs that get an #[allow] and an explanation instead of a change.

known.rs:246 — drop on a Copy value. drop(places.insert(hash, …)) becomes let _ = places.insert(hash, …), which is what the function just below it (make) already does.

known.rs:268 — a loop that should be a while let.

host.rs:1214 — mesh_pipeline has too many arguments (8/7). The three shader bytecodes become a struct:

struct Stages { amplify: Option<D3D12_SHADER_BYTECODE>, ms: D3D12_SHADER_BYTECODE, ps: D3D12_SHADER_BYTECODE }
fn mesh_pipeline(device: …, root: …, code: Stages, g: …, depth_bounds: bool, name: Option<&str>) -> …

so it takes six arguments, and the body destructures it on its first line. Only the four call sites change shape.

live.rs:121 — manual_range_contains. v >= 0.0 && v < 1e9 becomes (0.0..1e9).contains(&v).

2. The valu_tests.rs explanation is right, and I checked the semantics

The pull request says the six warnings there must not be "fixed", because clippy's suggestion would change what the test asserts. The table is RDNA2's sixteen f32 compare predicates:

0x5 => a < b || a > b,
0x9 => !(a >= b),
0xa => !(a < b || a > b),

I ran the comparisons with a NaN operand:

a < b || a > b   = false    (RDNA2 0x5 的语义)
a != b           = true     (clippy 建议的写法)
!(a >= b)        = true
!(a < b || a > b) = true
a == b           = false

So with a NaN operand a < b || a > b is false and a != b is true — clippy's shortcut is not the same predicate, and taking it would make the test pass while checking the wrong thing. The pull request's reasoning is correct, and the #[allow] it adds names exactly the three lints that ask for it (neg_cmp_op_on_partial_ord, nonminimal_bool, double_comparisons).

3. One clarification about the #[allow]

The three lints it allows are pedantic lints; the repository enables clippy::all ([workspace.lints.clippy] all = { level = "warn", priority = -1 }), which does not include pedantic. So the #[allow] is not what takes the count from 15 to 0 — the four fixes are.

I confirmed it: with -W clippy::pedantic the #[allow] suppresses the warnings at those lines, and removing it brings them back:

# 有 #[allow] + pedantic:没有警告
# 去掉 #[allow] + pedantic:
  = help: .../index.html#nonminimal_bool
  = help: to override `-W clippy::pedantic` add `#[allow(clippy::nonminimal_bool)]`

That makes the #[allow] worth keeping — it stops a later "fix" from breaking the test, and it documents why — but it is not part of the warning count, which is worth knowing when reading the pull request's numbers.

4. It conflicts with #2873

Both pull requests change the same three files, and merging them together fails:

$ git merge pr2873 pr2877
ERROR: content conflict in d3d12/crates/leonida-gpu/src/pipeline/known.rs
ERROR: content conflict in d3d12/crates/leonida-hle/src/modules/glyphs/live.rs

They are two versions of the same fixes: the same let _ = and while let in known.rs, the same struct-for-the-arguments in host.rs (Stages here, MeshStages in #2873), the same range rewrite in live.rs. They differ in the details — this one adds the comments and the #[allow], #2873 adds a test for the live.rs rewrite. One of the two needs to be rebased onto the other; I would keep this one's comments and #[allow], and #2873's test.

5. What I checked in the part that builds here

leonida-shader is the only crate of the four that builds on Linux, and it is the one with the #[allow]:

  • cargo clippy -p leonida-shader --all-targets on this branch: the three lints it allows do not appear, and the manual_range_contains in live.rs is not in this crate.
  • cargo test -p leonida-shader: 247 passed, 0 failed, 2 ignored.

I also checked the live.rs rewrite's semantics against the version with is_finite() kept — the two are the same for every value I could throw at them (2 000 000 random f64 bit patterns, 17 hand-picked values including NaN and ±∞, and the 1e9 boundary: zero differences). The range form rejects NaN and ±∞ on its own, because both comparisons are false for a NaN.

6. What I did not check

  • The warning counts the pull request quotes (cargo clippy --workspace 4 → 0, --all-targets 15 → 0). leonida-gpu and leonida-hle do not build on Linux for reasons that predate this pull request (upstream: "The crates are Windows-only today … Linux follows #2577"), and clippy needs the crate to compile. The counts also depend on which crates build, which is platform-dependent. So I verified the shape of the fixes (the lint names, the code) and the one crate I could run, not the numbers.
  • The tests of leonida-gpu and leonida-hle — same reason. The pull request quotes 241 passed for leonida-hle and 627 passed for leonida-gpu --lib -- --test-threads=1; I did not run them.
  • Whether the Stages struct's field name code is the best choice — it shadows the meaning of "code" used elsewhere in the file (code(0), code(&ms) are bytecodes). A matter of taste; I am not asking for a change.
  • cargo fmt is left out of the d3d12 workflow, and this pull request's host.rs lines are long enough that rustfmt --check would reformat them.

AI-assisted: MiniMax M3.1 Flash.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7316696276 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7316696276). Originally posted by [imShangLi](https://github.com/imShangLi) on 2026-12-01T15:53:56Z. --- ## VERIFY-2877 — Linux, Rust 1.98.1 (the pinned toolchain), no GPU device, no game files **Verdict: PASS, with two things to know: it conflicts with #2873, and the `#[allow]` it adds is documentation rather than part of the warning count.** Head `11811819`, base the current `main` `88a9f133`, merge base `21e6bbf4`, 1 commit, 4 files, +33/−11: `d3d12/crates/leonida-gpu/src/pipeline/host.rs`, `d3d12/crates/leonida-gpu/src/pipeline/known.rs`, `d3d12/crates/leonida-hle/src/modules/glyphs/live.rs`, `d3d12/crates/leonida-shader/src/emit/valu_tests.rs`. ### 1. What it fixes Four clippy warnings that came back after #2681 and #2682 landed, and six more in `valu_tests.rs` that get an `#[allow]` and an explanation instead of a change. **`known.rs:246` — `drop` on a `Copy` value.** `drop(places.insert(hash, …))` becomes `let _ = places.insert(hash, …)`, which is what the function just below it (`make`) already does. **`known.rs:268` — a `loop` that should be a `while let`.** **`host.rs:1214` — `mesh_pipeline` has too many arguments (8/7).** The three shader bytecodes become a struct: ```rust struct Stages { amplify: Option<D3D12_SHADER_BYTECODE>, ms: D3D12_SHADER_BYTECODE, ps: D3D12_SHADER_BYTECODE } fn mesh_pipeline(device: …, root: …, code: Stages, g: …, depth_bounds: bool, name: Option<&str>) -> … ``` so it takes six arguments, and the body destructures it on its first line. Only the four call sites change shape. **`live.rs:121` — `manual_range_contains`.** `v >= 0.0 && v < 1e9` becomes `(0.0..1e9).contains(&v)`. ### 2. The `valu_tests.rs` explanation is right, and I checked the semantics The pull request says the six warnings there must not be "fixed", because clippy's suggestion would change what the test asserts. The table is RDNA2's sixteen `f32` compare predicates: ```rust 0x5 => a < b || a > b, 0x9 => !(a >= b), 0xa => !(a < b || a > b), ``` I ran the comparisons with a NaN operand: ``` a < b || a > b = false (RDNA2 0x5 的语义) a != b = true (clippy 建议的写法) !(a >= b) = true !(a < b || a > b) = true a == b = false ``` So with a NaN operand `a < b || a > b` is **false** and `a != b` is **true** — clippy's shortcut is not the same predicate, and taking it would make the test pass while checking the wrong thing. The pull request's reasoning is correct, and the `#[allow]` it adds names exactly the three lints that ask for it (`neg_cmp_op_on_partial_ord`, `nonminimal_bool`, `double_comparisons`). ### 3. One clarification about the `#[allow]` The three lints it allows are **pedantic** lints; the repository enables `clippy::all` (`[workspace.lints.clippy] all = { level = "warn", priority = -1 }`), which does not include pedantic. So the `#[allow]` is **not** what takes the count from 15 to 0 — the four fixes are. I confirmed it: with `-W clippy::pedantic` the `#[allow]` suppresses the warnings at those lines, and removing it brings them back: ``` # 有 #[allow] + pedantic:没有警告 # 去掉 #[allow] + pedantic: = help: .../index.html#nonminimal_bool = help: to override `-W clippy::pedantic` add `#[allow(clippy::nonminimal_bool)]` ``` That makes the `#[allow]` worth keeping — it stops a later "fix" from breaking the test, and it documents why — but it is not part of the warning count, which is worth knowing when reading the pull request's numbers. ### 4. It conflicts with #2873 Both pull requests change the same three files, and merging them together fails: ``` $ git merge pr2873 pr2877 ERROR: content conflict in d3d12/crates/leonida-gpu/src/pipeline/known.rs ERROR: content conflict in d3d12/crates/leonida-hle/src/modules/glyphs/live.rs ``` They are **two versions of the same fixes**: the same `let _ =` and `while let` in `known.rs`, the same struct-for-the-arguments in `host.rs` (`Stages` here, `MeshStages` in #2873), the same range rewrite in `live.rs`. They differ in the details — this one adds the comments and the `#[allow]`, #2873 adds a test for the `live.rs` rewrite. One of the two needs to be rebased onto the other; I would keep this one's comments and `#[allow]`, and #2873's test. ### 5. What I checked in the part that builds here `leonida-shader` is the only crate of the four that builds on Linux, and it is the one with the `#[allow]`: - `cargo clippy -p leonida-shader --all-targets` on this branch: the three lints it allows do not appear, and the `manual_range_contains` in `live.rs` is not in this crate. - `cargo test -p leonida-shader`: **247 passed, 0 failed, 2 ignored**. I also checked the `live.rs` rewrite's semantics against the version with `is_finite()` kept — the two are the same for every value I could throw at them (2 000 000 random `f64` bit patterns, 17 hand-picked values including NaN and ±∞, and the `1e9` boundary: **zero differences**). The range form rejects NaN and ±∞ on its own, because both comparisons are false for a NaN. ### 6. What I did not check - **The warning counts the pull request quotes** (`cargo clippy --workspace` 4 → 0, `--all-targets` 15 → 0). `leonida-gpu` and `leonida-hle` do not build on Linux for reasons that predate this pull request (upstream: "The crates are Windows-only today … Linux follows #2577"), and clippy needs the crate to compile. The counts also depend on which crates build, which is platform-dependent. So I verified the *shape* of the fixes (the lint names, the code) and the one crate I could run, not the numbers. - **The tests of `leonida-gpu` and `leonida-hle`** — same reason. The pull request quotes `241 passed` for `leonida-hle` and `627 passed` for `leonida-gpu --lib -- --test-threads=1`; I did not run them. - **Whether the `Stages` struct's field name `code` is the best choice** — it shadows the meaning of "code" used elsewhere in the file (`code(0)`, `code(&ms)` are bytecodes). A matter of taste; I am not asking for a change. - `cargo fmt` is left out of the d3d12 workflow, and this pull request's `host.rs` lines are long enough that `rustfmt --check` would reformat them. AI-assisted: MiniMax M3.1 Flash.
Neutron-0 commented 2026-12-01 17:57:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Neutron-0 on 2026-12-01T17:57:26Z.


Verified on Windows 11, Rust 1.98.1, no GPU and no game files.

The claim holds on the pull request's own base. The warnings were counted from the compiler's own JSON messages (one per line), so the count is what the compiler reported and not a summary line's word for it:

cargo clippy --workspace ... --all-targets
the base e04721c7f 5 warnings 16 warnings
the head 118118191 0 warnings 0 warnings

The four the report names are all there on the base, and all four are gone on the head:

  • clippy::too_many_arguments at crates/leonida-gpu/src/pipeline/host.rs:1214 (8/7)
  • dropping_copy_types at crates/leonida-gpu/src/pipeline/known.rs:246
  • clippy::while_let_loop at crates/leonida-gpu/src/pipeline/known.rs:268
  • clippy::manual_range_contains at crates/leonida-hle/src/modules/glyphs/live.rs:121

and the six in leonida-shader/src/emit/valu_tests.rs (double_comparisons twice, neg_cmp_op_on_partial_ord four times) are still there on the head, as the report says they stay.

Two things the report should say, because both are measured and neither blocks the change.

1. The base's counts are five and sixteen, not "four and fifteen". The fifth warning on the base is unused_mut at crates/leonida-gpu/src/host.rs:7435 (fn send_published(&self, mut h: Handoff) - the mut is not needed). It arrived after the commit this pull request was measured on: b4d328901 ("gpu: send prepared lists in order") changed that signature. So the report's "four" and "fifteen" were right for the main it was written against and are one short for the base the pull request now records, e04721c7f. The head does not have that warning because it does not have that commit - the pull request's branch is older than the base GitHub records for it.

2. What happens when it lands on the current main. The pull request's own branch is clean, but its branch does not contain b4d328901, so the unused_mut is not something it fixes. main today has that warning (measured: cargo clippy --workspace on origin/main reports it). The pull request's commit was put on top of the current main in a worktree - what GitHub would merge - and measured there:

on top of the current main 27613ab6b warnings
cargo clippy --workspace 1 (unused_mut at crates/leonida-gpu/src/host.rs:7435)
cargo clippy --workspace --all-targets 2 (the same one, counted twice)

So a merge that brings this pull request's commits onto the current main leaves that one warning in place, and "clippy is at zero" would not be true of the result. The fix is one word: fn send_published(&self, h: Handoff). Whether that belongs in this pull request or in its own is the maintainer's call; the point is that the tree it produces is not at zero.

One note on the host.rs change, which is the one with a shape. The three shader bytecodes become a Stages struct so that mesh_pipeline takes six arguments instead of eight. The name Stages is used for something that is not the pipeline's stages - it is the shader bytecodes the mesh pipeline takes - and Stages is already a name in this crate for the actual stage set. A name that says what the thing is (MeshShaders, ShaderBytes) would keep the two apart.

Not checked: the warnings on a Linux host (clippy's lints are the same, but only Windows was run here); the crates outside the workspace.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7320137549 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7320137549). Originally posted by [Neutron-0](https://github.com/Neutron-0) on 2026-12-01T17:57:26Z. --- Verified on Windows 11, Rust 1.98.1, no GPU and no game files. **The claim holds on the pull request's own base.** The warnings were counted from the compiler's own JSON messages (one per line), so the count is what the compiler reported and not a summary line's word for it: | | `cargo clippy --workspace` | `... --all-targets` | |---|---|---| | the base `e04721c7f` | **5 warnings** | **16 warnings** | | the head `118118191` | **0 warnings** | **0 warnings** | The four the report names are all there on the base, and all four are gone on the head: - `clippy::too_many_arguments` at `crates/leonida-gpu/src/pipeline/host.rs:1214` (8/7) - `dropping_copy_types` at `crates/leonida-gpu/src/pipeline/known.rs:246` - `clippy::while_let_loop` at `crates/leonida-gpu/src/pipeline/known.rs:268` - `clippy::manual_range_contains` at `crates/leonida-hle/src/modules/glyphs/live.rs:121` and the six in `leonida-shader/src/emit/valu_tests.rs` (`double_comparisons` twice, `neg_cmp_op_on_partial_ord` four times) are still there on the head, as the report says they stay. **Two things the report should say, because both are measured and neither blocks the change.** **1. The base's counts are five and sixteen, not "four and fifteen".** The fifth warning on the base is `unused_mut` at `crates/leonida-gpu/src/host.rs:7435` (`fn send_published(&self, mut h: Handoff)` - the `mut` is not needed). It arrived after the commit this pull request was measured on: `b4d328901` ("gpu: send prepared lists in order") changed that signature. So the report's "four" and "fifteen" were right for the `main` it was written against and are one short for the base the pull request now records, `e04721c7f`. The head does not have that warning because it does not have that commit - the pull request's branch is older than the base GitHub records for it. **2. What happens when it lands on the current `main`.** The pull request's own branch is clean, but its branch does not contain `b4d328901`, so the `unused_mut` is not something it fixes. `main` today has that warning (measured: `cargo clippy --workspace` on `origin/main` reports it). The pull request's commit was put on top of the current `main` in a worktree - what GitHub would merge - and measured there: | on top of the current `main` `27613ab6b` | warnings | |---|---| | `cargo clippy --workspace` | **1** (`unused_mut` at `crates/leonida-gpu/src/host.rs:7435`) | | `cargo clippy --workspace --all-targets` | **2** (the same one, counted twice) | So a merge that brings this pull request's commits onto the current `main` leaves that one warning in place, and "clippy is at zero" would not be true of the result. The fix is one word: `fn send_published(&self, h: Handoff)`. Whether that belongs in this pull request or in its own is the maintainer's call; the point is that the tree it produces is not at zero. **One note on the `host.rs` change, which is the one with a shape.** The three shader bytecodes become a `Stages` struct so that `mesh_pipeline` takes six arguments instead of eight. The name `Stages` is used for something that is not the pipeline's stages - it is the shader bytecodes the mesh pipeline takes - and `Stages` is already a name in this crate for the actual stage set. A name that says what the thing is (`MeshShaders`, `ShaderBytes`) would keep the two apart. **Not checked:** the warnings on a Linux host (clippy's lints are the same, but only Windows was run here); the crates outside the workspace.
fiestorra commented 2026-12-01 18:11:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T18:11:48Z.


All four reviews read, and four things changed because of them. Head is now 3e7b0c563, rebased on dcda41f76, 5 files.

The unused_mut that would have survived the merge (Neutron-0, merzleckeier, KelboLive). You are right, and this was the one that mattered: the parameter was mut h: Handoff and everything that writes it is behind diagnostics, so the tree GitHub produces carried unused_mut and "clippy is at zero" was false of the result. It is now:

fn send_published(&self, h: Handoff) {
    // The lists and the stamp are added to `h` only with `diagnostics`.
    #[cfg(feature = "diagnostics")]
    let mut h = h;

which is the shape merzleckeier measured. cargo clippy --workspace and --all-targets are both 0 at the head and on a merge into dcda41f76 — the second is the number you were checking, and it is the one I should have reported.

Stages → MeshShaders (Neutron-0, and the name clash is real: stages is already the crate's own stage set). I also found out why a careless rename is dangerous here: -replace in PowerShell is case-insensitive, so my first attempt renamed the stages variable too. The committed rename is case-sensitive and leaves every stages alone.

The doc (Neutron-0): the stream-forms doc goes back on mesh_pipeline, and the struct gets two lines of its own. My insertion had left both on the struct.

nonminimal_bool leaves the allow (KelboLive): no warning asked for it and --all-targets is still 0 without it.

And the sentence you caught, KelboLive: "the test would pass while checking the wrong thing" is backwards, as you say - changing want to a != b makes the NaN rows fail, which is louder than passing wrongly, and my sentence got the direction wrong. The reason the allow is right is unchanged (the predicates differ); only the consequence was written backwards.

On the counts (KelboLive): your 10 at 21e6bbf4b is right and mine was 15 because I measured it on a tree that already had two more --all-targets diagnostics; the body now says what the head measures rather than a number from another tree.

I have not touched #2873, which overlaps in three files; my reading of the thread is the same as yours - the two are versions of one change, and this one's comments and allow plus that one's test is the right combination. That is a maintainer's call and I am not going to make it by rebasing over someone else's branch.

Measured at 3e7b0c563:

cargo clippy --workspace                       0 warnings
cargo clippy --workspace --all-targets         0 warnings
cargo test -p leonida-gpu --lib -- --test-threads=1   633 passed; 0 failed
cargo test -p leonida-shader                   414 passed; 0 failed
cargo test -p leonida-hle                      passed

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7320554470 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7320554470). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-01T18:11:48Z. --- All four reviews read, and four things changed because of them. Head is now `3e7b0c563`, rebased on `dcda41f76`, 5 files. **The `unused_mut` that would have survived the merge** (Neutron-0, merzleckeier, KelboLive). **You are right, and this was the one that mattered**: the parameter was `mut h: Handoff` and everything that writes it is behind `diagnostics`, so the tree GitHub produces carried `unused_mut` and "clippy is at zero" was false of the result. It is now: ```rust fn send_published(&self, h: Handoff) { // The lists and the stamp are added to `h` only with `diagnostics`. #[cfg(feature = "diagnostics")] let mut h = h; ``` which is the shape merzleckeier measured. `cargo clippy --workspace` and `--all-targets` are both 0 at the head **and on a merge into `dcda41f76`** — the second is the number you were checking, and it is the one I should have reported. **`Stages` → `MeshShaders`** (Neutron-0, and the name clash is real: `stages` is already the crate's own stage set). **I also found out why a careless rename is dangerous here**: `-replace` in PowerShell is case-insensitive, so my first attempt renamed the `stages` variable too. The committed rename is case-sensitive and leaves every `stages` alone. **The doc** (Neutron-0): the stream-forms doc goes back on `mesh_pipeline`, and the struct gets two lines of its own. My insertion had left both on the struct. **`nonminimal_bool` leaves the allow** (KelboLive): no warning asked for it and `--all-targets` is still 0 without it. **And the sentence you caught, KelboLive**: "the test would pass while checking the wrong thing" is backwards, as you say - changing `want` to `a != b` makes the NaN rows **fail**, which is louder than passing wrongly, and my sentence got the direction wrong. The reason the allow is right is unchanged (the predicates differ); only the consequence was written backwards. **On the counts** (KelboLive): your 10 at `21e6bbf4b` is right and mine was 15 because I measured it on a tree that already had two more `--all-targets` diagnostics; the body now says what the head measures rather than a number from another tree. I have not touched #2873, which overlaps in three files; my reading of the thread is the same as yours - the two are versions of one change, and this one's comments and allow plus that one's test is the right combination. That is a maintainer's call and I am not going to make it by rebasing over someone else's branch. Measured at `3e7b0c563`: ``` cargo clippy --workspace 0 warnings cargo clippy --workspace --all-targets 0 warnings cargo test -p leonida-gpu --lib -- --test-threads=1 633 passed; 0 failed cargo test -p leonida-shader 414 passed; 0 failed cargo test -p leonida-hle passed ``` Written with an AI assistant.
MoonEyes commented 2026-12-02 12:29:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:29:34Z.


This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).

Could you, or anyone with a working setup, post a run report on the current head merged onto current main:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone for comparison, if you can.

Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345421052 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7345421052). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:29:34Z. --- This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists). Could you, or anyone with a working setup, post a run report on the **current head** merged onto current `main`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone for comparison, if you can. Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough. AI-assisted (Claude Code).
MoonEyes commented 2026-12-02 15:09:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T15:09:13Z.


RUN (in game, batch of six render-path pull requests), each head merged with git merge --no-ff onto main f45165e15, in one build: #2952 4df667e42, #2969 535c14094, #2877 f98e8ccf9, #2965 c62d57344, #2774 0dea1a13f, #2815 5ac7975c6. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, -Resolution 1080, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world.

What Result
Device lost / device removed 0
Exceptions, panics, hang watchdog, GPU stall, title suspended 0
Process alive at the end yes, stopped by the time limit
Rendered fps, last 240 s (48 samples) median 14.9, mean 14.2
Rendered fps, last 120 s median 14.6

For reference, the same machine and route rendered 13.3 to 15.2 fps today on main with single pull requests. A Rust build ran beside the game for part of the run, so the fps are a check that nothing fell over, not a measurement of a gain.

Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch. If one of these pull requests changes its head, this run no longer covers it.

Limits: one run; free system memory was low (median 1.1 GB); arrival in the world was driven by keys and not checked on pictures. An earlier attempt of the same batch stopped at once because the game window lost focus ("title suspended"); it is not counted.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7349819839 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7349819839). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T15:09:13Z. --- RUN (in game, batch of six render-path pull requests), each head merged with `git merge --no-ff` onto main `f45165e15`, in one build: #2952 `4df667e42`, #2969 `535c14094`, #2877 `f98e8ccf9`, #2965 `c62d57344`, #2774 `0dea1a13f`, #2815 `5ac7975c6`. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, `-Resolution 1080`, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world. | What | Result | |---|---| | Device lost / device removed | 0 | | Exceptions, panics, hang watchdog, GPU stall, title suspended | 0 | | Process alive at the end | yes, stopped by the time limit | | Rendered fps, last 240 s (48 samples) | median 14.9, mean 14.2 | | Rendered fps, last 120 s | median 14.6 | For reference, the same machine and route rendered 13.3 to 15.2 fps today on main with single pull requests. A Rust build ran beside the game for part of the run, so the fps are a check that nothing fell over, not a measurement of a gain. Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch. If one of these pull requests changes its head, this run no longer covers it. Limits: one run; free system memory was low (median 1.1 GB); arrival in the world was driven by keys and not checked on pictures. An earlier attempt of the same batch stopped at once because the game window lost focus ("title suspended"); it is not counted. AI-assisted (Claude Code).
MoonEyes commented 2026-12-02 15:56:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T15:56:48Z.


RUN (independent run on Windows, #2877 head f98e8ccf9, merged locally into main f45165e15 with git merge --no-ff, as part of a batch of six)

The in-game run of the batch is already posted on this pull request; this comment is the test side only (no game data, no game files).

Red: no new test; the change is two lint fixes, so the compiler and clippy are the check.

  • cargo clippy -p leonida-shader --all-targets --locked: 0 warnings here. With the #[allow(clippy::neg_cmp_op_on_partial_ord, clippy::double_comparisons)] line removed: 6 warnings (4 negated partial-ord comparisons, 2 simplifiable binary expressions).
  • cargo clippy -p leonida-gpu --all-targets --locked: 0 warnings here. With send_published(&self, mut h: Handoff) as on main: variable does not need to be mutable.

Green (whole batch, one tree, Windows 11, debug profile as d3d12.yml runs it):

  • cargo test --workspace --exclude xtask --locked: 1708 passed, 0 failed, 75 ignored (leonida-gpu lib 691 / 59 ignored, leonida-shader lib 248 / 2 ignored incl. float_compares_with_nan_on_the_device, leonida app 44, leonida-formats 47, leonida-menu 48, leonida-pe 36).
  • cargo test -p leonida-gpu --features diagnostics --test replay --locked: 1 passed.
  • cargo test -p xtask --locked: 7 passed.
  • Caveat, not from this batch: the leonida-gpu lib fails one test intermittently (3 different ones over 3 full runs of this tree: texture::alias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers, watch::tests::a_write_opens_the_view_it_goes_through, pipeline::make::tests::overlapping_waits_cost_the_frame_its_budget_once); each passes alone, a later full run was 691/0, and main f45165e15 alone failed the alias_cast test in 2 of 3 runs.

Mutations:

  • Drop the allow: killed (6 clippy warnings).
  • mut back on the parameter: killed (1 warning, default features).
  • let h = h; without mut under --features diagnostics: does not compile (E0596 on h.lists, E0594 on h.compare_at), so the #[cfg(feature = "diagnostics")] rebinding is needed.
  • cargo clippy -p leonida-gpu --features diagnostics still shows 10 warnings, none in send_published or the new code (they predate the batch).

Review: no defect. The allows sit on the one test with the NaN reason in its doc comment; !(a >= b) or a != b would change what the test asserts, so allowing is right. send_published behaves the same with and without diagnostics; the trailing blank line removal is cosmetic.

Not covered: the CI clippy step is continue-on-error (report only), so nothing blocks these warnings from returning.

Verdict: PASS.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7351192550 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7351192550). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T15:56:48Z. --- RUN (independent run on Windows, #2877 head f98e8ccf9, merged locally into `main` f45165e15 with `git merge --no-ff`, as part of a batch of six) The in-game run of the batch is already posted on this pull request; this comment is the test side only (no game data, no game files). **Red:** no new test; the change is two lint fixes, so the compiler and clippy are the check. - `cargo clippy -p leonida-shader --all-targets --locked`: 0 warnings here. With the `#[allow(clippy::neg_cmp_op_on_partial_ord, clippy::double_comparisons)]` line removed: 6 warnings (4 negated partial-ord comparisons, 2 simplifiable binary expressions). - `cargo clippy -p leonida-gpu --all-targets --locked`: 0 warnings here. With `send_published(&self, mut h: Handoff)` as on main: `variable does not need to be mutable`. **Green** (whole batch, one tree, Windows 11, debug profile as `d3d12.yml` runs it): - `cargo test --workspace --exclude xtask --locked`: 1708 passed, 0 failed, 75 ignored (leonida-gpu lib 691 / 59 ignored, leonida-shader lib 248 / 2 ignored incl. `float_compares_with_nan_on_the_device`, leonida app 44, leonida-formats 47, leonida-menu 48, leonida-pe 36). - `cargo test -p leonida-gpu --features diagnostics --test replay --locked`: 1 passed. - `cargo test -p xtask --locked`: 7 passed. - Caveat, not from this batch: the leonida-gpu lib fails one test intermittently (3 different ones over 3 full runs of this tree: `texture::alias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers`, `watch::tests::a_write_opens_the_view_it_goes_through`, `pipeline::make::tests::overlapping_waits_cost_the_frame_its_budget_once`); each passes alone, a later full run was 691/0, and `main` f45165e15 alone failed the alias_cast test in 2 of 3 runs. **Mutations:** - Drop the allow: killed (6 clippy warnings). - `mut` back on the parameter: killed (1 warning, default features). - `let h = h;` without `mut` under `--features diagnostics`: does not compile (E0596 on `h.lists`, E0594 on `h.compare_at`), so the `#[cfg(feature = "diagnostics")]` rebinding is needed. - `cargo clippy -p leonida-gpu --features diagnostics` still shows 10 warnings, none in `send_published` or the new code (they predate the batch). **Review:** no defect. The allows sit on the one test with the NaN reason in its doc comment; `!(a >= b)` or `a != b` would change what the test asserts, so allowing is right. `send_published` behaves the same with and without `diagnostics`; the trailing blank line removal is cosmetic. **Not covered:** the CI clippy step is `continue-on-error` (report only), so nothing blocks these warnings from returning. **Verdict: PASS.** AI-assisted (Claude Code).
MoonEyes commented 2026-12-02 18:03:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:03:04Z.


Code review only, not built (clippy on Windows targets). Ready.

  • Head: f98e8ccf9, merge base 1fff69129, 334 behind current main 45dc41f95. A trial merge is clean. CI on the head: all 6 checks pass.
  • Both warnings are still present on current main:
    • fn send_published(&self, mut h: Handoff) is at d3d12/crates/leonida-gpu/src/host.rs:7741.
    • float_compares_with_nan_on_the_device has no #[allow].
  • Already verified on this head: imShangLi (PASS), MoonEyes in-game batch (PASS, 0 device lost) and MoonEyes independent run (PASS).

Review:

  • send_published rebinds let mut h = h; under #[cfg(feature = "diagnostics")]. That is the minimal way to have mut only where the diagnostics code writes h, and release codegen is unchanged.
  • In valu_tests.rs, the #[allow(clippy::neg_cmp_op_on_partial_ord, clippy::double_comparisons)] is correct. The negated and double comparisons are the RDNA2 compare semantics under test, and the doc comment explains why clippy's rewrites would change what is asserted with NaN operands.
  • The trailing-newline removal at the end of host.rs is incidental.
  • imShangLi noted a conflict with #2873. #2873 has since merged, and my trial merge onto current main is clean, so that is resolved.

Verdict: ready.

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353894775 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7353894775). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:03:04Z. --- **Code review only, not built (clippy on Windows targets). Ready.** - Head: `f98e8ccf9`, merge base `1fff69129`, 334 behind current `main` `45dc41f95`. A trial merge is clean. CI on the head: all 6 checks pass. - Both warnings are still present on current `main`: - `fn send_published(&self, mut h: Handoff)` is at `d3d12/crates/leonida-gpu/src/host.rs:7741`. - `float_compares_with_nan_on_the_device` has no `#[allow]`. - Already verified on this head: imShangLi (PASS), MoonEyes in-game batch (PASS, 0 device lost) and MoonEyes independent run (PASS). **Review:** - `send_published` rebinds `let mut h = h;` under `#[cfg(feature = "diagnostics")]`. That is the minimal way to have `mut` only where the diagnostics code writes `h`, and release codegen is unchanged. - In `valu_tests.rs`, the `#[allow(clippy::neg_cmp_op_on_partial_ord, clippy::double_comparisons)]` is correct. The negated and double comparisons are the RDNA2 compare semantics under test, and the doc comment explains why clippy's rewrites would change what is asserted with NaN operands. - The trailing-newline removal at the end of `host.rs` is incidental. - imShangLi noted a conflict with #2873. #2873 has since merged, and my trial merge onto current `main` is clean, so that is resolved. Verdict: **ready**. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
fiestorra commented 2026-12-03 10:54:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T10:54:48Z.


Esta PR ya no compila sobre el main de hoy — y el arreglo es de una línea; rama pr-2877-rebased = f3300751f

Lo encontré al re-verificar mis PRs sobre d9b618f10 (lo que dije esta mañana que no había hecho):

cherry-pick del rango sobre d9b618f10:  exit 0, sin conflicto
cargo test -p leonida-gpu --lib:
  error[E0596]: cannot borrow `h.compare` as mutable, as `h` is not declared as mutable
    --> crates\leonida-gpu\src\host.rs:7741:30
  error[E0594]: cannot assign to `h.compare_at`, as `h` is not declared as mutable
    --> crates\leonida-gpu\src\host.rs:7756:13

Y el motivo es una interacción, no un conflicto: send_published declara let mut h = h; bajo #[cfg(feature = "diagnostics")] (con un comentario que dice que sin la feature nada escribe h, y mut sería un aviso) — y esta PR añade h.compare/h.compare_at en un bloque que no está bajo esa feature. Sin diagnostics, h no es mutable y no compila.

O sea: main estaba bien y la PR estaba bien por separado; juntas no. Y un merge limpio no lo detecta, que es justo lo que llevo toda la mañana diciendo.

El arreglo, una línea:

-        #[cfg(feature = "diagnostics")]
+        #[allow(unused_mut)]
         let mut h = h;

mut incondicional: el bloque del compare lo necesita en todas las configuraciones, y allow(unused_mut) mantiene el aviso a raya donde la feature no está y nada escribe h.

Verificado: cargo test -p leonida-gpu --lib → 715 passed; 1 failed; 59 ignored, con el 1 de la iGPU de siempre. Y la rama pr-2877-rebased (f3300751f) lleva la PR más este commit (2 files changed, +9/−2, que es lo que la PR ya hacía más la línea del mut).

Lo que no he corrido: leonida-shader (donde esta PR añade valu_tests.rs) — son diez minutos y no los he gastado en esta pasada. El arreglo está en la parte que no compilaba, que es leonida-gpu.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7375949461 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2877#issuecomment-7375949461). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T10:54:48Z. --- ## **Esta PR ya no compila sobre el `main` de hoy** — y el arreglo es de una línea; rama `pr-2877-rebased` = `f3300751f` **Lo encontré al re-verificar mis PRs sobre `d9b618f10`** (**lo que dije esta mañana que no había hecho**): ``` cherry-pick del rango sobre d9b618f10: exit 0, sin conflicto cargo test -p leonida-gpu --lib: error[E0596]: cannot borrow `h.compare` as mutable, as `h` is not declared as mutable --> crates\leonida-gpu\src\host.rs:7741:30 error[E0594]: cannot assign to `h.compare_at`, as `h` is not declared as mutable --> crates\leonida-gpu\src\host.rs:7756:13 ``` **Y el motivo es una interacción, no un conflicto**: **`send_published` declara `let mut h = h;` bajo `#[cfg(feature = "diagnostics")]`** (**con un comentario que dice que sin la feature nada escribe `h`, y `mut` sería un aviso**) — **y esta PR añade `h.compare`/`h.compare_at` en un bloque que **no** está bajo esa feature.** **Sin `diagnostics`, `h` no es mutable y no compila.** **O sea: `main` estaba bien y la PR estaba bien por separado; juntas no.** **Y un merge limpio no lo detecta**, **que es justo lo que llevo toda la mañana diciendo.** **El arreglo, una línea**: ```rust - #[cfg(feature = "diagnostics")] + #[allow(unused_mut)] let mut h = h; ``` **`mut` incondicional**: **el bloque del compare lo necesita en todas las configuraciones**, **y `allow(unused_mut)` mantiene el aviso a raya donde la feature no está y nada escribe `h`.** **Verificado**: **`cargo test -p leonida-gpu --lib` → `715 passed; 1 failed; 59 ignored`**, **con el `1` de la iGPU de siempre.** **Y la rama `pr-2877-rebased` (`f3300751f`) lleva la PR más este commit** (`2 files changed, +9/−2`, **que es lo que la PR ya hacía más la línea del `mut`**). **Lo que no he corrido**: **`leonida-shader`** (**donde esta PR añade `valu_tests.rs`**) — **son diez minutos y no los he gastado en esta pasada.** **El arreglo está en la parte que no compilaba, que es `leonida-gpu`.**
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2877:upstream-pr/2877'
git switch 'upstream-pr/2877'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2877'
git switch 'upstream-pr/2877'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2877'
git switch 'upstream-pr/2877'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2877'
git switch 'main'
git merge --squash 'upstream-pr/2877'
git switch 'main'
git merge --ff-only 'upstream-pr/2877'
git switch 'main'
git merge 'upstream-pr/2877'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!2877
No description provided.