Tidy what the seven-branch merge left behind
Build and test / Desktop (Linux) (push) Failing after 57m16s
Build and test / Layer separation (push) Successful in 34s
🐳 Android image / Build and push (push) Successful in 3s
Build and test / android-image (push) Successful in 3s
Traceability / Requirement traces (push) Successful in 1m7s
Build and test / Android (aarch64) (push) Failing after 9m41s
Build and test / Desktop (Linux) (push) Failing after 57m16s
Build and test / Layer separation (push) Successful in 34s
🐳 Android image / Build and push (push) Successful in 3s
Build and test / android-image (push) Successful in 3s
Traceability / Requirement traces (push) Successful in 1m7s
Build and test / Android (aarch64) (push) Failing after 9m41s
Three lints, all from merged work rather than from any one branch: `terrace` and `disc` were steps on the way to the ramp the plateau test now uses, and the reasoning that discarded them lives in docs/segmentation.md §12 rather than needing the code; two mechanical clippy suggestions in segment and cache. 1176 tests pass, clippy and fmt clean, traceability regenerated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -291,7 +291,7 @@ impl SegmentPass {
|
||||
|
||||
// An odd number of plateau steps leaves the distance field in B.
|
||||
let plateau_steps = opts.plateau_iterations;
|
||||
let final_dist = if plateau_steps % 2 == 0 {
|
||||
let final_dist = if plateau_steps.is_multiple_of(2) {
|
||||
&dist_a
|
||||
} else {
|
||||
&dist_b
|
||||
@@ -705,54 +705,6 @@ mod tests {
|
||||
}
|
||||
px
|
||||
}
|
||||
|
||||
/// A terraced disc: dark ground, a mid-level annulus, a bright centre.
|
||||
///
|
||||
/// The annulus is the point. It is a wide plateau that *has* a descending
|
||||
/// exit — the ground outside it — which is the only situation
|
||||
/// lower-completion is defined for. `disc` below has only flat regions at
|
||||
/// the gradient's global minimum, and a plateau with no exit at all is a
|
||||
/// minimum: one basin by definition, with nothing to resolve.
|
||||
fn terrace(w: u32, h: u32) -> Vec<u8> {
|
||||
let mut px = vec![0u8; (w * h * 4) as usize];
|
||||
let (cx, cy) = (w as f32 / 2.0, h as f32 / 2.0);
|
||||
for y in 0..h {
|
||||
for x in 0..w {
|
||||
let d = ((x as f32 - cx).powi(2) + (y as f32 - cy).powi(2)).sqrt();
|
||||
let v = if d < w as f32 * 0.16 {
|
||||
200
|
||||
} else if d < w as f32 * 0.40 {
|
||||
130
|
||||
} else {
|
||||
60
|
||||
};
|
||||
let i = ((y * w + x) * 4) as usize;
|
||||
px[i] = v;
|
||||
px[i + 1] = v;
|
||||
px[i + 2] = v;
|
||||
px[i + 3] = 255;
|
||||
}
|
||||
}
|
||||
px
|
||||
}
|
||||
|
||||
fn disc(w: u32, h: u32) -> Vec<u8> {
|
||||
let mut px = vec![0u8; (w * h * 4) as usize];
|
||||
let (cx, cy) = (w as f32 / 2.0, h as f32 / 2.0);
|
||||
for y in 0..h {
|
||||
for x in 0..w {
|
||||
let d = ((x as f32 - cx).powi(2) + (y as f32 - cy).powi(2)).sqrt();
|
||||
let v = if d < w as f32 * 0.3 { 200 } else { 60 };
|
||||
let i = ((y * w + x) * 4) as usize;
|
||||
px[i] = v;
|
||||
px[i + 1] = v;
|
||||
px[i + 2] = v;
|
||||
px[i + 3] = 255;
|
||||
}
|
||||
}
|
||||
px
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "the plateau pass is a measured no-op; see docs/segmentation.md §12"]
|
||||
fn lower_completion_drains_a_plateau_instead_of_shattering_it() {
|
||||
|
||||
Reference in New Issue
Block a user