The port agent pointed out that forced_backdrop_necessity.rs collapsed
sprite_layer_key (a u16 read from the T8aD header, decoded) with
implied_layer_key (this crate's table of positions MEASURED in the running
game), and that 'has its own key' therefore reads as file-backed when it is
not. Splitting them is stronger than either of us stated:
read from the T8aD header: 0
implied (measured): 14 10x pfbase.tbm, 4x palogo_eff0.prm
nothing at all: 66 62 decided, 4 inert
Zero. There is no instance on the disc where a forced element also carries a
file-read layer key, so this rule has never been checked against a decoded
field -- there is no case where both can speak. That is what a keyless-element
fallback necessarily looks like, but it removes a check a reader would assume
exists.
Also corrects something I said to the port and had wrong. 'None of the 18 is
evidence for the rule in any direction' conflated two questions. Whether the
rule changes the composite: no, the sort already had the key. Whether the rule
gets the RIGHT answer: yes, and the 14 implied keys are measured positions, so
this is the rule agreeing with the oracle -- its only external corroboration,
and there are 14 instances of it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
72 lines
3.0 KiB
Rust
72 lines
3.0 KiB
Rust
//! Of the forced instances the rule merely CONFIRMS, how many have a key READ
|
|
//! FROM THE FILE, and how many an IMPLIED key that is itself a measurement?
|
|
//!
|
|
//! `forced_backdrop_necessity.rs` asked only whether an element had *a* key,
|
|
//! collapsing `sprite_layer_key` (a `u16` read out of the `T8aD` header — decoded)
|
|
//! with `implied_layer_key` (this crate's per-name table of positions **measured
|
|
//! in the running game**). For counting whether the rule moves anything that is
|
|
//! the right question. For describing what a confirmation is *made of*, it is not:
|
|
//! "the file already settles it" and "another measurement already settles it" are
|
|
//! different claims, and a reader who sees "own key" will take the first.
|
|
//!
|
|
//! Raised by the port agent 2026-08-30.
|
|
//!
|
|
//! cargo run -p sylpheed-formats --example forced_backdrop_key_source
|
|
|
|
use std::path::PathBuf;
|
|
|
|
use sylpheed_formats::{pak::PakArchive, ui_layout};
|
|
|
|
fn main() {
|
|
let root = PathBuf::from(std::env::var("SYLPHEED_DISC").expect("SYLPHEED_DISC"));
|
|
let mut paks: Vec<PathBuf> = std::fs::read_dir(root.join("dat"))
|
|
.expect("dat/")
|
|
.filter_map(|e| e.ok().map(|e| e.path()))
|
|
.filter(|p| p.extension().is_some_and(|x| x == "pak"))
|
|
.collect();
|
|
paks.sort();
|
|
|
|
let (mut read, mut implied, mut none) = (0usize, 0usize, 0usize);
|
|
println!("# archive entry element key_source key");
|
|
for pak in &paks {
|
|
let Ok(ar) = PakArchive::open(pak) else { continue };
|
|
let name = pak.file_name().unwrap().to_string_lossy().to_string();
|
|
for (i, e) in ar.entries().iter().enumerate() {
|
|
let Ok(by) = ar.read(e) else { continue };
|
|
let Some(b) = ui_layout::parse_build(&by) else {
|
|
continue;
|
|
};
|
|
for el in &b.elements {
|
|
if !ui_layout::forced_backdrop(&b, el) {
|
|
continue;
|
|
}
|
|
let (src, key) = match ui_layout::sprite_layer_key(&b, &by, el) {
|
|
Some(k) => {
|
|
read += 1;
|
|
("read_T8aD", Some(k))
|
|
}
|
|
None => match ui_layout::implied_layer_key(&el.name) {
|
|
Some(k) => {
|
|
implied += 1;
|
|
("implied_MEASURED", Some(k))
|
|
}
|
|
None => {
|
|
none += 1;
|
|
("none", None)
|
|
}
|
|
},
|
|
};
|
|
println!(
|
|
" {name} {i} {} {src} {}",
|
|
el.name,
|
|
key.map(|k| format!("0x{k:08X}")).unwrap_or("-".into())
|
|
);
|
|
}
|
|
}
|
|
}
|
|
println!("\n# forced instances by key source:");
|
|
println!("# read from the T8aD header (decoded): {read}");
|
|
println!("# implied — this crate's MEASURED name table: {implied}");
|
|
println!("# none — only forced_backdrop can speak: {none}");
|
|
}
|