`cargo fmt --all -- --check` has failed on every run in this repository's history, identically on `main` and on every branch. This is #12. Mechanical: `cargo fmt --all`, nothing else. 154 files, all `.rs`, no other extension touched. `cargo check --workspace` exits 0 afterwards, so nothing changed semantically. ON THE ORDERING, WHICH WAS THE REAL QUESTION. HANDOFF-2026-09-06 section 7 warns this is the expensive fix: a whole-tree reformat before #7 and #8 return "would put a conflict in every file of 861 commits and make the reviews those items exist to enable unreadable". That is measurably too pessimistic, and it had been reasoned rather than tested. Measured here by three-way merging a rustfmt'd `main` against both unmerged branches, file by file: file/branch pairs tested 32 merges CLEAN 28 merges CONFLICTING 4 (8 conflict hunks total) sylpheed-cli/src/main.rs 1 hunk sylpheed-export/src/check.rs 1 sylpheed-export/src/screen.rs 4 sylpheed-export/src/video.rs 2 All four are against `auto/frame-blend-draw-path` only; `auto/port-p6-audio` does not conflict anywhere. The earlier framing -- 154 dirty files, 133 that cannot collide, 21 that can, the collision set carrying 147 of 774 hunks (19%) -- reproduces exactly. What it did not say is that most of the 21 still merge cleanly, because rustfmt's edits and the branches' edits rarely land on the same lines. So the cost of sweeping now is 4 files and 8 hunks for one branch, against a check that is otherwise red forever. Deliberately NOT folded into the WASM PR: 154 reformatted files would make that one unreviewable. Closes #12
59 lines
2.1 KiB
Rust
59 lines
2.1 KiB
Rust
//! Which XBG7 resources never decode, and how big is that population?
|
|
//!
|
|
//! Coverage has been reported as "resources decoded" without a denominator. This
|
|
//! prints both, per container and in total, and names the misses so the gate
|
|
//! attribution (`why_rejected`) has a work list.
|
|
use std::collections::HashSet;
|
|
use sylpheed_formats::mesh::{debug_resource_params, xbg7_resource_names, Xbg7Model};
|
|
|
|
fn main() {
|
|
let dir = std::env::args().nth(1).expect("resource3d dir");
|
|
let show = std::env::args().nth(2).is_some();
|
|
let mut files: Vec<_> = std::fs::read_dir(&dir)
|
|
.unwrap()
|
|
.flatten()
|
|
.map(|e| e.path())
|
|
.filter(|p| p.extension().and_then(|s| s.to_str()) == Some("xpr"))
|
|
.collect();
|
|
files.sort();
|
|
|
|
let (mut total, mut decoded, mut no_decl) = (0usize, 0usize, 0usize);
|
|
let mut misses: Vec<String> = Vec::new();
|
|
for f in &files {
|
|
let Ok(bytes) = std::fs::read(f) else {
|
|
continue;
|
|
};
|
|
let names = xbg7_resource_names(&bytes);
|
|
if names.is_empty() {
|
|
continue;
|
|
}
|
|
let got: HashSet<String> = Xbg7Model::anchor_models_cancellable(&bytes, 0.0, &|| false)
|
|
.into_iter()
|
|
.map(|m| m.name)
|
|
.collect();
|
|
for n in &names {
|
|
total += 1;
|
|
if got.contains(n) {
|
|
decoded += 1;
|
|
} else if debug_resource_params(&bytes, n).is_none() {
|
|
// No vertex declaration / no index markers: the anchor scan
|
|
// never even considers these, so they are a different question
|
|
// from "searched and not found".
|
|
no_decl += 1;
|
|
} else {
|
|
misses.push(format!("{}|{n}", f.file_name().unwrap().to_string_lossy()));
|
|
}
|
|
}
|
|
}
|
|
println!(
|
|
"XBG7 resources: {total} total, {decoded} decoded ({:.1}%), {no_decl} without a usable descriptor, {} searched-and-missed",
|
|
100.0 * decoded as f64 / total as f64,
|
|
misses.len()
|
|
);
|
|
if show {
|
|
for m in &misses {
|
|
println!("{m}");
|
|
}
|
|
}
|
|
}
|