From 890d4e9eed9da7b76ba3ad0cbf94d7358cf0f007 Mon Sep 17 00:00:00 2001 From: Mitchell Hansen Date: Wed, 6 May 2026 22:00:49 -0700 Subject: [PATCH] brush-paint-opt: widen lookahead_steps range to 5-10 + apply minor v3 tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lookahead bound: 2-6 → 5-10. Live debug-viewer test showed lookahead_steps=7 fixes W's apex (the walker can see across the ~1.5×-brush gap to the second diagonal at the bottom). At lookahead=3 (current default), horizon = lookahead × step_size × brush ≈ 1.2 × brush — short of the unpainted leg past sharp corners on M/W/A. Range 5-10 lets the optimizer pick a value that clears these without going so wide it captures unrelated bg. Also rolling in the trivial winners from the prior 12x8x2 run: brush_radius_offset_px: 0.50 → 0.53 output_rdp_eps: 1.0 → 1.98 Frontend mirror updated to match. --- src-frontend/src/hooks/useTauri.js | 4 ++-- src/brush_paint.rs | 4 ++-- src/brush_paint_opt.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src-frontend/src/hooks/useTauri.js b/src-frontend/src/hooks/useTauri.js index 01a7be00..8a5c204f 100644 --- a/src-frontend/src/hooks/useTauri.js +++ b/src-frontend/src/hooks/useTauri.js @@ -38,7 +38,7 @@ export async function loadTestLetter(passIdx, ch, fontMm, dpi, thicknessPx) { // Default PaintParams must match Rust's `impl Default for PaintParams`. export const DEFAULT_PAINT_PARAMS = { brush_radius_factor: 0.88, - brush_radius_offset_px: 0.50, + brush_radius_offset_px: 0.53, brush_radius_percentile: 0.93, step_size_factor: 0.40, n_directions: 48, @@ -56,7 +56,7 @@ export const DEFAULT_PAINT_PARAMS = { pen_lift_reach: 3.0, max_steps_per_stroke: 4000, max_strokes: 12, - output_rdp_eps: 1.0, + output_rdp_eps: 1.98, } export async function getPaintDebug(passIdx, hullIdx, params = DEFAULT_PAINT_PARAMS) { diff --git a/src/brush_paint.rs b/src/brush_paint.rs index ff5fd778..b335b445 100644 --- a/src/brush_paint.rs +++ b/src/brush_paint.rs @@ -153,7 +153,7 @@ impl Default for PaintParams { // letters miscounted) are NOT respected — known limitation // of the soft inner-score the meta search uses. brush_radius_factor: 0.88, - brush_radius_offset_px: 0.50, + brush_radius_offset_px: 0.53, brush_radius_percentile: 0.93, step_size_factor: 0.40, n_directions: 48, @@ -171,7 +171,7 @@ impl Default for PaintParams { pen_lift_reach: 3.0, max_steps_per_stroke: 4000, max_strokes: 12, - output_rdp_eps: 1.0, + output_rdp_eps: 1.98, } } } diff --git a/src/brush_paint_opt.rs b/src/brush_paint_opt.rs index f169e278..3960ad2b 100644 --- a/src/brush_paint_opt.rs +++ b/src/brush_paint_opt.rs @@ -59,7 +59,7 @@ pub fn default_axes() -> Vec { set: |p, v| p.overpaint_penalty = v, get: |p| p.overpaint_penalty }, Axis { name: "step_size_factor", lo: 0.20, hi: 0.90, is_int: false, set: |p, v| p.step_size_factor = v, get: |p| p.step_size_factor }, - Axis { name: "lookahead_steps", lo: 2.0, hi: 6.0, is_int: true, + Axis { name: "lookahead_steps", lo: 5.0, hi: 10.0, is_int: true, set: |p, v| p.lookahead_steps = v as usize, get: |p| p.lookahead_steps as f32 }, Axis { name: "n_directions", lo: 8.0, hi: 64.0, is_int: true, set: |p, v| p.n_directions = v as usize, get: |p| p.n_directions as f32 },