The objective is to fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 subgrids that compose the grid (also called "boxes", "blocks", or "regions") contains all of the digits from 1 to 9.

Now here's the thing... There are 6,670,903,752,021,072,936,960 different valid sudoku boards. Some of them may be very difficult to compress and output in fewer bytes. Others of them may be easier. Part of this challenge is to figure out which boards will be most compressible and could be outputted in the fewest bytes.

Your submission does not necessarily have to output the same board every time. But if multiple outputs are possible, you'll have to prove that every possible output is a valid board.

You can use this script (thanks to Magic Octopus Urn) or any of these answers to verify if a particular grid is a valid solution. It will output a [1] for a valid board, and anything else for an invalid board.

I'm not too picky about what format you output your answer in, as long as it's clearly 2-dimensional. For example, you could output a 9x9 matrix, nine 3x3 matrices, a string, an array of strings, an array of 9-digit integers, or nine 9-digit numbers with a separator. Outputting 81 digits in 1 dimension would not be permitted. If you would like to know about a particular output format, feel free to ask me in the comments.

As usual, this is code-golf, so write the shortest answer you can come up with in the language(s) of your choosing!

T-SQL, 96 89 bytes

Extracts 9-character strings starting at different points, as defined by the in-memory table created by STRING_SPLIT (which is supported on SQL 2016 and later). The 0+value was the shortest way I could do an implicit cast to integer.

The elements of the byte string end up giving the numbers [1, 4, 7, 2, 5, 8, 3, 6, 9] which are used to permute the rotations of [0..9]. The 0 is removed in l[1:i] and there is no need for a null byte which takes two characaters (\0) to represent in a bytes object.

9Rṙ`s3ZẎ
9R Range(9) -> [1,2,3,4,5,6,7,8,9]
` Use the same argument twice for the dyad:
ṙ Rotate [1..9] each of [1..9] times.
This gives all cyclic rotations of the list [1..9]
s3 Split into three lists.
Z Zip. This puts the first row of each list of three in it's own list,
as well as the the second and third.
Ẏ Dump into a single list of nine arrays.

Instead of printing a NUL byte to seperate your digits, you could use a tab character at the same byte count.
– Jonathan FrechSep 24 at 14:29

"Your submission does not necessarily have to output the same board every time. But if multiple outputs are possible, you'll have to prove that every possible output is a valid board." It does not say that multiple outputs are needed. @ceilingcat
– LogernSep 24 at 17:46

Your Answer

If this is an answer to a challenge…

…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.

…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.

…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.

More generally…

…Please make sure to answer the question and provide sufficient detail.

…Avoid asking for help, clarification or responding to other answers (use comments instead).