Skip to content

Hotfix CI: collapsible_else_if + tooling-job Rust versions#9

Merged
avrabe merged 3 commits into
mainfrom
hotfix/ci-toolchain-and-clippy
May 19, 2026
Merged

Hotfix CI: collapsible_else_if + tooling-job Rust versions#9
avrabe merged 3 commits into
mainfrom
hotfix/ci-toolchain-and-clippy

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 19, 2026

Why this PR exists

PR #6 (foundation) just merged but CI on main failed on 4 of 5 jobs. This hotfix addresses three concrete root causes. The fourth (fuzz-smoke) had its log truncated by a GitHub API TLS hiccup at investigation time — keeping it on nightly and will diagnose separately if it still fails after this lands.

Fixes

1. wohl-leak/plain/src/engine.rsclippy::collapsible_else_if

Clippy on Rust 1.85.0 flagged a } else { if ... } else { ... } pattern at line 83 that clippy 1.95 (my local) doesn't fire. The fix is to use early-return style instead of nested else. Logic is identical.

2. kani job: Rust toolchain 1.85.0 → stable

```
error: rustc 1.85.0 is not supported by the following package:
home@0.5.12 requires rustc 1.88
```

`kani-verifier@0.67`'s transitive dep home needs Rust 1.88+. Kani itself uses an internal nightly for proofs; the outer toolchain only needs to build the installer.

3. rivet-validate job: Rust toolchain 1.85.0 → stable

```
error: rustc 1.85.0 is not supported by the following packages:
darling@0.23.0 requires rustc 1.88.0
rivet-cli@0.10.1 requires rustc 1.89
```

MSRV doesn't apply to tooling. Keep `lint` and `test` jobs on 1.85.0 to verify project MSRV.

Why local missed the collapsible_else_if

My local toolchain (clippy 1.95) doesn't fire `collapsible_else_if` on this pattern; clippy 1.85 (which CI runs) does. Installed Rust 1.85.0 locally to match CI's lint job exactly. Repro now reproducible:

Verification (local, +1.85.0 matching CI)

Check Result
`cargo +1.85.0 clippy --workspace --all-targets -- -D warnings` clean
`cargo +1.85.0 fmt -p --check` × 8 members clean
`cargo +1.85.0 test --workspace --all-features` pass
YAML parse OK

CI on this PR will be the real test for Kani install + fuzz + rivet-cli build.

Out of scope

🤖 Generated with Claude Code

avrabe and others added 3 commits May 19, 2026 19:02
PR #6's CI failed on first run after merge. Three concrete fixes:

1. `wohl-leak/plain/src/engine.rs`: clippy 1.85 catches collapsible_else_if
   in the wet/dry branch. Refactored to early-return style — same logic,
   no nested else. (My local clippy 1.95 didn't fire the lint, which is
   why the merge slipped through. Now verified with `cargo +1.85.0
   clippy` to match CI.)

2. `kani` job toolchain: 1.85.0 → stable. kani-verifier 0.67's
   transitive dep `home@0.5.12` requires rustc 1.88+. Kani itself uses
   its own internal nightly for the proofs; the outer toolchain only
   needs to build the installer.

3. `rivet-validate` job toolchain: 1.85.0 → stable. rivet-cli 0.10.1
   declares rust-version 1.89 (darling 0.23, smol_str 0.3.6, rivet-core
   0.10.1 all need 1.88-1.89). MSRV doesn't apply to tooling.

`lint` and `test` jobs keep 1.85.0 — that's the project MSRV and we
want CI to verify the project still builds against it.

`fuzz-smoke` job kept on `nightly` — log was unretrievable due to
GitHub API TLS hiccups; if it still fails, separate follow-up.

Verification (local, +1.85.0 toolchain matching CI's lint/test):
  - cargo +1.85.0 clippy --workspace --all-targets -- -D warnings: clean
  - cargo +1.85.0 fmt -p <each> --check: clean for all 8 members
  - cargo +1.85.0 test --workspace: pass
  - YAML parse: OK

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cargo install --locked cargo-fuzz pins cargo-fuzz 0.13.1's Cargo.lock,
which pins rustix 0.36.5. That old rustix uses unstable rustc_attrs:

    #[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_start(0xf001))]

Current nightly compilers don't accept this without `--cfg=rustc_attrs`,
so the install step fails with:

    error: cannot find attribute `rustc_layout_scalar_valid_range_start`
           in this scope

Removing --locked lets cargo resolve rustix to a newer version that
compiles cleanly. Mild reproducibility cost (no Cargo.lock pin for the
fuzz tool install), but the alternative is having no fuzz job at all.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cargo-fuzz on wohl-temp panicked at engine.rs:106 because
`zone_id * 2` overflows for zone_id > u32::MAX / 2. Same pattern in
wohl-air (`zone_id * 6` at engine.rs:120, 151).

Kani's `verify_no_panic` harnesses on these crates have
`kani::assume(zone_id < 100)`, so they only proved no-panic for small
zone_ids. Fuzz exposed the unproven range — exactly what fuzz is for.

Fix: `.saturating_mul(N)` and `.saturating_add(1)` so adversarial u32
zone_ids cannot panic. Since MAX_ZONES is 32 (16 for air), real
zone_ids cannot reach the saturation point — the collision bucket only
affects pathological inputs.

Verified:
  - cargo +1.85.0 clippy: clean
  - cargo +1.85.0 fmt -p wohl-{temp,air}: clean
  - cargo test -p wohl-temp -p wohl-air: pass
  - cargo +nightly fuzz run fuzz_temp -- -max_total_time=15: 863k runs,
    no crash (previously panicked within seconds)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 0e82cf5 into main May 19, 2026
5 checks passed
@avrabe avrabe deleted the hotfix/ci-toolchain-and-clippy branch May 19, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant