benchmarks: Add sudoku_search constraint solver#212
Open
OmerFarkash wants to merge 1 commit intoembench:masterfrom
Open
benchmarks: Add sudoku_search constraint solver#212OmerFarkash wants to merge 1 commit intoembench:masterfrom
OmerFarkash wants to merge 1 commit intoembench:masterfrom
Conversation
This commit introduces a new integer-heavy benchmark based on a recursive backtracking algorithm to solve a 25x25 Sudoku puzzle. The workload is designed to exercise: - Recursive stack frame management and depth. - Conditional branching performance (via constraint checking). - Global/Static data access patterns. A 25x25 grid was chosen to provide a stable, measurable execution time on modern high-performance embedded cores while remaining portable to small 32-bit targets. The benchmark includes a verification function to ensure functional correctness after execution. Files modified/added: * src/sudoku_search/sudoku_search.c: Core implementation and API. * src/sudoku_search/sudoku_search.h: Grid configuration and headers. * baseline-data/size.json: Added baseline memory footprints. * baseline-data/speed.json: Added reference timing (4000ms).
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.
Description:
This commit introduces a new integer-heavy benchmark based on a recursive backtracking algorithm to solve a 25x25 Sudoku puzzle. The workload is designed to provide a stable, measurable execution time on modern high-performance embedded cores while remaining portable to 32-bit targets.
Key Features:
Workload Characteristics: Exercises recursive stack frame management, deep recursion depth, and high-frequency conditional branching via constraint-checking logic.
Self-Verification: Includes a robust verify_benchmark function. It performs a post-execution pass to ensure the grid is fully populated and validates each cell against Sudoku constraints (row, column, and subgrid) using the is_safe logic. This ensures that the performance metrics reflect a functionally correct execution.
Predictable Baseline: Configured with a 25x25 grid to achieve a ~4000ms baseline, allowing for accurate speed scoring across various ISA implementations.
Verification Results:
Code Size: 592 bytes (Text section).
Performance: Achieved a consistent Speed score of 400.00 on x86_64 native target against the 4000ms reference.
Portability: Verified compilation and logic structure for RISC-V (rv32imac) targets.
Files modified/added:
src/sudoku_search/sudoku_search.c: Core implementation, recursive solver, and Embench API.
src/sudoku_search/sudoku_search.h: Grid configuration (BOARD_SIZE 25), constants, and headers.
baseline-data/size.json: Added baseline memory footprints (Text, ROData, BSS).
baseline-data/speed.json: Added reference timing (4000ms).