Skip to content

Conversation

@virtualritz
Copy link

@virtualritz virtualritz commented Sep 23, 2025

TLDR; This PR improves stability and maintainability of Foxtrot while bringing it up to current Rust ecosystem standards.

Rust 2024 Edition

  • Updated entire workspace from Rust 2021 to Rust 2024 edition.
  • Fixed all compilation warnings (220+ lifetime elision warnings, 43+ dead code warnings).
  • Applied rustfmt and clippy fixes across all crates.
  • Updated all dependencies to latest compatible versions.

GUI/Rendering

  • Migrated to wgpu v26 and winit v0.30 APIs.
  • Replaced winit event loop with ApplicationHandler trait.
  • Updated WGSL shaders from [[attributes]] to @attributes syntax.
  • Fixed Surface lifetime management with Arc.
  • Handle empty meshes gracefully with early exit and clear error messages.

Bug Fixes

  • Fixed panic in cdt triangulation when processing complex models (e.g., Raspberry Pi 4 STEP file).
  • Replaced assertions with proper error handling using new Error::HullMismatch variant.
  • Added test cases for problematic cdt input that was causing crashes.
  • Fixed buffer panics when models have no vertices or triangles.

Detailed Changes

Express Parser Improvements

  • Fixed nom 7 API compatibility (fold_many0/fold_many1 now use closures).
  • Resolved lifetime issues in alias macro for proper IResult usage.
  • Applied clippy recommendations (renamed methods, removed redundant closures).

Code Quality

  • Renamed parallel feature to rayon and enabled by default.
  • Renamed structs to comply with Rust API naming guidelines (RFC 430).
  • Applied cargo-sort for consistent dependency ordering.

cdt Improvements

  • Merged PR CDT: Add test cases for problematic input #14 adding test cases for problematic triangulation input.
  • Fixed assertions that would panic on malformed hull structures.
  • Errors are now properly propagated instead of causing crashes.

Testing

  • All existing tests pass.
  • New test cases added for problematic cdt scenarios.
  • Successfully loads and displays complex STEP files that previously crashed.

virtualritz and others added 24 commits May 17, 2024 12:40
Major changes:
- Migrate entire workspace to Rust 2024 edition.
- Update GUI to use wgpu v26 and winit v0.30 APIs.
- Fix all dead_code warnings with #[expect(dead_code)] attributes.
- Fix all lifetime elision warnings in express crate.
- Fix nom 7 API compatibility (fold_many requires closures).
- Add CLAUDE.md documentation for future Claude instances.

GUI/Rendering fixes:
- Migrate from deprecated winit event loop to ApplicationHandler trait.
- Fix shader syntax from [[attributes]] to @attributes for modern WGSL.
- Handle empty meshes gracefully with early exit and error message.
- Fix empty buffer panics in camera.rs and model.rs.
- Add checks for empty vertex arrays in camera::fit_verts.
- Update Surface to use Arc<Window> for proper lifetime management.
- Replace SwapChain with SurfaceConfiguration API.

Express/Parser improvements:
- Fix 220+ lifetime elision warnings with explicit annotations.
- Fix alias macro to handle lifetimes correctly with IResult.
- Rename to_rtype_build to build_rtype (clippy wrong_self_convention).
- Make to_inner_rtype a static method (clippy only_used_in_recursion).
- Remove redundant closures (String::new instead of || String::new()).
- Collapse nested if statements with if-let chains.
- Fix fold_many0/fold_many1 to use closures for initial values.

Code quality:
- Format imports alphabetically across all crates.
- Apply rustfmt to all modified files.
- Use if-let chains for cleaner pattern matching.
- Update dependencies to latest compatible versions.
- Fix all clippy warnings at default level.
Major changes:
- Migrate entire workspace to Rust 2024 edition.
- Update GUI to use wgpu v26 and winit v0.30 APIs.
- Fix all dead_code warnings with #[expect(dead_code)] attributes.
- Fix all lifetime elision warnings in express crate.
- Fix nom 7 API compatibility (fold_many requires closures).

GUI/Rendering fixes:
- Migrate from deprecated winit event loop to ApplicationHandler trait.
- Fix shader syntax from [[attributes]] to @attributes for modern WGSL.
- Handle empty meshes gracefully with early exit and error message.
- Fix empty buffer panics in camera.rs and model.rs.
- Add checks for empty vertex arrays in camera::fit_verts.
- Update Surface to use Arc<Window> for proper lifetime management.
- Replace SwapChain with SurfaceConfiguration API.

Express/Parser improvements:
- Fix 220+ lifetime elision warnings with explicit annotations.
- Fix alias macro to handle lifetimes correctly with IResult.
- Rename to_rtype_build to build_rtype (clippy wrong_self_convention).
- Make to_inner_rtype a static method (clippy only_used_in_recursion).
- Remove redundant closures (String::new instead of || String::new()).
- Collapse nested if statements with if-let chains.
- Fix fold_many0/fold_many1 to use closures for initial values.

Code quality:
- Format imports alphabetically across all crates.
- Apply rustfmt to all modified files.
- Use if-let chains for cleaner pattern matching.
- Update dependencies to latest compatible versions.
- Fix all clippy warnings at default level.
Update rand API calls from deprecated methods to new ones:
- Replace gen_range with random_range
- Replace thread_rng().gen() with rng().random()

Update CDT tests to expect HullMismatch error for problematic cases
that now properly return errors instead of panicking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants