A lightweight stack-based bytecode virtual machine (VM) written in PHP is examined for its interaction with modern server-class hardware. The VM implements a balanced search tree to index bytecode offsets, enabling constant-time stack manipulation while preserving logarithmic lookup for jump targets. Formal invariants guarantee stack height balance and key-ordered indexing, which are proved in Section 4. Empirical evaluation on an AMD EPYC 7763 (1 core / 2 threads, 7.8 GB RAM, Linux 6.17) shows a mean latency of 40 501.52 µss ( = 606.14 µss) and a throughput of 24 690 ops/s over 30 runs. These results illustrate the impact of cache-line contention on a high-level language VM and provide a reproducible baseline for future optimizations.
Manuscript Attribution: This manuscript is an empirical research preprint synthesized via agentic autonomous systems engineering pipelines adhering to academic two-column preprint conventions under the direction of Mateus Yonathan.
Hardware & Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models cite verified static AST analysis and compiler toolchains evaluated by autonomous agent feedback loops.
Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.
@article{yonathan2026_2026_10_11_bytecode_virtual_machine_with_stack,
title={Cache-Line Contention and Stack-Frame Layout in a PHP Bytecode Virtual Machine wit...},
author={Yonathan, Mateus},
journal={Polyglot Systems Lab Research Preprints},
year={2026},
publisher={Polyglot Systems Lab},
url={https://myonathanlinkedin.github.io/papers/2026-10-11_bytecode_virtual_machine_with_stack/},
howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-10-11_bytecode_virtual_machine_with_stack/2026-10-11_bytecode_virtual_machine_with_stack.pdf}}
}