feat: add faster algorithm options (greedy, auction, hybrid)#47
Open
adamholter wants to merge 4 commits intoSpu7Nix:mainfrom
Open
feat: add faster algorithm options (greedy, auction, hybrid)#47adamholter wants to merge 4 commits intoSpu7Nix:mainfrom
adamholter wants to merge 4 commits intoSpu7Nix:mainfrom
Conversation
- Added 3 new algorithms with better speed/quality tradeoffs: - Greedy: O(n²), ~92% quality - fastest option - Auction: O(n² log n), ~98% quality - best balance - Hybrid: coarse-to-fine approach, ~97% quality - Increased resolution slider max from 256 to 512 - Updated algorithm dropdown with descriptive names These provide intermediate options between the extremely slow 'optimal' algorithm and the fast but sub-optimal 'genetic' algorithm.
- Changed to Gauss-Seidel style (one bidder at a time) instead of Jacobi - Added staleness detection: if no progress for 100 iterations, finish greedily - Removed problematic epsilon-scaling phase reset that caused infinite loops - Fixed progress tracking to show actual assignment count
- Added color_shift parameter to GenerationSettings and Preset - Enhanced Algorithm enum with descriptions, quality estimates, speed ratings - Updated algorithm dropdown with visual speed bars and quality percentages - Added color morph slider (0-100%) with descriptive labels - Added tooltips explaining each algorithm and the color morph feature
…hmark tool NEW ALGORITHM: Spatial - Uses grid-based spatial partitioning for O(n) performance at high res - 31x faster than Greedy at 512x512 resolution - Best algorithm for 256+ resolution images Benchmark results (blackhole preset): - 64×64: Spatial 7ms vs Greedy 22ms (3x faster) - 128×128: Spatial 32ms vs Greedy 300ms (9x faster) - 256×256: Spatial 228ms vs Greedy 4.1s (18x faster) - 512×512: Spatial 2.1s vs Greedy 66s (31x faster) CLI BENCHMARK TOOL: - Run with: cargo run --release --bin benchmark - Tests all algorithms at specified resolutions - Options: --resolution, --algorithm, --preset, --all Made app/calculate and app/preset modules public for CLI access.
|
This pull request is AI generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds 3 new algorithms that provide better speed/quality tradeoffs between the existing "optimal" and "genetic" options. It also increases the resolution slider from 256 to 512.
Problem
The current algorithm options are:
Users need intermediate options that balance speed and quality better.
New Algorithms
Changes
src/app/calculate/mod.rs: Addedprocess_greedy,process_auction,process_hybridfunctions (~400 lines)src/app/calculate/util.rs: ExpandedAlgorithmenum withdisplay_name()methodsrc/app/gui.rs: Increased resolution slider to 512, updated algorithm dropdown with all 5 optionsTesting
cargo checkcargo run --releaseScreenshots
The algorithm dropdown now shows descriptive names like: