collections: rebuild ArrayList, the hash tables and the tries on Buffer #55
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
With
Buffer<Item>, the collections become TorbScript instead of runtime code.Source
Acceptance criteria
ArrayList, the hash tables and the tries in TorbScript onBufferDependencies
Buffer<Item>as the heap storage primitive)Notes
Adds or changes a native, syntax or a name the compiler looks up: land it in two commits (teach both forms, refresh the seed, then migrate), as
CLAUDE.md"Seed and breaking changes" says.Moved from the planning lists of the docs; the design record stays the specification.
Steps
docs/design/COLLECTION-STORAGE.md(#413)std/are ordinary types,Buffer.holdsClose, cost baselines (#468, PR #474)ArrayListoverBuffer, its 12 rows removed (#526)TrieListdelegating toArrayList(filed when step 3 lands)HashMapoverBufferHashSetoverBuffer,runtime/map.cremovedTrieMapandTrieSetdelegatingtrie-forkand the ratios hold[loop:torbscript] intake: in scope (author orion, label loop), sources ROADMAP.md kernel of natives and COLLECTIONS.md gap 6, not a duplicate. Large and seed-relevant (two-commit rule), performance claim ("no slower") is measured in forge CI; refine splits it per collection. Depends on #54. next: waiting (dependency #54 and ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z
Buffer<Item>as the heap storage primitive #54[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T06:16:00Z
ArrayList, the hash tables and the tries onBuffer(step 1 of #55) #413[loop:torbscript] refine: epic, not
ready; step 1 filed as #413 and markedready(not this issue), next: waiting (epic waits on its steps)decided by the loop: #55 is too large for one PR. Why: the compiler names
ArrayListin about 200 places (list literals, element access and write lowering, the manifest rows,RuntimeKind.ListStorage);HashMap/HashSetstand onruntime/map.c, which #56 is changing (torb_map_slot);TrieList/TrieMap/TrieSetare documented aliases of the flat storage today, not tries; andBuffersharesArrayList's runtime list, so the natives only go away once the representation, the O(1) sharedArrayList.sliceagainst the copyingBuffer.slice, and the order against #52/#53/#56 are decided. #54, #299 and #300 are closed, so the dependency is met.Step 1 is #413, a design record (
docs/design/COLLECTION-STORAGE.md): representation ofArrayList, hash table layout againstruntime/map.c, tries (real or aliases), the benchmarks that bound each slice ("no slower" as a ratio on the same forge CI runner), the manifest rows each slice removes, and the slice list. Documentation only, no seed impact. Keyword search of open and closed issues (Buffer, collections, ArrayList, Trie, HashMap, storage, design record) found no duplicate; #52/#407 and #53/#410 are related natives work, not the same.Remaining steps, filed one at a time when each starts, each under the two-commit rule where it adds or removes a native:
ArrayListonBuffer, the hash tables (after #56 lands), the tries, and the removal of the leftover runtime natives. The seed refresh stays Torben's. Tokens used by this refine run: about 110k.std/tensoron the CPU (step 1 of #82) #438std/tensoron the CPU #82std/tensoron the CPU #82[loop:torbscript] claim refine by session:loop-torbscript-20261024 until 2026-10-24T09:10:00Z
Buffer.holdsClose(step 2 of #55, commit 1 of 2) #468[loop:torbscript] refine: step 2 filed as #468 and marked ready, next: waiting (epic waits on its steps, #468 next). Step 1 (#413) verified landed on main (docs/design/COLLECTION-STORAGE.md present). Tokens used: about 60k
[loop:torbscript] claim refine (next step of the epic after #468) by session:loop-torbscript-20261027 until 2026-10-27T05:30Z
ArrayListis a type overBuffer(step 3 of #55, commit 2 of 2) #526ArrayListis a type overBuffer(step 3 of #55, commit 2 of 2) #526[loop:torbscript] refine: #468 verified landed on main (PR #474, merged 2026-10-25) and the published seed
c72cabec00edcontains it; step 3 filed as #526 (slice 1 commit 2 of 2,ArrayListoverBuffer) and markedready; checklist added to this issue's body. Tokens used: about 120k. next: waiting (epic waits on its steps, #526 next)