Repository navigation
Description
Suggestions from a static read-through of main at b0f3d399. Nothing was built or run, and no game files were involved; the numbers are line/occurrence counts over tracked files. This write-up was AI-assisted. None of it is claimed work: take what is useful, close the rest.
1. Very large single files
| File | Lines |
|---|---|
tools/rdna2spirv.py |
19,750 (one method, _insn, is about 5,000 lines) |
runtime/shims/d3d12_vulkan_device.cpp |
18,465 |
runtime/shims/d3d12_xs_device.cpp |
6,756 |
runtime/src/vulkan_replay.h |
5,305 (implementation in a header) |
Splitting by family (instruction groups in the translator; resources / pipelines / command lists in the device) would make reviews smaller and reduce the rebase conflicts that the needs rebase label exists to handle.
2. runtime/CMakeLists.txt is 295 KB
308 add_executable, 421 add_test, 246 target_link_libraries, and no function() or macro(). A helper such as leonida_add_test(name SOURCES ... LIBS ...) that also applies the common /W4 /permissive- /utf-8 options would shrink it a lot and keep flags consistent across targets.
3. Flat folders and repeated helpers
tests/has 547 entries at one level,tools/287,runtime/test/378.- The same small helpers are redefined per tool:
_u32in 19 files,same_output_pathin 13 (althoughtools/report_paths.pyalready exists for this),self_testin 43. - 1,051 Python files call
sys.path.insert. A package layout with a shared module would remove most of them and still work withpython -I.
4. No style or lint configuration
There is no pyproject.toml, ruff config, .clang-format, .clang-tidy or .editorconfig. The C++ targets use /W4 but I found no /WX / -Werror, so new warnings can land unnoticed. A formatter config alone would cut noise in diffs from many contributors.
5. CI
- The standard-library tests run one file at a time in a serial bash loop on
windows-latestwith a 15-minute timeout; running them in parallel (asscripts/run_semantic_tests.pyalready does for the translator suite) would give headroom as the count grows. - Whether a file is a pytest file is decided by a regex over its contents (
PYTEST_FILE_MARKERS). A naming convention or a folder would be less fragile.
6. Documentation
docs/design.md(605 KB) anddocs/d3d12_vulkan.md(519 KB) are hard to read, diff and review as single files; splitting by topic with an index would help.README.mdstill cites#166,#313and links toItsNotRexed/Leonidaissue comments (#644,#881) as evidence, whichCONTRIBUTING.mdsays no longer resolve.- Several cells of the README status table hold a full paragraph; a short status plus a link to the note would read better.
7. Small things
- 27 broad
except Exception:inmake_game.py,tools/andscripts/; some may hide real errors. navmeshes.navmesh-decode.jsonsits at the repository root; it looks like it belongs underdocs/or outside the repo.assets/logo.pngis 447 KB next to a 140 KB SVG of the same logo.
What already looks good
Actions pinned by commit SHA, no shell=True / eval / pickle in the tools, viewer/serve.py binds to loopback and guards against DNS rebinding, and the no-game-data check in CI.
Activity
BubsMcgee commentedon Nov 25, 2026
Verified the write-up against
origin/mainat9e7720c9e(the base moved pastb0f3d399; the line counts still hold within a few lines). Triage in the order I would take it, with what is safe while ~120 PRs are open:Safe now (taken)
navmeshes.navmesh-decode.jsonis the default output oftools/navmesh_decode.pyrun from the root;docs/navmesh.mdalready writes to a temp path. Untracked and ignored in repo: ignore a generated navmesh dump and add an editorconfig #1956..editorconfigmirroring.gitattributes(LF; CRLF for.ps1/.cmd/.bat/.sln), no formatter, in repo: ignore a generated navmesh dump and add an editorconfig #1956.Needs one owner and a dedicated PR (do not batch)
runtime/CMakeLists.txthelper: mechanical and valuable, but it rewrites every target's declaration; needs a build +ctestparity check before/after and will collide with any PR adding a target.PYTEST_FILE_MARKERSregex are real, but parallelising changes failure attribution and flake; measure one baseline run first.Wait for the PR queue (the split itself is the hazard)
tools/rdna2spirv.py,runtime/shims/d3d12_vulkan_device.cpp,d3d12_xs_device.cpp,runtime/src/vulkan_replay.h: splitting them now rebases most of the open D3D12/shader PRs. If a split is needed sooner, it must be pure move + no renames in one commit sogit blame/-Mcan follow it, and it should be announced in the coordination issue first.docs/design.md/docs/d3d12_vulkan.mdsplits have the same problem with the docs PRs; an index-only change is the low-risk half.Still true, separate docs PR
ItsNotRexed/Leonida#166,#313,#644,#881(README lines 39, 64-66, 73, 92, 309, 318).CONTRIBUTING.mdalready explains they no longer resolve, and the GPU-results/lead content lives indocs/testing.mdanddocs/boot_leads.mdnow. Note d3d12: serialize and deserialize XDXR acceleration structures (RT-XDXR-SERIALIZE) #626 also editsREADME.md, so coordinate.except Exception:sites (27) are per-site decisions, not a batch: each needs to say what it now catches or converts to a narrower type.The two items in #1956 are deliberately the smallest ones; the rest is prioritisation, not discovery.