Repository navigation
Game code generator in C++: no Python in the releases - #861
Merged
Merged
Conversation
A port of tools/gen.py and its modules: the lifter, the portable SIMD lowering, the patches, the NSO loader with its own LZ4 block decoder, and a small AArch64 evaluator for the jump tables in place of Unicorn. The output is byte-identical to gen.py; tools/test_gen_cpp.py runs both and compares. The Python stays in tools/ as the reference for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/gamebuild.c runs the C++ generator (runtime/gen/) on a thread per module instead of starting the lasgen helper, with the same progress and error reporting. The HLE names and the randomizer's code variants are compiled in. The generator's evaluator now tracks unknown FP values so tables with FP work in their window resolve as with Unicorn, and its scan cache keeps only kind and target (main: 300 MB instead of 1.2 GB). make lasgen builds the command-line tool; make gen uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator runs inside the app, so the releases drop the frozen lasgen helper (macOS, Windows, Linux), Python with Capstone, Unicorn and lz4 in the Android APK, the Windows no-CFG spawn path and its longjmp fix (#337, #779), and the x64 helper Windows ARM64 ran under emulation. Unicorn (GPL 2.0) was the last GPL component in the releases. - Makefile: no gen-helper target or gen-venv; make deps builds no Python - macOS bundle, Windows zip, Linux AppImage: no lasgen/, no gen_helper.sh - Android: build_gen_deps.sh fetches zig only; gen.zip holds zig's lib and the headers; check_apk.sh allows only those - ci, nightly, release workflows: helper and unicorn steps removed - README licence table and build docs updated tools/gen.py stays as the reference (tools/test_gen_cpp.py). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Testers on Android and Linux missed the old generator line: the log now says the generator is built in and how long each module took. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/BUILD-windows.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README: the two ways to get the game code (extracted/ + make gen, or the start screen with tools/fetch_zig.sh), Python only for tests and some dependency scripts, an iOS-from-source section, and the source checkout as a data folder. The platform guides and CONTRIBUTING say the same. Comments that pointed at tools/patches.py and gen.py now point at runtime/gen/ (cpu.h and simd.h left alone: they are part of every compiled object's id, so players keep their compiled objects). make lasgen now uses the host compiler (HOSTCXX): with PLATFORM=ios or a cross ARCH, CXX targets the device and make gen could not run lasgen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An in-place update (the Windows zip) keeps every file the new version doesn't replace, so the lasgen/ helper of older versions (Python and Unicorn) stayed in the app folder. Once the updated version reaches the start screen, its own parts go (lasgen[.exe] and _internal/, which marks it); the folder too if nothing else is in it. Files of the player's own there stay, and a lasgen folder without _internal is left alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The game code generator (tools/gen.py and its modules) is ported to C++ and runs inside the app. No release ships Python any more.
What changed
runtime/gen/: the generator in C++. The lifter, the portable FP/SIMD lowering, the patches, the NSO loader with its own LZ4 block decoder, and a small AArch64 evaluator for the jump tables in place of Unicorn. No Capstone (generation never used it).make lasgenbuilds it as a command-line tool;make genuses it.runtime/gamebuild.c: setup runs the generator on a thread per module instead of starting the lasgen helper, with the same progress and error reporting. The setup log says how long each module took.extracted/+make gen, or the start screen withtools/fetch_zig.sh; an iOS-from-source section; Python only for tests and some dependency scripts), the platform guides and CONTRIBUTING likewise, and code comments now point atruntime/gen/instead of the Python.runtime/cpu.handsimd.hare untouched, so players keep their compiled objects after updating (only the generation step reruns).make lasgenbuilds with the host compiler, somake gen PLATFORM=iosand crossARCH=builds can run it.lasgen/lasgen.exeandlasgen/_internal/) once the new version has reached the start screen, and thelasgenfolder only if nothing else is in it. Only the Windows zip needs this; the macOS app and the AppImage are replaced whole.tools/gen.pystays as the reference until this has shipped. A generator, patch or chunk-cut change goes into both;tools/test_gen_cpp.pychecks they agree.How it was tested
tools/test_gen_cpp.pycompared every file for 1.0.0, 1.0.1 and 1.1.0, main and sdk,--simd asm/c, with and without--dyn-base(24 cases, all identical). The C++ lifter and SIMD lowering were also fuzzed against the Python on several million instruction words (0 differences).Not in this PR
--preparestill needs a Vulkan driver (it opens a window); unchanged by this branch.🤖 Generated with Claude Code