qmk_firmware
qmk_firmware copied to clipboard
Allow larger autocorrect dictionaries via configurable link size
Description
This PR relaxes the size limit on autocorrect dictionaries so tables larger than 64KB can be generated and used safely.
- Allow the autocorrect runtime to read tries with either 2- or 3-byte node links, using
AUTOCORRECT_LINK_BYTE_COUNTdefined in the generated header. - Update the autocorrect data generator to compute entry sizes, try 2-byte links first, and automatically switch to 3-byte links when the serialized table would exceed 64KB.
- Emit
AUTOCORRECT_LINK_BYTE_COUNTin generatedautocorrect_data.hfiles and annotate the default autocorrect dictionary with its link size. - Document the new link format behaviour in
docs/features/autocorrect.md.
Types of Changes
- [x] Core
- [x] Enhancement/optimization
- [x] Documentation
Issues Fixed or Closed by This PR
- Fixes qmk/qmk_firmware#25823
Checklist
- [x] My code follows the code style of this project: C, Python
- [x] I have read the PR Checklist document and have made the appropriate changes.
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] I have added tests or basic checks to cover my changes (e.g.
python -m compileall lib/python/qmk/cli/generate/autocorrect_data.pyand firmware builds with a generated dictionary). - [x] I have tested the changes and verified that they work and don't break anything (as well as I can manage).