feat: add Lua scripting integration and web dashboard#15
feat: add Lua scripting integration and web dashboard#15KaiserGranatapfel merged 1 commit intomainfrom
Conversation
Add two new workspace crates (gcrecomp-lua, gcrecomp-web) providing a Lua 5.4 scripting layer for pipeline orchestration, configuration, in-game UI, verification, and optimization — plus a localhost web dashboard for recompilation management. - gcrecomp-lua: LuaEngine with mlua bindings for GameConfig, pipeline stages, CpuContext, MemoryManager, UI screen registration, CRC32/SHA256 verification, and dead code elimination / size optimization - gcrecomp-web: Axum-based REST server with DOL upload, recompilation control, status polling, config management, and static HTML frontend - Refactor RecompilationPipeline into discrete stage methods via PipelineContext (backward compatible) - Enhance Optimizer with li/addi/lis constant propagation and function-level DCE via call graph reachability - Add LuaScreen variant to iced UI for Lua-defined menu screens - Add optional Lua event handler delegate to GameIntegration - Initialize LuaEngine in game entry point Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| rust_code.push_str(&format!( | ||
| "pub fn {}_0x{:08X}(_ctx: &mut CpuContext, _memory: &mut MemoryManager) -> Result<Option<u32>> {{\n", | ||
| codegen.sanitize_identifier(&func.name), func.address | ||
| )); |
There was a problem hiding this comment.
Stub function names don't match dispatcher references
High Severity
Stub function definitions use the format {name}_0x{:08X} (with 0x prefix), but the dispatcher at the bottom of the generated code uses {name}_{:08X} (without 0x prefix) for non-sub_ names, and func_0x{:08X} (completely different base name) for sub_/empty names. This naming mismatch means the dispatcher references functions that don't exist, causing the generated Rust code to fail compilation whenever any function falls back to a stub. The dispatcher naming matches generate_function_signature for successful functions, but diverges from the stub naming convention.
Additional Locations (1)
| let output = std::process::Command::new(&binary_path) | ||
| .arg("--smoke-test") | ||
| .output(); | ||
|
|
There was a problem hiding this comment.
Smoke test ignores timeout parameter, may hang
Medium Severity
The smoke_test binding accepts a timeout_ms parameter (prefixed with _ to suppress warnings) but never applies it. The process is spawned via Command::new(...).output(), which blocks indefinitely. Callers like lua/verify/default.lua pass 10000 expecting a 10-second timeout, but the test will hang forever if the binary doesn't exit on its own.


We're getting closer.
Note
Medium Risk
Adds a new embedded scripting layer and an HTTP upload/recompile service, increasing attack surface and adding concurrency/IO paths; core changes are mostly additive but touch the recompilation pipeline orchestration and optimization logic.
Overview
Adds first-class Lua scripting integration via new
gcrecomp-luacrate (mlua) with bindings to config IO, pipeline stage orchestration, CPU/memory access, verification utilities (CRC/SHA, smoke test), basic output optimization helpers, and a registry for Lua-defined UI screens; thegamebinary now initializesLuaEngineand loadslua/game/init.lua.Introduces a new local web dashboard (
gcrecomp-web) using Axum/Tokio that servesweb/staticand exposes/apiendpoints to upload/validate DOLs, run recompilation stages asynchronously with status/stats reporting, and get/update UI config.Refactors
gcrecomp-coreto support scripting/orchestration: addsPipelineContext+PipelineStatsand discretestage_*methods, and enhances the optimizer with improved register-based DCE plus areachable_functionshelper for call-graph reachability;gcrecomp-uigains aLuaScreenplaceholder and optional Lua event handler hook. Workspace config is updated with new crates/dependencies andpanic = "abort"in release.Written by Cursor Bugbot for commit df9a0e7. This will update automatically on new commits. Configure here.