layout.zig collectLeafIds swallows OOM with catch {} #53

Closed
opened 2026-08-25 09:41:45 +00:00 by a73x · 3 comments
a73x commented 2026-08-25 09:41:45 +00:00 (Migrated from git.a73x.sh)

serialize's focus block and remapLeaves both call collectLeafIds, which appends with catch {} — an OOM truncates the leaf-id list silently. For serialize the degrade is benign (focus id not found -> no focus line written), but remapLeaves feeding a truncated list would heal wrongly. Hygiene: propagate the error or document why truncation is safe at each call site. Found in chunk-3 review (hf2, lens 4), deferred past v0.0.1-13.


Migrated from git-collab issue 4e4b35539ef8a41b4c56b36471879406c5441739.

Original author: a73x dev@a73x.sh.

Close reason: fixed in 15b5fbcc: collectLeafIds propagates the allocation failure

serialize's focus block and remapLeaves both call collectLeafIds, which appends with catch {} — an OOM truncates the leaf-id list silently. For serialize the degrade is benign (focus id not found -> no focus line written), but remapLeaves feeding a truncated list would heal wrongly. Hygiene: propagate the error or document why truncation is safe at each call site. Found in chunk-3 review (hf2, lens 4), deferred past v0.0.1-13. --- Migrated from git-collab issue `4e4b35539ef8a41b4c56b36471879406c5441739`. Original author: a73x <dev@a73x.sh>. Close reason: fixed in 15b5fbcc: collectLeafIds propagates the allocation failure
a73x commented 2026-08-29 12:30:24 +00:00 (Migrated from git.a73x.sh)

2026-08-29: still there — src/client/layout.zig:699, ids.append(alloc, t) catch {}.

2026-08-29: still there — src/client/layout.zig:699, ids.append(alloc, t) catch {}.
a73x commented 2026-09-02 08:03:28 +00:00 (Migrated from git.a73x.sh)

[claude 2026-09-02] Picked up by a Claude Code agent inside eitri VM forge-3 (software-factory spike). Fix: collectLeafIds propagates OutOfMemory; serialize and remapLeaves gain the error union; seedAttempt degrades to the default cut like its neighbours. Two FailingAllocator tests pin that a failed walk refuses rather than misnaming the focus, and that remapLeaves leaves the tree untouched. The guest had no signing key, so the patch is filed from the dev box off the exported commit.

[claude 2026-09-02] Picked up by a Claude Code agent inside eitri VM forge-3 (software-factory spike). Fix: collectLeafIds propagates OutOfMemory; serialize and remapLeaves gain the error union; seedAttempt degrades to the default cut like its neighbours. Two FailingAllocator tests pin that a failed walk refuses rather than misnaming the focus, and that remapLeaves leaves the tree untouched. The guest had no signing key, so the patch is filed from the dev box off the exported commit.
a73x commented 2026-09-02 09:18:09 +00:00 (Migrated from git.a73x.sh)

[claude 2026-09-02 hygiene run] Patch 3262d8a5 (forge/collect-leaf-ids-oom, 63752b67) cherry-picks cleanly onto main at 005be213 and make check passes with it applied. Ready to land; not merged by the hygiene run.

[claude 2026-09-02 hygiene run] Patch 3262d8a5 (forge/collect-leaf-ids-oom, 63752b67) cherry-picks cleanly onto main at 005be213 and make check passes with it applied. Ready to land; not merged by the hygiene run.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
a73x/mux#53
No description provided.