Both agents left the language reading standing for the 37 pairs that differ without a button-count mismatch, and both observed that nothing rewarded closing it. Two scans closed it, against my own reading. All 39 equal-button-count pairs share button names and rows exactly, which does not settle it -- two dialogs sharing a button template look identical by that test. What differs does settle it: pzstg10 against pzstg02, pzstg11 against pzstg03, pzstg12 against pzstg13. These are the DLG_STAGE_TITLE01..16 dialogs and an adjacent pair carries two different stages, with different sprite counts, which is a different amount of text rather than a translation of the same text. So the whole 63 is explained by one fact -- adjacent entries are unrelated dialogs -- with no residue. The 2 identical pairs remain unexplained but are no longer anomalous against a hypothesis, because the hypothesis is gone. Recorded about process rather than the disc: a bound nobody is incentivised to test is exactly where a convenient claim survives, and the next reader cannot tell whether a bound was respected or merely never revisited. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
59 lines
2.4 KiB
Rust
59 lines
2.4 KiB
Rust
//! Are the 37 equal-button-count `GP_DIALOG` pairs language pairs, or not?
|
|
//!
|
|
//! 26 of 65 adjacent pairs differ in BUTTON COUNT — two languages cannot, so those
|
|
//! are unrelated dialogs. For the rest my language reading was left UNSUPPORTED
|
|
//! rather than refuted, and both agents observed that nothing rewards closing it.
|
|
//!
|
|
//! A language pair must share its BUTTON NAMES and ROWS exactly (a locale changes
|
|
//! glyphs, not layout) and differ only elsewhere. An unrelated pair will differ in
|
|
//! button names or rows too.
|
|
//!
|
|
//! CONTROL: entries 2/3 (identical element sets) must come out as "buttons match".
|
|
//!
|
|
//! cargo run -p sylpheed-formats --example dialog_pair_37
|
|
use sylpheed_formats::{pak::PakArchive, ui_layout};
|
|
use std::path::PathBuf;
|
|
|
|
fn sig(ar: &PakArchive, i: usize) -> Option<(Vec<(String, i32)>, usize)> {
|
|
let by = ar.read(&ar.entries()[i]).ok()?;
|
|
let b = ui_layout::parse_build(&by)?;
|
|
let mut v: Vec<(String, i32)> = b
|
|
.elements
|
|
.iter()
|
|
.filter(|e| e.name.contains("btn"))
|
|
.map(|e| (e.name.clone(), e.rest().map(|k| k.y).unwrap_or(e.pivot_y as i32)))
|
|
.collect();
|
|
v.sort();
|
|
let n = v.len();
|
|
Some((v, n))
|
|
}
|
|
|
|
fn main() {
|
|
let root = PathBuf::from(std::env::var("SYLPHEED_DISC").expect("SYLPHEED_DISC"));
|
|
let ar = PakArchive::open(root.join("dat/GP_DIALOG.pak")).expect("GP_DIALOG");
|
|
let n = ar.entries().len();
|
|
let (mut match_btn, mut differ_btn, mut ctrl) = (0, 0, false);
|
|
let mut examples = 0;
|
|
for k in (0..n).step_by(2) {
|
|
let (Some((a, na)), Some((b, nb))) = (sig(&ar, k), sig(&ar, k + 1)) else { continue };
|
|
if na != nb {
|
|
continue; // the 26 already settled
|
|
}
|
|
if a == b {
|
|
match_btn += 1;
|
|
if k == 2 { ctrl = true }
|
|
} else {
|
|
differ_btn += 1;
|
|
if examples < 5 {
|
|
println!(" entries {k:3}/{:<3} buttons DIFFER", k + 1);
|
|
println!(" {:?}", a.iter().map(|x| &x.0).collect::<Vec<_>>());
|
|
println!(" {:?}", b.iter().map(|x| &x.0).collect::<Vec<_>>());
|
|
examples += 1;
|
|
}
|
|
}
|
|
}
|
|
println!("\nequal-button-count pairs whose button NAMES+ROWS match : {match_btn}");
|
|
println!("equal-button-count pairs whose buttons DIFFER : {differ_btn}");
|
|
println!("control (entries 2/3 counted as matching): {}", if ctrl { "PASSED" } else { "FAILED" });
|
|
}
|