CI green again: clippy clean in both builds, budget tests follow VICTORY_INDIRECT_REST

CI on main stopped at its first step (clippy, 40+ findings), so the
diagnostics clippy and the tests never ran. Locally all three steps of
.github/workflows/ci.yml now pass.

Tests: two indirect budget tests still assumed VICTORY_INDIRECT_REST on,
which 545f890 turned off by default.
- host_list_budget_starts_empty_at_each_submission: the big records now
  fill the budget exactly, so the small record after them runs empty with
  REST on or off and the test still shows that no budget carries over.
- warp_batch_charges_every_execution: the expected spend follows the REST
  rule in force (a job that does not fit takes nothing without REST).
Both pass with VICTORY_INDIRECT_REST unset and =1.

Clippy:
- mechanical: is_multiple_of, shift precedence, sort_by_key with Reverse,
  hex digit groups, contains_key, annotated transmutes, mem::take,
  from_ref, a same-type cast, an if with identical branches;
- host/indirects.rs and placed_filler_twins are only used by the
  diagnostics build and are only compiled there;
- removed the never-used `batched` in make_from and the never-read
  depth_written field; Touch::Title is only built by tests, marked so;
- book.rs: the heap that keeps the descriptor alive is a named field;
- ResourceDesc::from_level(&self) renamed levels_from;
- allowed with a reason: two 8-argument functions, the Late enum (boxing
  a flight would allocate per flight) and the CLI Command enum;
- apps/victory: default_paths moved above the test module; the match on
  a block in play.rs binds the block first.

No change in what the game runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 7331b07bde8d7beca973f24a0575ca1866d034d4)
This commit is contained in:
Togicx authored and trustno1-coder committed 2026-11-27 17:51:24 -08:00
1 parent 800dada337
commit 9b712a6ab2
31 files changed
+102 -72

No files matched your search

+16 -14
View File
@@ -192,6 +192,8 @@ struct Cli {
command: Command,
}
// Parsed once at start: the size of its largest variant does not matter.
#[allow(clippy::large_enum_variant)]
#[derive(Subcommand)]
enum Command {
/// Summarise one PE image: headers, sections, imports, TLS, build id.
@@ -575,6 +577,20 @@ fn show_config() -> Result<()> {
Ok(())
}
/// Paths given on the command line, or the configured game + test titles.
pub(crate) fn default_paths(paths: Vec<PathBuf>) -> Result<Vec<PathBuf>> {
if !paths.is_empty() {
return Ok(paths);
}
let cfg = victory_core::Config::load()?;
let all: Vec<PathBuf> = cfg.game_dir.into_iter().chain(cfg.test_titles).collect();
anyhow::ensure!(
!all.is_empty(),
"no paths given and none configured (see victory.example.toml)"
);
Ok(all)
}
#[cfg(test)]
mod tests {
/// A D3D12Core.dll's VS_FIXEDFILEINFO: signature, structure version, then
@@ -611,17 +627,3 @@ mod tests {
assert_eq!(super::exported_sdk_version(b"MZ"), None);
}
}
/// Paths given on the command line, or the configured game + test titles.
pub(crate) fn default_paths(paths: Vec<PathBuf>) -> Result<Vec<PathBuf>> {
if !paths.is_empty() {
return Ok(paths);
}
let cfg = victory_core::Config::load()?;
let all: Vec<PathBuf> = cfg.game_dir.into_iter().chain(cfg.test_titles).collect();
anyhow::ensure!(
!all.is_empty(),
"no paths given and none configured (see victory.example.toml)"
);
Ok(all)
}
+11 -11
View File
@@ -730,20 +730,20 @@ fn check_shader_model() -> Result<()> {
};
if yes {
match fetch_d3d12(&to) {
Ok(()) => match {
Ok(()) => {
// This process is yet to load Direct3D 12: it asks for the file now there.
crate::match_d3d12_core();
shader_model()
} {
Some(now) if now >= needed => {
println!("Shader model {}.{} with Microsoft's runtime. Starting the game.", now.0, now.1);
return Ok(());
match shader_model() {
Some(now) if now >= needed => {
println!("Shader model {}.{} with Microsoft's runtime. Starting the game.", now.0, now.1);
return Ok(());
}
now => {
let now = now.unwrap_or(found);
println!("With Microsoft's runtime the GPU still runs shader model {}.{}.", now.0, now.1);
}
}
now => {
let now = now.unwrap_or(found);
println!("With Microsoft's runtime the GPU still runs shader model {}.{}.", now.0, now.1);
}
},
}
Err(e) => println!("{e:#}"),
}
}
+1 -1
View File
@@ -105,7 +105,7 @@ pub fn run(jobs: Option<usize>, limit: Option<usize>, again: bool, used: bool, t
state.0.push(ms);
state.1 += usize::from(!there);
let count = state.0.len();
if count % 1000 == 0 {
if count.is_multiple_of(1000) {
println!("{count} of {}, {:.0} s", all.len(), began.elapsed().as_secs_f64());
}
drop(state);