Skip to content

feat(runtime): reuse codec allocations and KVSpace addresses - #364

Closed
carsontung666 wants to merge 4 commits into
array2d:masterfrom
carsontung666:feat/interpreter-hotpaths
Closed

carsontung666 wants to merge 4 commits into
array2d:masterfrom
carsontung666:feat/interpreter-hotpaths

Conversation

@carsontung666

@carsontung666 carsontung666 commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Change

Reuse codec allocations and decoded instruction addresses in the default executor. Cached key references accelerate current KVSpace reads, result writes, and PC persistence; small input snapshots are released after each instruction. Preserve cache collision chains across calls/returns and remove redundant frame directory creation.

PC, status, operands, and frame values remain in KVSpace. Reject malformed None-shaped writes without deleting their destination or advancing PC.

Performance

Incremental comparison against previous PR head ddac99ab and SHM backend 703797b9: all 10 repository workloads / 30 frozen scales, 9 alternating baseline/candidate/Python pairs (810 samples), matching outputs. Same Release CLI/layout/frontend, matched -O3 backend flags and allocator, CPU 24, Xeon Gold 6418H, GCC 14.3, Python 3.10.12; fresh stores.

Measurement Geometric mean speedup
Algorithm execution 1.207x
Whole CLI, including startup/layout 1.021x

Startup/layout and recursive frame work still dominate. This is not a large whole-command gain; Python algorithm timers remain about 85–1670x faster. All samples, medians, hashes, and reproduction command.

Validation

Full SHM and FS tutorials: each 222 passed, 0 failed, 1 extern/WIP skip (FS verified in CI). Runtime 11/11, SHM backend 7/7, frontend 2/2 CTests; 44 old/new frontend/backend compatibility checks. Clang ASan/UBSan runtime tests: 11/11, including malformed writes and live updates through a second handle. Fresh independent agent review passed, including 520 differential reference-write checks.

Native macOS runtime, layout, and runtime-rs builds passed on final head 69309ca; backend macOS build/tests passed on a10d60f.

Write acceleration uses the optional API in kvspace #29 and kvspace-c #42; older libraries retain normal writes. Performance claims apply to SHM; FS receives correctness coverage, and Redis performance is untested.

@carsontung666 carsontung666 changed the title feat(runtime): reuse codec allocations and execution keys feat(runtime): reuse codec allocations and KVSpace addresses Oct 8, 2026
@carsontung666
carsontung666 deleted the feat/interpreter-hotpaths branch October 17, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant