Cleanup: remove unused helpers, imports and dead readers #326

Open
Coder629nx wants to merge 3 commits from Coder629nx/Darner:cleanup-dead into main
First-time contributor

Dead code only; 91 lines deleted (+4 / −91, 8 files). Helpers with no caller, plus four standalone harness sources. The review notes are covered: the module header links carry_over_with, and Shader / Attr are imported inside the Windows-only helper that uses them.

  • crates/darner-core/src/config.rs (−8): require_game_dir, a pub helper nothing in the tree calls.
  • crates/darner-core/src/renamed.rs (+2 / −7): carry_over, a wrapper around carry_over_with(true); the start (apps/darner/src/main.rs:615) calls carry_over_with directly. The doc above carry_over_with names that function. The module header now links carry_over_with instead of the deleted carry_over.
  • crates/darner-gpu/src/draw.rs (−6): skipped_all, an #[allow(dead_code)] reader of the SKIPPED counter; the counter itself stays and not_run keeps writing it.
  • crates/darner-shader/src/emit/mod.rs (+2 / −2): the test module no longer imports Attr and Shader for every target (a non-Windows build flags them unused). constant_color is #[cfg(windows)] and still calls Shader::new and Attr::NoUnwind, so those two imports sit inside that helper.
  • tools/native-dstorage-bridge/budget_harness.rs (−37): standalone budget/slot harness (fn main), not a crate target.
  • tools/native-dstorage-bridge/timeout_harness.rs (−22): standalone timeout/fallback harness.
  • tools/native-dstorage-bridge/missing_harness.rs (−8): standalone missing-bridge harness.
  • tools/native-dstorage-bridge/test_harness.rs (−1): a one-line #[path] include and no main.

That folder has no Cargo.toml. The bridge README still builds bridge.cpp and runs the darner-hle tests; those stay. Nothing was measured — nothing here is claimed to be faster. No DARNER_ default changes.

Dead code only; 91 lines deleted (+4 / −91, 8 files). Helpers with no caller, plus four standalone harness sources. The review notes are covered: the module header links `carry_over_with`, and `Shader` / `Attr` are imported inside the Windows-only helper that uses them. - `crates/darner-core/src/config.rs` (−8): `require_game_dir`, a pub helper nothing in the tree calls. - `crates/darner-core/src/renamed.rs` (+2 / −7): `carry_over`, a wrapper around `carry_over_with(true)`; the start (`apps/darner/src/main.rs:615`) calls `carry_over_with` directly. The doc above `carry_over_with` names that function. The module header now links `carry_over_with` instead of the deleted `carry_over`. - `crates/darner-gpu/src/draw.rs` (−6): `skipped_all`, an `#[allow(dead_code)]` reader of the SKIPPED counter; the counter itself stays and `not_run` keeps writing it. - `crates/darner-shader/src/emit/mod.rs` (+2 / −2): the test module no longer imports `Attr` and `Shader` for every target (a non-Windows build flags them unused). `constant_color` is `#[cfg(windows)]` and still calls `Shader::new` and `Attr::NoUnwind`, so those two imports sit inside that helper. - `tools/native-dstorage-bridge/budget_harness.rs` (−37): standalone budget/slot harness (`fn main`), not a crate target. - `tools/native-dstorage-bridge/timeout_harness.rs` (−22): standalone timeout/fallback harness. - `tools/native-dstorage-bridge/missing_harness.rs` (−8): standalone missing-bridge harness. - `tools/native-dstorage-bridge/test_harness.rs` (−1): a one-line `#[path]` include and no `main`. That folder has no `Cargo.toml`. The bridge README still builds `bridge.cpp` and runs the `darner-hle` tests; those stay. Nothing was measured — nothing here is claimed to be faster. No `DARNER_` default changes.
require_game_dir and carry_over had no callers anywhere in the tree
(the start calls carry_over_with directly); skipped_all, mask_bits and
two test imports had no callers or were flagged unused by the compiler.
No behavior change.
First-time contributor

Independent Windows build, gate, and code-read review of 6ebad446c (full head 6ebad446cbc2f4655d20fcd375bb382a6181e726, based on main f3840d73d3504c30218debfbc8795b9225447317). Not run in-game.

Environment

  • Windows 11 Pro 26H2 (build 26300.10075), Intel Core i9-14900K, NVIDIA RTX A2000 12GB (driver 621.47), Rust 1.98.1 (x86_64-pc-windows-msvc), MSVC 19.44.35230.

Measured results

  • Gate 1 (cargo clippy --workspace --all-targets --locked -- -D warnings): FAIL (exit 101; darner-shader test build cannot resolve Shader or Attr).
  • Gate 2 (cargo clippy --workspace --all-targets --all-features --locked -- -D warnings): FAIL (exit 101; same compile errors).
  • cargo xtask policy: PASS (asset policy: 551 files ok).
  • cargo test --locked -p darner-core: PASS (31 passed; 0 failed; 0 ignored; doc tests: 0).
  • cargo test --locked -p darner-shader --lib emit::tests::: FAIL during compilation before tests ran; Shader and Attr are unresolved.
  • cargo doc --locked -p darner-core --no-deps: completed, with one rustdoc::broken_intra_doc_links warning at crates/darner-core/src/renamed.rs:3.

Code-read audit

  • The test module's remaining imports at crates/darner-shader/src/emit/mod.rs:2392 omit Shader and Attr, but its Windows-gated constant_color still uses Shader::new(true) at line 3240 and Attr::NoUnwind at line 3261. Both workspace gates and the focused test fail with E0433 on this Windows target. Restore these imports (or scope them inside the helper) before merge.
  • The removed Config::require_game_dir has no in-tree call sites; the workspace is explicitly unpublished (Cargo.toml:12). The removed renamed::carry_over wrapper has no code callers; startup uses carry_over_with directly (apps/darner/src/main.rs:615, crates/darner-core/src/renamed.rs:41).
  • draw::skipped_all had no callers; SKIPPED remains and not_run still increments it for intentionally skipped pipelines (crates/darner-gpu/src/draw.rs:955-962).
  • Minor documentation note: the module header still links to the deleted carry_over at crates/darner-core/src/renamed.rs:3; cargo doc confirms the unresolved link warning. Update the link to carry_over_with or remove it.

Verdict: CHANGES NEEDED.

AI-assisted: yes (GitHub Copilot, Auto mode).

Independent Windows build, gate, and code-read review of `6ebad446c` (full head `6ebad446cbc2f4655d20fcd375bb382a6181e726`, based on `main` `f3840d73d3504c30218debfbc8795b9225447317`). Not run in-game. ### Environment - Windows 11 Pro 26H2 (build 26300.10075), Intel Core i9-14900K, NVIDIA RTX A2000 12GB (driver 621.47), Rust 1.98.1 (`x86_64-pc-windows-msvc`), MSVC 19.44.35230. ### Measured results - Gate 1 (`cargo clippy --workspace --all-targets --locked -- -D warnings`): **FAIL** (exit 101; `darner-shader` test build cannot resolve `Shader` or `Attr`). - Gate 2 (`cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`): **FAIL** (exit 101; same compile errors). - `cargo xtask policy`: **PASS** (`asset policy: 551 files ok`). - `cargo test --locked -p darner-core`: **PASS** (`31 passed; 0 failed; 0 ignored`; doc tests: 0). - `cargo test --locked -p darner-shader --lib emit::tests::`: **FAIL** during compilation before tests ran; `Shader` and `Attr` are unresolved. - `cargo doc --locked -p darner-core --no-deps`: completed, with one `rustdoc::broken_intra_doc_links` warning at `crates/darner-core/src/renamed.rs:3`. ### Code-read audit - The test module's remaining imports at `crates/darner-shader/src/emit/mod.rs:2392` omit `Shader` and `Attr`, but its Windows-gated `constant_color` still uses `Shader::new(true)` at line 3240 and `Attr::NoUnwind` at line 3261. Both workspace gates and the focused test fail with E0433 on this Windows target. Restore these imports (or scope them inside the helper) before merge. - The removed `Config::require_game_dir` has no in-tree call sites; the workspace is explicitly unpublished (`Cargo.toml:12`). The removed `renamed::carry_over` wrapper has no code callers; startup uses `carry_over_with` directly (`apps/darner/src/main.rs:615`, `crates/darner-core/src/renamed.rs:41`). - `draw::skipped_all` had no callers; `SKIPPED` remains and `not_run` still increments it for intentionally skipped pipelines (`crates/darner-gpu/src/draw.rs:955-962`). - **Minor documentation note:** the module header still links to the deleted `carry_over` at `crates/darner-core/src/renamed.rs:3`; `cargo doc` confirms the unresolved link warning. Update the link to `carry_over_with` or remove it. **Verdict: CHANGES NEEDED.** AI-assisted: yes (GitHub Copilot, Auto mode).
Author
First-time contributor

Ok

Ok
Coder629nx changed title from Cleanup: remove unused helpers, imports and dead readers to WIP: Cleanup: remove unused helpers, imports and dead readers 2026-12-04 15:31:20 +00:00
constant_color is Windows-only and still calls Shader::new and Attr::NoUnwind.
The imports sit in that helper, so a non-Windows test build does not flag them
unused. The module docs now link carry_over_with.
Author
First-time contributor

I fixed everything

I fixed everything
Coder629nx changed title from WIP: Cleanup: remove unused helpers, imports and dead readers to Cleanup: remove unused helpers, imports and dead readers 2026-12-04 17:56:55 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'cleanup-dead:Coder629nx-cleanup-dead'
git switch 'Coder629nx-cleanup-dead'

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 'Coder629nx-cleanup-dead'
git switch 'Coder629nx-cleanup-dead'
git rebase 'main'
git switch 'main'
git merge --ff-only 'Coder629nx-cleanup-dead'
git switch 'Coder629nx-cleanup-dead'
git rebase 'main'
git switch 'main'
git merge --no-ff 'Coder629nx-cleanup-dead'
git switch 'main'
git merge --squash 'Coder629nx-cleanup-dead'
git switch 'main'
git merge --ff-only 'Coder629nx-cleanup-dead'
git switch 'main'
git merge 'Coder629nx-cleanup-dead'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
TrustNo1/Darner!326
No description provided.