layout: collectLeafIds propagates allocation failure instead of truncating #68

Open
a73x wants to merge 1 commit from forge/collect-leaf-ids-oom into main
a73x commented 2026-09-02 08:03:37 +00:00 (Migrated from git.a73x.sh)

[claude 2026-09-02] Built by a Claude Code agent in eitri VM forge-3, via brokkr; commit exported as a bundle and gated here.

A truncated leaf-id list is not a smaller tree, it is a wrong answer about this one: serialize would write focus K naming a different pane, and remapLeaves would skip a removal so a pane the wall no longer has survived the heal. collectLeafIds now returns Allocator.Error!void; serialize gains a try; remapLeaves gains the error union, and because the collection is taken before the first mutation, OutOfMemory leaves the tree untouched (stated in its doc comment, pinned by a test). seedAttempt catches the new error the same way the five allocation failures around it do.

Gate: make check exit 0 on the dev box (244/244). Two new tests in src/client/layout.zig using std.testing.FailingAllocator.


Migrated from git-collab patche 3262d8a583377667ecd251bb9e64262ae5959a80.

Original author: a73x dev@a73x.sh.

Fixes #53

Revision 1: 63752b67691c166fba98233dece8ce568d657e1a; base bed879b5feeaf38222a658c0230ba58d71413141

[claude 2026-09-02] Built by a Claude Code agent in eitri VM forge-3, via brokkr; commit exported as a bundle and gated here. A truncated leaf-id list is not a smaller tree, it is a wrong answer about this one: serialize would write `focus K` naming a different pane, and remapLeaves would skip a removal so a pane the wall no longer has survived the heal. collectLeafIds now returns Allocator.Error!void; serialize gains a `try`; remapLeaves gains the error union, and because the collection is taken before the first mutation, OutOfMemory leaves the tree untouched (stated in its doc comment, pinned by a test). seedAttempt catches the new error the same way the five allocation failures around it do. Gate: `make check` exit 0 on the dev box (244/244). Two new tests in src/client/layout.zig using std.testing.FailingAllocator. --- Migrated from git-collab patche `3262d8a583377667ecd251bb9e64262ae5959a80`. Original author: a73x <dev@a73x.sh>. Fixes #53 Revision 1: `63752b67691c166fba98233dece8ce568d657e1a`; base `bed879b5feeaf38222a658c0230ba58d71413141`
a73x (Migrated from git.a73x.sh) reviewed 2026-09-02 08:06:39 +00:00
a73x (Migrated from git.a73x.sh) left a comment

[claude 2026-09-02] Review from the dev box, not the author agent.

Read the diff in full. The propagate choice is right: both callers index the list positionally, so a short list is a wrong answer, not a degraded one. remapLeaves collects before its first mutation, so OutOfMemory really does leave the tree untouched, and the new test pins that. seedAttempt's catch mirrors the five neighbouring allocation-failure blocks byte for byte. No inline comments.

Gates:

  • dev box, make check on 63752b67: exit 0.
  • forge-3 (nested guest, 4 vCPU): make check exit 2 — 1086/1088, the one failure is server_test_upgrade "an upgrade asked for during a session's hangup is refused, not attempted", an awaitFrame timeout (400 iters) with no upgrade_reply. Nothing in this patch touches the server; reads as a timing flake on a slow nested host. Not counting it against the patch, but flagging it as a candidate for a slow-host flake issue.

Base is published main (bed879b5), 31 behind the dev box's main; still an ancestor, expect a clean rebase. Leaving approve/merge to the human.

[claude 2026-09-02] Review from the dev box, not the author agent. Read the diff in full. The propagate choice is right: both callers index the list positionally, so a short list is a wrong answer, not a degraded one. remapLeaves collects before its first mutation, so OutOfMemory really does leave the tree untouched, and the new test pins that. seedAttempt's catch mirrors the five neighbouring allocation-failure blocks byte for byte. No inline comments. Gates: - dev box, `make check` on 63752b67: exit 0. - forge-3 (nested guest, 4 vCPU): `make check` exit 2 — 1086/1088, the one failure is server_test_upgrade "an upgrade asked for during a session's hangup is refused, not attempted", an awaitFrame timeout (400 iters) with no upgrade_reply. Nothing in this patch touches the server; reads as a timing flake on a slow nested host. Not counting it against the patch, but flagging it as a candidate for a slow-host flake issue. Base is published main (bed879b5), 31 behind the dev box's main; still an ancestor, expect a clean rebase. Leaving approve/merge to the human.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin forge/collect-leaf-ids-oom:forge/collect-leaf-ids-oom
git switch forge/collect-leaf-ids-oom

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff forge/collect-leaf-ids-oom
git switch forge/collect-leaf-ids-oom
git rebase main
git switch main
git merge --ff-only forge/collect-leaf-ids-oom
git switch forge/collect-leaf-ids-oom
git rebase main
git switch main
git merge --no-ff forge/collect-leaf-ids-oom
git switch main
git merge --squash forge/collect-leaf-ids-oom
git switch main
git merge --ff-only forge/collect-leaf-ids-oom
git switch main
git merge forge/collect-leaf-ids-oom
git push origin main
Sign in to join this conversation.
No reviewers
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!68
No description provided.