fix(mesh): refine the anchor map before using it -- inconsistency 63 -> 51
Pass 1's anchor map contains exactly the mistakes the neighbourhood is meant to correct, so a resource sitting beside a mis-anchored neighbour inherits a bad reference. Re-anchoring against the improving map and repeating converges quickly: two rounds, and a third changes nothing (the loop exits early when a round is a fixpoint). before decoded 5480/6294 inconsistent 125 neighbourhood anchor decoded 5480/6294 inconsistent 63 + refining the map decoded 5480/6294 inconsistent 51 Coverage still unchanged. The 51 that remain cluster in _l (LOD) and _dead variants -- e001_l, e010_bdy_01_l, e106_eng_02_l, _rou_f302_base_dead, e303_base_dead and friends. A plausible reading is that a variant shares its base's vertex and index counts, making the two mutually confusable so that locality cannot separate them; recorded as untested rather than asserted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -653,7 +653,25 @@ impl Xbg7Model {
|
||||
let pass1: Vec<(Option<Xbg7Model>, Option<usize>)> =
|
||||
resources.iter().enumerate().map(run1).collect();
|
||||
|
||||
let vbs: Vec<Option<usize>> = pass1.iter().map(|(_, vb)| *vb).collect();
|
||||
let mut vbs: Vec<Option<usize>> = pass1.iter().map(|(_, vb)| *vb).collect();
|
||||
|
||||
// Refine the anchor map before using it: pass 1's anchors include the
|
||||
// very mistakes this is meant to correct, so a resource next to a
|
||||
// mis-anchored neighbour inherits a bad reference. Re-anchoring against
|
||||
// the improving map and repeating converges quickly; two rounds is
|
||||
// enough on this disc (a third changes nothing).
|
||||
for _ in 0..2 {
|
||||
let refined: Vec<Option<usize>> = (0..resources.len())
|
||||
.map(|i| match (need_pass1[i], neighbourhood(&vbs, i)) {
|
||||
(true, Some(anchor)) => decode_one_near(&resources[i], Some(anchor)).1.or(vbs[i]),
|
||||
_ => vbs[i],
|
||||
})
|
||||
.collect();
|
||||
if refined == vbs {
|
||||
break;
|
||||
}
|
||||
vbs = refined;
|
||||
}
|
||||
|
||||
// Pass 2 — re-anchor preferring the resource's own neighbourhood, which
|
||||
// is what separates its data from another resource's identically-shaped
|
||||
|
||||
@@ -53,7 +53,7 @@ fn span(m: &Xbg7Model) -> Option<[i64; 3]> {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "known-failing: 63 of 681 shared resources still decode inconsistently (was 125 before the neighbourhood anchor, 2026-08-12)"]
|
||||
#[ignore = "known-failing: 51 of 681 shared resources still decode inconsistently (125 before the neighbourhood anchor, 63 before refining it — 2026-08-12)"]
|
||||
fn shared_resources_decode_identically_in_every_container() {
|
||||
let Some(root) = disc_root() else {
|
||||
eprintln!("SKIP: extracted disc not found (set SYLPHEED_DISC to enable)");
|
||||
|
||||
Reference in New Issue
Block a user