BS-JD-106 - Brush validation, repair, and diagnostics #15

Closed
opened 2026-06-06 01:46:44 -04:00 by Rbanh · 6 comments
Owner

Summary

Add robust error handling for degenerate brushes, inverted normals, zero-area faces, and non-manifold results.

Why

Geometry tools fail in messy ways unless validation and repair are built into the workflow.

Implementation notes

  • Add brush validation pass with actionable diagnostics.
  • Detect degenerate/inverted/non-manifold cases.
  • Provide repair actions where deterministic and safe.
  • Surface diagnostics in inspector/status/viewport overlays.

Acceptance criteria

  • Invalid brushes are detected before hydration produces bad geometry.
  • Diagnostics identify affected face/edge/vertex where possible.
  • Repair actions are undoable.
  • Save validation blocks unrecoverable invalid brush data.

Tests/docs

Validation fixtures for each error class. Update troubleshooting docs.

## Summary Add robust error handling for degenerate brushes, inverted normals, zero-area faces, and non-manifold results. ## Why Geometry tools fail in messy ways unless validation and repair are built into the workflow. ## Implementation notes - Add brush validation pass with actionable diagnostics. - Detect degenerate/inverted/non-manifold cases. - Provide repair actions where deterministic and safe. - Surface diagnostics in inspector/status/viewport overlays. ## Acceptance criteria - [ ] Invalid brushes are detected before hydration produces bad geometry. - [ ] Diagnostics identify affected face/edge/vertex where possible. - [ ] Repair actions are undoable. - [ ] Save validation blocks unrecoverable invalid brush data. ## Tests/docs Validation fixtures for each error class. Update troubleshooting docs.
Rbanh added this to the M1 - Brush-based blockout milestone 2026-06-06 01:46:44 -04:00
Rbanh added the
roadmap:jackdaw
type:feature
priority:P2
area:brushes
labels 2026-06-06 01:46:45 -04:00
Author
Owner

Starting implementation for BS-JD-106 - Brush validation, repair, and diagnostics.

Initial scope:

  • Add shared brush validation report with severity, face IDs, and clear messages.
  • Detect empty brushes, too-few face vertices, non-finite vertices, zero-area faces, and invalid plane normals.
  • Surface validation warnings in the Brush inspector card.
  • Add simple repair action for reset-to-cube where data is unrecoverable.
  • Add unit tests for invalid brush fixtures.

A dedicated Window > Brush Diagnostics panel and richer repair actions can build on the report type once the shared validation path is stable.

Starting implementation for `BS-JD-106 - Brush validation, repair, and diagnostics`. Initial scope: - Add shared brush validation report with severity, face IDs, and clear messages. - Detect empty brushes, too-few face vertices, non-finite vertices, zero-area faces, and invalid plane normals. - Surface validation warnings in the Brush inspector card. - Add simple repair action for reset-to-cube where data is unrecoverable. - Add unit tests for invalid brush fixtures. A dedicated Window > Brush Diagnostics panel and richer repair actions can build on the report type once the shared validation path is stable.
Author
Owner

Checkpoint pushed: 4dc22cd Add brush validation diagnostics.

Implemented:

  • Added shared validate_brush diagnostics with warning/error severity.
  • Detects empty brushes, too-few face vertices, non-finite vertices, duplicate vertices, invalid plane normals, degenerate face area, and zero/non-finite UV scale warnings.
  • Hydration now runs the shared validator and skips invalid brushes with diagnostic warnings instead of attempting mesh/collider generation.
  • Brush inspector now shows inline diagnostics for selected brush actors; Reset Cube Brush remains the MVP repair action.
  • Updated brush docs and editor docs.

Verification:

  • cargo fmt --check
  • cargo test -p shared brush
  • cargo check -p editor --all-targets
  • cargo check --workspace --all-targets
  • cargo check --workspace --all-targets --all-features

Remaining follow-up for the full ticket: dedicated multi-brush diagnostics/repair window and richer repair actions beyond reset-to-cube.

Checkpoint pushed: `4dc22cd Add brush validation diagnostics`. Implemented: - Added shared `validate_brush` diagnostics with warning/error severity. - Detects empty brushes, too-few face vertices, non-finite vertices, duplicate vertices, invalid plane normals, degenerate face area, and zero/non-finite UV scale warnings. - Hydration now runs the shared validator and skips invalid brushes with diagnostic warnings instead of attempting mesh/collider generation. - Brush inspector now shows inline diagnostics for selected brush actors; `Reset Cube Brush` remains the MVP repair action. - Updated brush docs and editor docs. Verification: - `cargo fmt --check` - `cargo test -p shared brush` - `cargo check -p editor --all-targets` - `cargo check --workspace --all-targets` - `cargo check --workspace --all-targets --all-features` Remaining follow-up for the full ticket: dedicated multi-brush diagnostics/repair window and richer repair actions beyond reset-to-cube.
Author
Owner

Checkpoint pushed: 11b0df2 Block saving invalid brushes.

Implemented:

  • Shared actor validation now runs validate_brush for ActorKind::Brush actors.
  • Fatal brush diagnostics now fail save/play-style actor validation via InvalidBrushGeometry.
  • Editor save status reports the first actionable brush diagnostic, e.g. Save failed: invalid brush geometry: Face has fewer than three vertices.
  • Added a shared unit test for invalid brush geometry rejection.
  • Updated brush docs to state that scene save blocks unrecoverable invalid brush geometry.

Verification:

  • cargo fmt --check
  • cargo test -p shared brush
  • cargo test -p shared actor
  • cargo check -p editor --all-targets
  • cargo check --workspace --all-targets
  • cargo check --workspace --all-targets --all-features

Remaining follow-up for the full ticket: richer repair actions and a dedicated multi-brush diagnostics/repair window.

Checkpoint pushed: `11b0df2 Block saving invalid brushes`. Implemented: - Shared actor validation now runs `validate_brush` for `ActorKind::Brush` actors. - Fatal brush diagnostics now fail save/play-style actor validation via `InvalidBrushGeometry`. - Editor save status reports the first actionable brush diagnostic, e.g. `Save failed: invalid brush geometry: Face has fewer than three vertices.` - Added a shared unit test for invalid brush geometry rejection. - Updated brush docs to state that scene save blocks unrecoverable invalid brush geometry. Verification: - `cargo fmt --check` - `cargo test -p shared brush` - `cargo test -p shared actor` - `cargo check -p editor --all-targets` - `cargo check --workspace --all-targets` - `cargo check --workspace --all-targets --all-features` Remaining follow-up for the full ticket: richer repair actions and a dedicated multi-brush diagnostics/repair window.
Author
Owner

Checkpoint pushed: 09f707b Add brush diagnostics window.

Implemented:

  • Added Window → Brush Diagnostics.
  • The window lists all brush actors, sorted with invalid brushes first.
  • Each row shows validation state/counts and the first diagnostic message.
  • Rows can select the affected brush in the editor selection state.
  • Invalid rows expose an undoable Reset Cube repair action through existing brush history.
  • Updated editor/brush docs.

Verification:

  • cargo fmt --check
  • cargo check -p editor --all-targets
  • cargo check --workspace --all-targets
  • cargo check --workspace --all-targets --all-features

Remaining follow-up for the full ticket: targeted repair actions beyond reset-to-cube, such as rebuilding face planes or pruning duplicate vertices in place.

Checkpoint pushed: `09f707b Add brush diagnostics window`. Implemented: - Added **Window → Brush Diagnostics**. - The window lists all brush actors, sorted with invalid brushes first. - Each row shows validation state/counts and the first diagnostic message. - Rows can select the affected brush in the editor selection state. - Invalid rows expose an undoable **Reset Cube** repair action through existing brush history. - Updated editor/brush docs. Verification: - `cargo fmt --check` - `cargo check -p editor --all-targets` - `cargo check --workspace --all-targets` - `cargo check --workspace --all-targets --all-features` Remaining follow-up for the full ticket: targeted repair actions beyond reset-to-cube, such as rebuilding face planes or pruning duplicate vertices in place.
Author
Owner

Completion checkpoint pushed: b230593 Expand brush validation coverage.

Implemented:

  • Detect inverted face plane normals relative to polygon vertex winding.
  • Detect open/non-manifold brush edges using quantized undirected edge incidence.
  • Added validation fixtures for inverted normals and open edges.
  • Updated brush diagnostics docs.

Full #15 coverage now includes:

  • Pre-hydration invalid brush detection and skip.
  • Inline inspector diagnostics.
  • Window → Brush Diagnostics with selection and undoable Reset Cube repair.
  • Save-time validation blocking unrecoverable invalid brush data.
  • Degenerate faces, finite vertices, duplicate vertices, invalid/inverted normals, open/non-manifold edges, and UV warnings.

Verification:

  • cargo fmt --check
  • cargo test -p shared brush
  • cargo check -p editor --all-targets
  • cargo check --workspace --all-targets
  • cargo check --workspace --all-targets --all-features
Completion checkpoint pushed: `b230593 Expand brush validation coverage`. Implemented: - Detect inverted face plane normals relative to polygon vertex winding. - Detect open/non-manifold brush edges using quantized undirected edge incidence. - Added validation fixtures for inverted normals and open edges. - Updated brush diagnostics docs. Full #15 coverage now includes: - Pre-hydration invalid brush detection and skip. - Inline inspector diagnostics. - Window → Brush Diagnostics with selection and undoable Reset Cube repair. - Save-time validation blocking unrecoverable invalid brush data. - Degenerate faces, finite vertices, duplicate vertices, invalid/inverted normals, open/non-manifold edges, and UV warnings. Verification: - `cargo fmt --check` - `cargo test -p shared brush` - `cargo check -p editor --all-targets` - `cargo check --workspace --all-targets` - `cargo check --workspace --all-targets --all-features`
Rbanh closed this issue 2026-06-06 06:39:02 -04:00
Author
Owner

QA checklist audit completed; no additional local code changes made for this pass.

Evidence reviewed:

  • Shared validate_brush detects fatal geometry issues and warnings.
  • Brush hydration validates before mesh/collider generation and skips invalid brushes.
  • Actor/save validation maps fatal brush diagnostics to InvalidBrushGeometry, blocking unrecoverable invalid scene saves.
  • Brush inspector and Window -> Brush Diagnostics both surface shared diagnostics.
  • Reset Cube repair in the inspector/diagnostics window routes through set_brush_with_history, so the repair is undoable.

Verification rerun:

  • cargo test -p shared brush
  • cargo test -p shared actor
  • cargo check -p editor --all-targets

Leaving #37 checklist unchecked until interactive QA confirms diagnostics window selection/reset and save blocking in the editor.

QA checklist audit completed; no additional local code changes made for this pass. Evidence reviewed: - Shared `validate_brush` detects fatal geometry issues and warnings. - Brush hydration validates before mesh/collider generation and skips invalid brushes. - Actor/save validation maps fatal brush diagnostics to `InvalidBrushGeometry`, blocking unrecoverable invalid scene saves. - Brush inspector and Window -> Brush Diagnostics both surface shared diagnostics. - Reset Cube repair in the inspector/diagnostics window routes through `set_brush_with_history`, so the repair is undoable. Verification rerun: - `cargo test -p shared brush` - `cargo test -p shared actor` - `cargo check -p editor --all-targets` Leaving #37 checklist unchecked until interactive QA confirms diagnostics window selection/reset and save blocking in the editor.
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Falling-Metal-Interactive/Blacksite#15
No description provided.