Skip to content

Commit cc0316e

Browse files
committed
test: replace wedge self-capture goldens with structural invariants
Retire the support_regression_wedge golden pair and its comparator (support_golden_regression_wedge_tdd.rs); packet 213's lone-node emission showed a self-capture can be re-blessed past a real regression. New invariants in support_invariants_wedge_tdd.rs pin contiguity, per-layer step bound, width monotonicity, mesh-bbox containment and byte determinism. Amends TASK-163b-orca-ref tracking in docs/07_implementation_status.md.
1 parent e08dfe9 commit cc0316e

7 files changed

Lines changed: 374 additions & 569 deletions

File tree

crates/slicer-runtime/tests/common/support_wedge.rs

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::collections::HashMap;
44
use std::path::PathBuf;
55
use std::sync::Arc;
66

7-
use slicer_ir::{ConfigValue, SupportPlanIR};
7+
use slicer_ir::ConfigValue;
88
use slicer_runtime::run::PrepassContext;
99

1010
fn workspace_root() -> PathBuf {
@@ -73,89 +73,3 @@ pub fn prepare_wedge_context_with_overrides(
7373

7474
ctx
7575
}
76-
77-
pub fn branch_segment_count(plan: &SupportPlanIR) -> usize {
78-
plan.entries.iter().map(|e| e.branch_segments.len()).sum()
79-
}
80-
81-
pub fn branch_endpoints(plan: &SupportPlanIR) -> Vec<[f32; 3]> {
82-
let mut endpoints: Vec<[f32; 3]> = plan
83-
.entries
84-
.iter()
85-
.flat_map(|entry| {
86-
entry.branch_segments.iter().flat_map(|seg| {
87-
let first = seg
88-
.points
89-
.first()
90-
.expect("branch segment must have at least one point");
91-
let last = seg
92-
.points
93-
.last()
94-
.expect("branch segment must have at least one point");
95-
[[first.x, first.y, first.z], [last.x, last.y, last.z]]
96-
})
97-
})
98-
.collect();
99-
endpoints.sort_by(|a, b| {
100-
a[0].partial_cmp(&b[0])
101-
.unwrap_or(std::cmp::Ordering::Equal)
102-
.then_with(|| a[1].partial_cmp(&b[1]).unwrap_or(std::cmp::Ordering::Equal))
103-
.then_with(|| a[2].partial_cmp(&b[2]).unwrap_or(std::cmp::Ordering::Equal))
104-
});
105-
endpoints
106-
}
107-
108-
pub fn parse_branch_count(s: &str) -> usize {
109-
s.trim()
110-
.parse()
111-
.expect("branch count must be a valid integer")
112-
}
113-
114-
pub fn parse_endpoints(s: &str) -> Vec<[f32; 3]> {
115-
s.lines()
116-
.filter(|l| !l.trim().is_empty())
117-
.map(|line| {
118-
let parts: Vec<f32> = line
119-
.split_whitespace()
120-
.map(|v| v.parse().expect("endpoint value must be a valid f32"))
121-
.collect();
122-
assert_eq!(
123-
parts.len(),
124-
3,
125-
"each endpoint line must have exactly 3 values, got {}",
126-
parts.len()
127-
);
128-
[parts[0], parts[1], parts[2]]
129-
})
130-
.collect()
131-
}
132-
133-
pub fn symmetric_hausdorff(a: &[f32], b: &[f32]) -> f32 {
134-
fn one_sided(from: &[f32], to: &[f32]) -> f32 {
135-
if from.is_empty() || to.is_empty() {
136-
return 0.0;
137-
}
138-
let mut max_dist = 0.0f32;
139-
for i in (0..from.len()).step_by(3) {
140-
let px = from[i];
141-
let py = from[i + 1];
142-
let pz = from[i + 2];
143-
let mut min_dist_sq = f32::MAX;
144-
for j in (0..to.len()).step_by(3) {
145-
let dx = px - to[j];
146-
let dy = py - to[j + 1];
147-
let dz = pz - to[j + 2];
148-
let d = dx * dx + dy * dy + dz * dz;
149-
if d < min_dist_sq {
150-
min_dist_sq = d;
151-
}
152-
}
153-
let d = min_dist_sq.sqrt();
154-
if d > max_dist {
155-
max_dist = d;
156-
}
157-
}
158-
max_dist
159-
}
160-
one_sided(a, b).max(one_sided(b, a))
161-
}

crates/slicer-runtime/tests/integration/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ mod region_split_dispatch_filter;
5454
mod run_pipeline_with_instrumentation_tdd;
5555
mod runtime_wiring_tdd;
5656
mod support_geometry_config_normalization_tdd;
57-
mod support_golden_regression_wedge_tdd;
5857
mod support_invariants_wedge_tdd;
5958
mod thin_wall_emission_tdd;
6059
mod threemf_paint_drop_on_modifier_tdd;

crates/slicer-runtime/tests/integration/support_golden_regression_wedge_tdd.rs

Lines changed: 0 additions & 205 deletions
This file was deleted.

0 commit comments

Comments
 (0)