Context
After PR #155, Lua common-mode collects the input column via the batch API (one lock + one lookup), but pushing it into the VM is still per-element: gopher-lua/wangshu build the table one boxed element at a time (SetGlobal([]any) → makeArrayTable), LuaJ sets table slots per element, LuaJIT does per-element set_global_table fills.
The wangshu Arena column-track ABI prototype quantified the boundary headroom: N=100 -22%, N=3000 -46% on the Boundary microbench (B/op -83%~-87%). See llmdoc/memory/decisions/perf-evolution-roadmap.md step 2.
Why gated
Per the roadmap's own restraint clauses:
- (a) Boundary microbench ≠ calibrated end-to-end referee; engine framework dilutes boundary gains to single digits e2e
- (b) Landing requires changing the Lua script access convention (
field[i] → arena.field[i]), and lua_script is a byte-identical four-engine artifact — this is a cross-engine project (apple/ layer script rewrite first, then all engines + cross-validate byte-parity), not a local optimization
- (c) Trigger condition: only when profiling proves the common-mode boundary is a production e2e hotspot
Trigger
Do not start until a production (or calibrated-fixture) profile attributes a meaningful share of request cost to the common-mode host→VM column push. This issue exists to keep the batch-API → VM-boundary linkage from being forgotten, with the trigger condition written down and owned.
References
- llmdoc/memory/decisions/perf-evolution-roadmap.md (step 2, restraint clauses a/b/c)
- llmdoc/memory/reflections/wangshu-borrow-optimization-survey.md (boundary quantification)
- llmdoc/reference/lua-backend.md (arena ABI contract)
Context
After PR #155, Lua common-mode collects the input column via the batch API (one lock + one lookup), but pushing it into the VM is still per-element: gopher-lua/wangshu build the table one boxed element at a time (
SetGlobal([]any)→ makeArrayTable), LuaJ sets table slots per element, LuaJIT does per-elementset_global_tablefills.The wangshu Arena column-track ABI prototype quantified the boundary headroom: N=100 -22%, N=3000 -46% on the Boundary microbench (B/op -83%~-87%). See llmdoc/memory/decisions/perf-evolution-roadmap.md step 2.
Why gated
Per the roadmap's own restraint clauses:
field[i]→arena.field[i]), andlua_scriptis a byte-identical four-engine artifact — this is a cross-engine project (apple/ layer script rewrite first, then all engines + cross-validate byte-parity), not a local optimizationTrigger
Do not start until a production (or calibrated-fixture) profile attributes a meaningful share of request cost to the common-mode host→VM column push. This issue exists to keep the batch-API → VM-boundary linkage from being forgotten, with the trigger condition written down and owned.
References