Ambyte fold: early stop with a value, charging only active rounds (2026-11-29 loop standard)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Read SPEC_edict-language-v1.md and SPEC_ambyte-core-semantics-v0, especially the fold and loop-round rules in Table 5. Then inspect the oracle, Core IR, conformance fixtures, and docs named by the issue to determine where fold semantics are defined and tested. Decide and document the source form, add the new Core capability, and update the specs, oracle, docs, and CHANGELOG; done means the round-3-of-256 test charges three active rounds plus stop tests while preserving the full static bound, and the mutant that continues after stopping fails.
Written by the indexing model from the issue text.
Description
.dag: issue-dag/2
.id: ambyte-lang/ambyte#422
.kind: task
.type: feature
.blocked_by: []
.size_hours: 8
Outcome
A source fold can stop before its bound with a value. The compiler's Core and its static cost follow the 2026-11-29 loop standard: rounds are charged one per active round, and no round is entered after the fold stops. The static bound stays the full literal bound.
Why
EDICT-LANG-FOLD-001 (SPEC_edict-language-v1.md, "There is no early exit … all N iterations still count") contradicts the owner's 2026-11-29 standard (SPEC_ambyte-core-semantics-v0, Table 5: "Loop round: once per active round … A fold round after a round with no result is not entered and is not charged").
In v0, a round with no result makes the fold's join inactive. A fold therefore cannot both stop early and return its accumulator, and that is the case ReplaceRange needs.
Measured on flyingrobots/jedit#410 @ 88554e1 (echo#1124 harness):
- ReplaceRange's folds run 256
loadStep, 257walkStep, 128branchIdStep, 64compareStepand 9×16 emission rounds whatever the edit. - Even with every idle round returning first,
middle-ascii-insertstill pays 82,806 steps inloadStepand 42,191 inwalkStep, mostly in idle rounds.
Scope
- Source form: either the step returns
Stop(S) | Continue(S), or the fold takes astop: S -> Boolhelper. Decide which in this issue, and record the choice. - Core form: a new capability, for example
core.fold-until/v1. - A fold of zero rounds returns its initial value. A stopped fold returns the last state.
- Static cost is the full bound, unchanged. The runtime charge covers the entered rounds only, plus the stop test of each entered round.
- The v0 semantics spec, the language spec, the oracle, and the docs and CHANGELOG.
Test plan
- RED: a fold whose state finishes in round 3 of 256 charges 256 rounds today.
- GREEN: the same fold charges 3 rounds plus the stop tests in the oracle, and its static bound is unchanged.
- A mutant that keeps running after the stop fails.
- 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