Switch to louis-rs through louis-py in 2028.1
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- accessibility, backend
Research direction
Read louisHelper and the build and dependency configuration to understand how NVDA currently packages and calls liblouis. Then review the louis-py API and the linked parity and table distribution discussions; the work is complete when the dependency and table source are settled, louisHelper uses louis-py with the required search paths, and translation behavior is checked against the current implementation.
Written by the indexing model from the issue text.
Description
Related issues, PRs or discussions
- #20600 and #20666 made
louisHelperthe only module that calls liblouis. - #20736 proposes generating the braille table registry from liblouis table metadata.
- liblouis/louis-py#3 covers publishing louis-py on PyPI and how the tables get distributed.
- liblouis/louis-rs#61 asks where the tables will live.
- The Rusty Braille add-on is a proof of concept, submitted to the store in nvaccess/addon-datastore#13064. It routes
louisHelper.translateandlouisHelper.backTranslatethrough louis-py.
What is the current state of the codebase?
NVDA builds liblouis from the include/liblouis submodule into liblouis.dll. The build needs clang-cl from the "C++ Clang tools for Windows" Visual Studio component. NVDA ships the liblouis Python bindings as the louis package, with the tables in louis/tables.
louisHelper wraps louis. It registers a ctypes table resolver and a ctypes log callback with liblouis. Since #20666, no other core module calls louis.
Why are changes required?
The liblouis maintainers are reimplementing liblouis in Rust as louis-rs. louis-rs reads the same tables and runs liblouis's own test suite. Its README says the manual memory management behind most liblouis CVEs is gone.
louis-py is the Python binding for louis-rs, mainly maintained by me, in the liblouis organization. It ships as a prebuilt wheel, including x64 and arm64 builds for Windows.
The switch gives NVDA:
- A braille translator written in a memory safe language.
- No C build of liblouis. Building NVDA no longer needs clang-cl and the bloat of LLVM that comes with it in Visual Studio.
- Uv managed dependencies instead of a submodule, once the tables are on PyPI.
- No ctypes callbacks in
louisHelper. louis-py takes the table directories assearch_path=and reports warnings through Python'slogging. - A cut between translator and tables.
Users should notice no change in behaviour.
What technical changes are required?
- Add
louis-pyas a dependency along with a dependency that still has to be settled on that will bundle the tables. Ideally they are provided on PyPI, but even if they aren't, we can keep the existing approach for table bundling. - Rewrite
louisHelperon louis-py. It passes the custom table directories and the built-in table directory assearch_path=, instead of the ctypes table resolver.
Are the proposed technical changes API breaking?
Yes, so this targets 2028.1.
- The
louispackage andliblouis.dllare removed. Add-ons that importlouisbreak. louisHelper.LOUIS_TO_NVDA_LOG_LEVELSandlouisHelper.louis_logare removed. They only serve the liblouis log callback.
Are there potential risks or issues with the proposed implementation?
- louis-rs is in beta. Its parity report lists the liblouis tests it still fails, so some tables may translate differently. The Rusty Braille add-on lets users find such differences before the switch. We probably want to wait for a more stable release.
- louis-rs deliberately differs from liblouis in table lookup. It searches only the directories it is given. A custom table can therefore not include a table from a third directory. A table next to a custom table also takes the place of the built-in table with the same name.
- Dominant language
- Python
- Stars
- 2.7k
- Forks
- 842
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 56
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nvaccess/nvda
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
needs-technical-investigation p5 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
nvaccess/nvda#21085 · 7 comments ·
Maintainers usually reply within 1 day
-
Braille Viewer draws two braille patterns wrongly (U+28CC, U+2873) because of glyph errors in FreeMono-FixedBraille.ttfMay be free again A pull request for this issue was closed without being merged. Openaudience/a11y-tester good first issue p4 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nvaccess/nvda#21022 · 3 comments ·
Maintainers usually reply within 1 day
-
api-breaking-change audience/nvda-dev p5 release/blocking release/blocking-beta triaged
Difficulty 2/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
p5 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pimutils/vdirsyncer#1242 ·
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
QuantConnect/lean-cli#792 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-webui/open-webui#35360 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100