mirror of
https://github.com/Comfy-Org/comfy-aimdo.git
synced 2026-11-04 23:37:21 +00:00
[PR #116] [MERGED] Fix malloc graph search skipping overlapping alias ranges #124
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-aimdo#124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-aimdo/pull/116
Author: @rattus128
Created: 9/15/2026
Status: ✅ Merged
Merged: 9/15/2026
Merged by: @rattus128
Base:
master← Head:dev/alias-range-search-review📝 Commits (4)
293de00Fix malloc graph search skipping overlapping alias ranges9ea5e09Assert physical page reuse in overlapping alias regressioncc93975Reuse cleanup scan to find the earlier conflicting alias5cf9974Simplify overlapping alias search cleanup📊 Changes
2 files changed (+45 additions, -3 deletions)
View changed files
📝
src/malloc-graph.c(+9 -3)➕
tests/malloc-graph-overlapping-alias-cuda.py(+36 -0)📄 Description
Supersedes #113 with the maintainer review cleanup applied on top. The contributor's three commits are retained unchanged; the cleanup is a separate commit by @rattus128.
The malloc-graph allocator can extend its virtual range even when an existing range satisfies the allocation. This wastes virtual address space and can contribute to exhausting the fixed arena while physical graph memory remains well below that limit.
During a candidate scan,
physical_liveincludes both pre-existing live pages and pages temporarily marked live by that scan. When a repeated physical page is encountered within the candidate, advancing byj + 1skips overlapping windows that no longer contain the earlier occurrence.For example, with the free mapping
[0, 1, 2, 0, 1, 3]and a four-page request, the window starting at virtual index 2 is valid:[2, 0, 1, 3]. Advance past the earlier occurrence on a temporary alias collision; retain the existing advancement otherwise. This preserves the requirement that a returned range contain distinct, available physical pages.The standalone GPU regression creates that layout with small allocations. It verifies virtual and physical reuse and checks distinct values per page for unintended physical aliasing. No model is required.
Validation:
src/malloc-graph.cpasses a C11 syntax check.Contribution agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.