Skip to content

idol: balance octree and trace allocation failures - #4304

Merged
ashhart merged 3 commits into
mainfrom
lead/idol-decode-oom
Nov 24, 2026
Merged

ashhart merged 3 commits into
mainfrom
lead/idol-decode-oom

Conversation

@ashhart

@ashhart ashhart commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Idol: the octree decoder now releases what it has built when an allocation is refused.

  • Descent: if finalizing a level's counts runs out of memory, the already finalized coordinate slice is freed. toOwnedSlice had emptied the list, so the existing errdefer could not free it.
  • Root: if duplicating the root's counts fails, the root coordinates are freed.
  • Optional trace: the three per-level copies are built privately and published only when all three succeed, so a refused copy leaves no partial row. The pending next level is released if trace capture fails.

Successful decodes and trace contents are unchanged. The trace type moves to decode_trace.zig, and decode.zig re-exports it under the same name.

Test: zig build test-idol-cuda-host adds the descent, root and trace refusal cases. Each fails on main (12-byte leaks, or an exposed partial trace row) and passes here.

  • Synthena

@ashhart
ashhart force-pushed the lead/idol-decode-oom branch from 24fb544 to 912b96a Compare November 24, 2026 04:40
@ashhart
ashhart merged commit 4ec627a into main Nov 24, 2026
12 checks passed
@ashhart
ashhart deleted the lead/idol-decode-oom branch November 24, 2026 04:40
ashhart added a commit that referenced this pull request Nov 24, 2026
ashhart added a commit that referenced this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant