`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
84 lines
2.8 KiB
Rust
84 lines
2.8 KiB
Rust
//! Does a shared resupply voice bank hold ONE line or SEVERAL takes?
|
|
//!
|
|
//! This decides whether the `samples/movie` lower bound on the sample rate is
|
|
//! real. The test is static and does not need audio judgement: the movies that
|
|
//! share a bank each have their OWN subtitle table. If those texts are identical
|
|
//! the bank plausibly holds one generic line; if they differ, one bank is
|
|
//! serving several distinct spoken lines.
|
|
use std::collections::BTreeMap;
|
|
|
|
use sylpheed_formats::{movie_subtitle, PakArchive};
|
|
|
|
fn main() {
|
|
let disc = std::env::var("SYLPHEED_DISC").expect("set SYLPHEED_DISC");
|
|
let lang = PakArchive::open(format!("{disc}/dat/movie/eng.pak")).expect("eng.pak");
|
|
let text = PakArchive::open(format!("{disc}/dat/GP_MAIN_GAME_E.pak")).expect("text pak");
|
|
let demo_text = movie_subtitle::build_demo_text(&text);
|
|
|
|
// bank → the movies bound to it, from the record table (see movie-subtitle-link).
|
|
let banks: BTreeMap<&str, Vec<&str>> = BTreeMap::from([
|
|
(
|
|
"VOICE_D_450",
|
|
vec!["hokyu_LS_s02A", "hokyu_LS_s03A", "hokyu_LS_s06A"],
|
|
),
|
|
(
|
|
"VOICE_D_451",
|
|
vec![
|
|
"hokyu_LS_s09A",
|
|
"hokyu_LS_s11A",
|
|
"hokyu_LS_s15A",
|
|
"hokyu_LS_s24A",
|
|
"hokyu_LS_s27A",
|
|
],
|
|
),
|
|
(
|
|
"VOICE_D_452",
|
|
vec![
|
|
"hokyu_DS_s02A",
|
|
"hokyu_DS_s07A",
|
|
"hokyu_DS_s08A",
|
|
"hokyu_DS_s13A",
|
|
],
|
|
),
|
|
(
|
|
"VOICE_D_453",
|
|
vec![
|
|
"hokyu_LS_s02H",
|
|
"hokyu_LS_s03H",
|
|
"hokyu_LS_s06H",
|
|
"hokyu_LS_s09H",
|
|
],
|
|
),
|
|
("VOICE_D_454", vec!["hokyu_DS_s07H", "hokyu_DS_s14H"]),
|
|
]);
|
|
|
|
for (bank, movies) in &banks {
|
|
println!("\n== {bank}");
|
|
let mut seen: BTreeMap<String, Vec<&str>> = BTreeMap::new();
|
|
for m in movies {
|
|
let cues = movie_subtitle::track_voice_cues(&lang, m);
|
|
let mut line = String::new();
|
|
for (demo, t) in &cues {
|
|
let txt = demo_text
|
|
.get(demo)
|
|
.map(|v| v.join(" "))
|
|
.unwrap_or_else(|| format!("<demo {demo}>"));
|
|
line.push_str(&format!("[{t:.2}] {txt} "));
|
|
}
|
|
if line.is_empty() {
|
|
line.push_str("<no cues>");
|
|
}
|
|
seen.entry(line.trim().to_string()).or_default().push(m);
|
|
}
|
|
for (line, ms) in &seen {
|
|
println!(" {:?}", ms);
|
|
println!(" {line}");
|
|
}
|
|
println!(
|
|
" -> {} distinct subtitle text(s) across {} movies",
|
|
seen.len(),
|
|
movies.len()
|
|
);
|
|
}
|
|
}
|