fix(mesh): raise the connectivity cap 0.28 -> 0.42 on runtime evidence

Swept against the 46 capture-named Stage_S02 buffers with distinct assignment in
place: 0.28 anchors 40 exactly and leaves 4 unclaimed; 0.42 anchors 45 and leaves
none; nothing above 0.42 improves further, so it is the least permissive value
that captures the whole gain. 589 more resources decode, nothing is lost. The
cross-container consistency proxy worsens (46 -> 62) -- it cannot see a
systematic mis-anchor, and where the two disagree the capture wins. Suite green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-12 03:25:50 +00:00
parent d83bdd3b68
commit 7f1ac41563
3 changed files with 63 additions and 24 deletions

View File

@@ -779,13 +779,19 @@ pub fn debug_find_index_buffer(bytes: &[u8], name: &str, vb: usize) -> Vec<(usiz
}
/// The connectivity cap: a searched block whose mean triangle edge exceeds this
/// fraction of its bounding-box diagonal is rejected. `0.28` is the shipped
/// value. A runtime capture names blocks the engine really draws, and one of them
/// (`e106_eng_02_l`, a 24-triangle LOD) measures **0.417** — so the cap has a
/// known false positive. `XBG7_EDGE_CAP` overrides it for calibration sweeps;
/// it is a diagnostic knob, not a setting (see docs/re/structures/xbg7-mesh.md).
/// fraction of its bounding-box diagonal is rejected.
///
/// **0.42 since 2026-08-12**, raised from 0.28 on runtime evidence. A capture
/// names the blocks the engine really draws, and the old cap rejected one of them
/// outright — `e106_eng_02_l`, a 24-triangle LOD, measures **0.417**, because a
/// coarse mesh's edges *are* a large fraction of its own size. Swept against the
/// 46 capture-named `Stage_S02` buffers (with distinct anchor assignment): 0.28
/// anchors 40 exactly and leaves 4 unclaimed, 0.42 anchors **45 and leaves none**,
/// and nothing above 0.42 improves further — so this is the least permissive
/// value that captures the whole measured gain. `XBG7_EDGE_CAP` overrides it (see
/// docs/re/structures/xbg7-mesh.md).
fn edge_cap() -> f32 {
std::env::var("XBG7_EDGE_CAP").ok().and_then(|v| v.parse().ok()).unwrap_or(0.28)
std::env::var("XBG7_EDGE_CAP").ok().and_then(|v| v.parse().ok()).unwrap_or(0.42)
}
/// Triangle count below which the looser [`small_cap`] applies. `0` (default)