Turn five of the switched-off style lints back on #43

Open
github-bot wants to merge 1 commit from github-bot/gh-43 into main AGit
Owner

@⁠viktoschi on GitHub · 2026-11-24 20:49 UTC · original
viktoschi:tidy-small-lints → main · +12 −13 · 5 files · 1 commits · open

What this does

Five of the style lints the workspace switched off "until the newer code is
tidied" are back on. Six call sites did the work; no behaviour changes.

Lint Site Change
chunks_exact_to_as_chunks shadow.rs:857, :871 one half of the pair already used as_chunks::<8>(); the other half does now
chunks_exact_to_as_chunks pipeline/library.rs:772 as_chunks_mut::<4>()
implicit_saturating_sub shadow.rs:421 saturating_sub
sliced_string_as_bytes draw.rs:282 slice the byte view, not the string
manual_clamp, min_max indirect.rs:1034 see below

The interesting one

The window test expected

[groups, u32::from(groups > 0).max(1).min(1), 1, 0xAB00 + i]

.max(1).min(1) is always 1, so that assertion could not fail. Written as the
real value first, it did fail:

filled record 1, ahead true
left:  [0, 1, 1, 43777]
right: [0, 0, 1, 43777]

A slot that was copied carries 1 even when it has no groups — the flag
means "this record is filled", not "this record has work". The assertion is a
literal 1 now, with a comment saying exactly that, so the next person does
not read it as a group-count check.

collapsible_match stays off, and the comment now says why: collapsing the
Unordered arm in draw.rs into a match guard would skip the diagnostics
note_target call above it whenever the depth twin handles the write.

Checks

  • cargo clippy --workspace --all-targets --locked -- -D warnings — clean
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings — clean
  • cargo test --workspace --locked — 496 passed, 0 failed, 7 ignored (GPU tests on an RTX 3090)
  • cargo test --workspace --all-features --locked — green as well
  • pre-commit asset policy — 5 files ok
**@⁠viktoschi** on GitHub · 2026-11-24 20:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/43) `viktoschi:tidy-small-lints` → `main` · +12 −13 · 5 files · 1 commits · open ## What this does Five of the style lints the workspace switched off "until the newer code is tidied" are back on. Six call sites did the work; no behaviour changes. | Lint | Site | Change | | --- | --- | --- | | `chunks_exact_to_as_chunks` | `shadow.rs:857`, `:871` | one half of the pair already used `as_chunks::<8>()`; the other half does now | | `chunks_exact_to_as_chunks` | `pipeline/library.rs:772` | `as_chunks_mut::<4>()` | | `implicit_saturating_sub` | `shadow.rs:421` | `saturating_sub` | | `sliced_string_as_bytes` | `draw.rs:282` | slice the byte view, not the string | | `manual_clamp`, `min_max` | `indirect.rs:1034` | see below | ### The interesting one The window test expected ```rust [groups, u32::from(groups > 0).max(1).min(1), 1, 0xAB00 + i] ``` `.max(1).min(1)` is always 1, so that assertion could not fail. Written as the real value first, it did fail: ``` filled record 1, ahead true left: [0, 1, 1, 43777] right: [0, 0, 1, 43777] ``` A slot that was copied carries **1 even when it has no groups** — the flag means "this record is filled", not "this record has work". The assertion is a literal `1` now, with a comment saying exactly that, so the next person does not read it as a group-count check. `collapsible_match` stays off, and the comment now says why: collapsing the `Unordered` arm in `draw.rs` into a match guard would skip the diagnostics `note_target` call above it whenever the depth twin handles the write. ## Checks - `cargo clippy --workspace --all-targets --locked -- -D warnings` — clean - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` — clean - `cargo test --workspace --locked` — **496 passed, 0 failed, 7 ignored** (GPU tests on an RTX 3090) - `cargo test --workspace --all-features --locked` — green as well - pre-commit asset policy — 5 files ok
`chunks_exact_to_as_chunks`, `sliced_string_as_bytes`, `manual_clamp`,
`implicit_saturating_sub` and `min_max` were allowed "until the newer code is
tidied". Six sites did the work:

- `shadow.rs` compared one half of a pair with `chunks_exact(8)` while the
  other half already used `as_chunks::<8>()`; both halves do now.
- `library.rs` fills its test pattern through `as_chunks_mut::<4>()`.
- `shadow.rs`'s skew subtraction is `saturating_sub`.
- `draw.rs` slices the byte view instead of the string.
- `indirect.rs`'s window test expected `u32::from(groups > 0).max(1).min(1)`,
  which is always 1, so the assertion could not fail. It is a literal `1`
  now, and trying the real value first showed why: a slot that was copied
  carries 1 even with no groups (record 1, `groups = 0`, comes out `1`), as
  the shader writes it. The comment above the assertion says so.

`collapsible_match` stays off: collapsing the `Unordered` arm in `draw.rs`
into a match guard would skip the diagnostics `note_target` call above it
whenever the depth twin handles the write.

Clippy with `-D warnings` (also `--all-features`) is clean;
`cargo test --workspace --locked` is 496 passed, 7 ignored.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:06 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/shadow.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/43/head:github-bot/gh-43'
git switch 'github-bot/gh-43'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-43'
git switch 'github-bot/gh-43'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-43'
git switch 'github-bot/gh-43'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-43'
git switch 'main'
git merge --squash 'github-bot/gh-43'
git switch 'main'
git merge --ff-only 'github-bot/gh-43'
git switch 'main'
git merge 'github-bot/gh-43'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.