Skip to content

Add Lua-style table array part - #29

Merged
esrrhs merged 2 commits into
masterfrom
feat/table-array-part
Oct 11, 2026
Merged

esrrhs merged 2 commits into
masterfrom
feat/table-array-part

Conversation

@esrrhs

@esrrhs esrrhs commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a Lua-style contiguous integer-key array region to VarTable, including capacity growth, migration from hash storage, and array-aware integer get/set paths.
  • Keep JIT C runtime, native table implementation, interpreter iteration, table dumps, and struct layout consistent; pairs order is spec fields, array entries, then hash entries.
  • Add cross-backend coverage for append, reverse/sparse filling, nil holes, table.insert/remove, and mixed keys.
  • Mark benchmark documentation as historical because its table measurements predate this implementation.

Validation

  • Focused array-part test passes across the available JIT backends.
  • The selected broader suite reported 1,140 passing tests.
  • GCC benchmarks showed improvements in table-heavy cases (for example BubbleSort/200 and Sieve/5000); benchmark timing is load-sensitive on this 2-core machine.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov-commenter

codecov-commenter commented Oct 10, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 82.08955% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.99%. Comparing base (9fd9be6) to head (e32a9f3).

Files with missing lines Patch % Lines
src/native/table/native_table.cpp 79.31% 24 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
- Coverage   88.20%   87.99%   -0.22%     
==========================================
  Files         124      124              
  Lines       25259    25388     +129     
==========================================
+ Hits        22280    22339      +59     
- Misses       2979     3049      +70     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…d update benchmarks

- C runtime & native runtime: update FlArrResizeInsert / TableArrResizeInsert to insert into vacated hash slots when keys do not fall into the newly expanded array, avoiding degenerate rehashes
- Tests: expand test_table_array_part.lua with comprehensive coverage for table.move overlapping copies, float-int key normalization, 512-item boundary scaling, sparse hole filling, table.create, and unpack/pack
- Tests: add native C++ unit tests in test_table.cpp covering reverse insertions in quick_data/bucket mode and nil-hole export conversion
- Docs: update benchmark READMEs with latest measurements and observations reflecting array part improvements
@esrrhs
esrrhs merged commit 2c89572 into master Oct 11, 2026
9 checks passed
@esrrhs
esrrhs deleted the feat/table-array-part branch October 11, 2026 14:13
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.

2 participants