Ambyte cost v2: persistent lists so append is not charged (or copied) at the declared maximum
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- backend, performance
Research direction
Start by reading the v2 cost spec and the named compiler and Echo paths: echo-edict-pure/src/shared_reads/value.rs, expression.rs, and fold_work/shared_reads.rs. Then trace list append through the compiler and Echo judges, and review the conformance vectors from #424 and #432. Done means append uses a persistent representation, all components agree on its charge, the verifier rejects an undercharge, and the rope package comparison is recorded.
Written by the indexing model from the issue text.
Description
.dag: issue-dag/2
.id: ambyte-lang/ambyte#438
.kind: task
.type: feature
.blocks: [flyingrobots/jim#5]
.size_hours: 16
Outcome
Under edict.core-cost/v2, listAppend on a list with a large declared maximum costs O(log n) or O(1), not a full shell. Echo's shared runtime stores lists in a persistent structure, for example a chunked Rc tree with 32-way nodes, so an append really is O(log n). The spec, the compiler, and Echo's lowerer, verifier and evaluator all charge it the same way, as #424 and #432 did.
Findings (2026-12-03, amblicit a0542b53, echo fe06a8ef)
- Passing or carrying a value is not charged by its size under v2. Calling a helper with a 4,352-byte atom argument costs the same as with a U64: 10 extra calls add 389,120 vs 394,240 steps on jedit#410's rope package.
- Echo really copies on append.
echo-edict-pure/src/shared_reads/value.rsstores a list asRc<[Shared]>, soexpression.rs:660copies the reference array, which is O(actual length), and charges a shell of length + 1. - The compiler charges every append at the declared maximum.
fold_work/shared_reads.rslist_shelluses the proven length when it has one and the declared maximum otherwise. The rope arena's lists (stored256,branches128, the 512-entry queue, the 256-entry walk order) are appended to inside folds, so every append is charged 129 to 513 cells. - Where the bytes go. On jedit#410 (static U 83,964,734 steps, 173,660,515 bytes), the folds that append carry most of the allocation:
loadStep31.4M,flatStep22.6M,compareStep14.2M,walkStep11.9M,checkStep11.0M.
Scope
- A persistent list representation in Echo's shared runtime, with append, at and length in O(log n).
- A charge rule for append as a constant plus a log-depth term, independent of the declared maximum, in the spec, the compiler and every Echo judge.
- Conformance vectors shared by the compiler and Echo.
Test Plan
- RED: a fold appending to a
List<U64, max=256>is charged about 257 cells per append. - GREEN: the charge is the same for declared maxima 16 and 256; Echo's runtime append does not copy the item array (pointer test); the verifier refuses a module that claims a lower charge.
- Rebuild jedit#410's rope package and record static U and allocation before and after.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from flyingrobots/edict
-
Update Wasmtime to 48.0.11 for RUSTSEC-2026-0648Possibly taken @flyingrobots claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flyingrobots/edict#457 ·
-
enhancement type: goalpost
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
flyingrobots/edict#355 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
flyingrobots/edict#306 ·
-
enhancement type: goalpost
Difficulty 4/5 3-5 days Newbie friendliness 42/100
flyingrobots/edict#451 ·
-
enhancement release:target-ir
Difficulty 5/5 Over a week Newbie friendliness 28/100
flyingrobots/edict#450 · 1 comment · 1 reaction ·
All issues in flyingrobots/edict
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
approved
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
fritzprix/libr-agent#3266 ·
Maintainers usually reply within 1 day
-
Frame::second_to_frame truncates f32 product, causing periodic off-by-one framesPossibly taken @ShamanicArts claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dmtrKovalenko/fframes#296 ·
Maintainers usually reply within 1 day
-
marketing
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Maintainers usually reply within 1 day