Repository navigation
fix(render): reclaim compiler allocations before returning - #5
Merged
Merged
Conversation
GTrunSec
force-pushed
the
fix/render-compiler-allocation-lifetime
branch
from
November 2, 2026 05:19
1b950df to
97663d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
D2 compilation now owns a short-lived native process so retained Bun worker allocations do not accumulate in the long-lived rendering host. This PR is rebased on the Git-installable root package from current main and prepares the next patch version in the sole root package manifest.
The existing SDK worker still owns D2 parsing/model extraction. The child joins that worker, sends its one result, disconnects IPC and exits naturally. The parent accepts only one result from a zero-exit process, and settles on native close. Spawn and synchronous/asynchronous IPC errors disconnect the channel and wait for close before rejection; no compiler pool, signal-kill fallback, installer layer or public factory is added.
Validation includes 24 sequential real D2 compiles with the unchanged 256 MiB parent RSS guard and seven native lifecycle controls: success, synchronous send failure, disconnected IPC, spawn failure, missing/duplicate result and nonzero exit. A once-only IPC-listener attempt exited before delivering the result locally; the preserved failure led to retaining the channel reference through worker teardown/send acknowledgement. Fixtures are IPC faults, not alternate compilers or nested test runners.
Local validation: typecheck, 76 unit tests (610 assertions), all 36 browser controls with two workers, and full repository REUSE (729 files) passed. Maintained examples and exact-head Linux/macOS/Git-consumer qualification run on this PR. README commands now use the root package; the Org audit records lifetime, source/version ownership, release and Cedar cold/recovery admission boundaries. Limits remain unchanged. No Scheme/Gerbil/SDK or domain algorithm changes are included.
Final exact-head qualification: 97663d4 passed Linux/macOS renderer CI (41393304479), both REUSE checks, all maintained exports and the fresh Git-installed consumer. Local six example checks and all maintained example commands also completed successfully. The release version is read from root package.json after merge; ordinary downstream installation remains a reviewed Git URL.