Rewrite: replace Python engine with LuaJIT implementation #1

Merged
Nieps merged 1 commit from lua_rewrite into main 2026-06-04 09:57:21 +00:00
Owner

The Python battle_engine was too slow for production use. This replaces
it wholesale with the LuaJIT port (previously developed in the separate
battle-engine-lua repo).

Key differences from the Python engine:

  • LuaJIT FFI int64_t fixed-point math (SCALE=1,000,000) — no floats
  • Plugin system supporting status, intercept, and layout extensions
  • O(1) dispatch indexes for pipeline, watchers, and effect hooks
  • Circular stat solver via Tarjan SCC + Gauss-Jordan matrix inversion
  • xoshiro128** PRNG (deterministic, re-seeded per battle)
  • 309 tests passing

The old Python code is fully removed. The lua_battle_engine repo on
Forgejo will be archived after this merge.

The Python battle_engine was too slow for production use. This replaces it wholesale with the LuaJIT port (previously developed in the separate battle-engine-lua repo). Key differences from the Python engine: - LuaJIT FFI int64_t fixed-point math (SCALE=1,000,000) — no floats - Plugin system supporting status, intercept, and layout extensions - O(1) dispatch indexes for pipeline, watchers, and effect hooks - Circular stat solver via Tarjan SCC + Gauss-Jordan matrix inversion - xoshiro128** PRNG (deterministic, re-seeded per battle) - 309 tests passing The old Python code is fully removed. The lua_battle_engine repo on Forgejo will be archived after this merge.
The Python battle_engine was too slow for production use. This replaces
it wholesale with the LuaJIT port (previously developed in the separate
battle-engine-lua repo).

Key differences from the Python engine:
- LuaJIT FFI int64_t fixed-point math (SCALE=1,000,000) — no floats
- Plugin system supporting status, intercept, and layout extensions
- O(1) dispatch indexes for pipeline, watchers, and effect hooks
- Circular stat solver via Tarjan SCC + Gauss-Jordan matrix inversion
- xoshiro128** PRNG (deterministic, re-seeded per battle)
- 309 tests passing

The old Python code is fully removed. The lua_battle_engine repo on
Forgejo will be archived after this merge.
Nieps merged commit 0291383807 into main 2026-06-04 09:57:21 +00:00
Nieps deleted branch lua_rewrite 2026-06-04 09:57:21 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
wisteria/battle-engine!1
No description provided.