Skip to content

owned collections have no element-transfer iteration (await_all/await_first double-own their tasks) #724

Closed

Description

@ehartford

Surfaced by removing the #714 demand (spec proofs ss14_11 ×2 now fail at runtime with invalid free instead of compile-time).

await_all[T](tasks: impl IntoIter[Task[T]]) OWNS its collection, but the collect loop cannot take ownership of the elements:

Pre-#712, for x in owned_vec consumed — sound for an OWNED collection; the ruling retired it for borrows, and owned-collection element transfer went with it. That's the missing half: an owned collection's elements should be movable by iteration (Rust: into_iter(); Vale: owned lambda-consume), or the awaiting APIs need a concrete-Vec surface.

Until then spec_ss14_11_await_combinator_cancel_joins and spec_ss14_11_collection_await stay red as this issue's evidence (their compile-time failure was #714, now removed; the runtime failure is this).

Activity

  1. ehartford commented on Aug 31, 2026

    @ehartford
    ContributorAuthor

    Triage re-scope 2026-08-31 — SPEC/DECISIONS CONTRADICTION surfaced: spec §13 has normatively listed for item in my_vec.into_iter(): // consuming (moves elements) since 2026-02-24, while decisions.md D23 says #724 'needs its own design ruling'. The bible and the log disagree. Premise verified live (into_iter unknown on Vec[str]; both ss14_11 fixtures still pinned known-issue: #724). Resolution needs Eric: either strike/reaffirm §13's into_iter text, or bless it and this issue becomes 'implement §13's spec'd consuming iteration'.

  2. ehartford commented on Aug 31, 2026

    @ehartford
    ContributorAuthor

    Ruled (D33, 2026-08-31). §13 reaffirmed: into_iter() is the consuming surface; D23's deferral is satisfied by the D27 composition (access observes, transfer is explicit — into_iter() is the loop-shaped remove). for x in collection: stays borrow-only per #712.

    Approved campaign:

    • VecIntoIter[T] (owning) + move fn into_iter() on Vec + Iter impl — the iterator owns the tail; early exit drops un-yielded elements + buffer via ordinary Higher RAII
    • rename the misnamed borrow-only IntoIter trait + introduce a genuine consuming trait (naming pair goes to Eric before it lands)
    • respell await_all/await_first onto consuming iteration — the double-own dies structurally
    • acceptance: ss14_11 ×2 unpinned; --debug-alloc fixtures for full-consume, break-early tail drop, error path, and a moved-iterator (iterator value moved then driven, drop-exactly-once)

    A for x in move xs: keyword spelling is deferred as possible future sugar over into_iter(), not a competing surface.

    Ruling record: docs/decisions.md D33 (4576870).

  3. ehartford commented on Sep 1, 2026

    @ehartford
    ContributorAuthor

    D33 campaign complete (ruling: docs/decisions.md D33; landed through 3305b68 on main).

    • VecIntoIter[T] + move fn into_iter() — §13's consuming surface, implemented and reaffirmed
    • Naming pair per Eric's ruling: IntoIter consumes, Iterable borrows (Vec/BTreeMap/BTreeSet re-titled)
    • await_all/await_first/await_any/await_settled genuinely OWN their tasks: elements move in via into_iter(), awaits transfer via remove (order-vec preserves result slots), tails drain by transfer — the double-own that motivated this issue is dead structurally
    • The chase also uncovered and fixed the Result ok()/err() eliminator double-free (payload extracted while the receiver's drop stayed live — why error strings printed empty), pinned in da_result_err_extract
    • Acceptance: spec_ss14_11_collection_await runs GREEN UNPINNED, leak 0 — first time. The cancel twin re-pins to Cancellation protocol gap: async caller of a sync-but-suspending fn uses the cancelled callee's garbage return (invalid free) #916, a distinct pre-existing cancellation-protocol gap (async caller of a cancelled sync-but-suspending callee consumes its garbage return) root-caused to the missing caller-side FIBER_CANCELLED_RETURN check, filed with a 30-line repro and fix shape.
    • Full battery green: build, fixpoint, :move-audit, :drop-audit (zero cells moved vs seed baseline), :test with evidence recorded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions