mirror of
https://github.com/brazilofmux/tinymux
synced 2026-08-13 00:23:11 -04:00
Full smoke is green with mudconf.lua_jit forced on (1428/1428) and with the default off. Add an opt-in make target so CI/devs can exercise the bytecode→HIR→DBT path without flipping production defaults. Update plan-lua-jit-bringup and audit-coverage D4 for #1309 progress. Engage assert (lua_run_ok) still waits on Hatsuhara #1317 jitstats keys.
3.2 KiB
3.2 KiB
Lua JIT bring-up plan (#1278 / #1309)
Owner: Grok (wip-grok) on #1309
PR: https://github.com/brazilofmux/tinymux/pull/1321
Related: #1278 (loader), #1316/#1317 (Hatsuhara: jitstats Lua counters), #1315 (Win64 tier-2 buffer)
Story (corrected)
- Lua interpreter works; smoke was green only on that path.
lua_bc_load/read_int()treated Lua 5.4 varints as raw 4-byte ints since the pipeline landed (2026-03-18). Every compile failed →hir_lower_luanever ran.- Fixing the loader revealed empty folds, wrong results, and a softcode-
reachable hang in
dbt_run(#1309). Not a regression of the loader — the code had never been exercised.
Phases
| Phase | Goal | Status |
|---|---|---|
| 0 Hygiene | Claim #1309, worktree, plan | done |
| 1 Safety gate | mudconf.lua_jit default off |
done (#1310) |
| 2 Loader | read_int varint |
done (#1310) |
| 3a Correctness | Trailing RETURN, MMBIN, code→memory, sref ATOI, nest | done (PR #1321) |
| 3b/c Suite | Full smoke with lua_jit 1 |
done — 1428/1428 |
| 3d Opcodes | Deeper HIR audit / HIR_NEG discrimination | open |
| 3e Limits | Win64 tier-2 buffer (#1315 Hatsuhara) | open |
| 4 Default-on + engage assert | Flip default; require lua_run_ok (#1317) |
next |
Phase 3a root causes (fixed)
| Symptom | Cause |
|---|---|
Empty return "hello" |
Trailing Lua RETURN overwrote real result with "" |
Empty return 42 |
Fold ICONST→digit SCONST at return |
| Empty folds | No hir_build_cfg → block_last=-1 → codegen skipped all insns |
| False multi_block | RETURN marked next PC as leader |
| Skipped RETURN after ADD | Extra pc++ past MMBIN |
mux.args chaos / hang |
Map to CARGS; ATOI runtime_ref; copy rc.code into guest memory |
| Softcode JIT → fun_lua hang | Refuse nested run_cached_program |
| Spin at guest PC 0 | Zero code region (missing code copy) → illegal op → exit_with_pc(same) |
Smoke verification (Unix/macOS, this tree)
# Default (interpreter-only Lua) — part of make test
make test # or: cd testcases && ./tools/Smoke
# Force Lua JIT path — opt-in
make test-lua-jit
# equivalent: SMOKE_EXTRA_CONF='lua_jit 1' ./tools/Smoke
Results (2026-07-26):
| Config | Result |
|---|---|
lua_jit 0 (default) |
1428/1428 |
lua_jit 1 |
1428/1428 |
Coverage pin (before default-on)
Interpreter-only green is not enough. Need:
- Engage assert — after
lua(), requirelua_run_ok > 0viajitstats()
(Hatsuhara #1317 / #1316 — do not reimplement; merge then wire smoke TC). - Optional control: delete
HIR_NEGcodegen → TC059/TC060 fail underlua_jit 1.
Claim map
| Ticket / work | Label |
|---|---|
| #1309 bring-up epic | wip-grok |
| #1278 loader | wip-kagura (landed via #1310) |
| #1316/#1317 jitstats Lua counters | wip-hatsuhara |
| #1315 Win64 tier-2 buffer | wip-hatsuhara |
Next
- Land #1321; rebase if needed after #1317.
- Smoke TC:
lua_jit 1+jitstats()requirelua_run_ok>0(needs #1317). - Windows: #1315 before flipping default on.
- Then Phase 4:
mudconf.lua_jitdefaulttrue.