Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Offset and descending sparse integer keys skip the compact numeric slots (#31 follow-up)

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
lua
Domain
databases

Research direction

The admission check is in the sparse branch of lr_rawset in src/runtime.eigs, with the k <= 2*(live+1) test as the gate for compact numeric slots. Read that branch alongside tools/measure/table-memory.lua to see how the existing sparse row is produced, then add offset and descending modes to that script. Done means offset and descending sparse integer keys at density of at least 1/2 land within 1.5x of the ascending sparse row's memory per entry.

Written by the indexing model from the issue text.

Description

enhancement front-end help wanted

After the #31 compact-table work (fix-31 round 2, 79f76d8), integer keys only use the compact numeric slots when k <= 2*(live integer hash keys + 1) (src/runtime.eigs, sparse branch of lr_rawset). That favours keys that are dense starting from low indices, like the benchmark's root[2*i]. Other sparse integer shapes still take the identity map: an encoded string key per entry, plus key/value slots.

  • Offset sparse keys (t[1003], t[1005], ...): the key stays about 1000 above 2×live, so admission never succeeds.
  • Descending sparse keys (for k = 2000000, 2, -2 do t[k] = 1 end, 1M live): 1,096,380 KB on EigenLua vs 39,080 KB on PUC Lua 5.4 (main: 1,388,768 KB).

Found by the blind critic on fix-31 round 2.

Done when

Sparse integer keys at density >= 1/2 use roughly the same memory per entry whatever their starting offset or insertion order. tools/measure/table-memory.lua gains offset and descending sparse modes, and they come within 1.5x of the ascending sparse row.

Dominant language
Lua
Stars
0
Forks
0
Avg merge
54m
Merged PRs (30d)
19

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InauguralSystems/EigenLua

All issues in InauguralSystems/EigenLua

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.