Oriel — AI & technology worth noticing, every day.

Simple Sudoku Solver in Assembly

Web page · https://blog.veitheller.de/Simple_Sudoku_Solvers_SIII%2C_EII%3A_Assembly.html

First seen by Oriel on .

AI summary

This article builds an approximately 200-line AArch64 assembly Sudoku solver for macOS, using bitmasks, propagation, MRV selection, recursion, and manual stack management.

  • The solver mutates an 81-byte global board, propagates single-candidate cells, then backtracks over candidates selected from the cell with the fewest options.
  • Candidate masks encode digits in bits matching their values, allowing empty cells to be handled without branching and enabling direct digit extraction.
  • Assembly macros copy boards in 81 bytes using vector loads and stores, while recursive state is preserved on the machine stack.
  • The solver takes about 4 milliseconds on the author’s machine, compared with about 70 milliseconds for Python and 2.7 seconds for Agda.
  • Because assembly provides no types, runtime, allocator, or correctness checks, register preservation, stack cleanup, and input validity depend on the programmer.

#aarch64 #assembly #sudoku solvers #backtracking

Generated by gpt-5.6-sol. Check the original for details.

Metric trends

Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained

Points

Score reported by the source.

  • Lobsters: 11, latest observation ; +10 over observed period since

Comments

Comment count reported by the source.

  • Lobsters: 0, latest observation ; 0 over observed period since

Aliases

SourceExternal IDURL
Lobstersxmnhbthttps://blog.veitheller.de/Simple_Sudoku_Solvers_SIII%2C_EII%3A_Assembly.html Read discussion