Ambyte cost: size proven slices by their length and share literals instead of copying them
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start by reading issue #430 and the Baker Street finding F1 on #432, then trace Core typing for slice and the constant rule to identify what the Echo lowerer and verifier can read. Coordinate the spec, compiler, and Echo judge changes with a component promotion. Done means the two charges stay the same at bounds 32 and 4,352, judges accept the compiler minimum and reject one step or byte below it, and ReplaceRange's before and after costs are recorded.
Written by the indexing model from the issue text.
Description
.dag: issue-dag/2
.id: ambyte-lang/ambyte#433
.kind: task
.type: feature
.blocks: [flyingrobots/jim#5]
.after: [flyingrobots/amblicit#430]
.size_hours: 10
Outcome
Under edict.core-cost/v2, two allocation charges stop scaling with declared maxima that the program never reaches:
- A
slice(b, s, e)whose lengthe - sis proven (constant bounds, or bounds that differ by a constant) produces a result sized at that length, not atb's bound, in steps and in allocation. - A text or byte literal is shared from the package, like other shared values: it is charged its reference (one cell), not a full copy each time it is evaluated.
Why
This is the attribution on #430, for ReplaceRange on jedit#410 at 9e5863d (173,660,515 allocated bytes in total):
- literals copied in full account for about 49.2M;
- slice results for about 8.9M.
After #430, slice still charges its result at the operand's bound (Baker Street finding F1 on #432).
Scope
- Core typing of the slice result, or a proven-length side fact, that Echo's lowerer and verifier can read. The spec, the compiler and every Echo judge change together, with a component promotion.
- The constant rule, in the same way.
Test Plan
- RED: the static charge of
slice(b, 0, 4)grows withb's bound, and a fold that readsb"abcd"100 times allocates the literal 100 times. - GREEN: both are the same at bounds 32 and 4,352. Echo's judges admit at exactly the compiler minimum and refuse one step or byte below it.
- Record ReplaceRange's static steps and bytes 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
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
autofixer: follow-up triage: bug triage: classified triage: correctness triage: has-reproducer
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
tursodatabase/turso#13221 ·
Maintainers usually reply within 1 day
-
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