Skip to content

perf: column-kernel Lua boundary — feed ItemColumn output into the VM without per-element boxing (roadmap step 2, gated on profiling) #161

Description

@Liam0205

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Priority 4 — parked / roadmap end; do not start without explicit triggerenhancementNew feature or requestpending

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions