Skip to content

fix(render): reclaim compiler allocations before returning - #5

Merged
GTrunSec merged 2 commits into
mainfrom
fix/render-compiler-allocation-lifetime
Nov 2, 2026
Merged

GTrunSec merged 2 commits into
mainfrom
fix/render-compiler-allocation-lifetime

Conversation

@GTrunSec

@GTrunSec GTrunSec commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@GTrunSec
GTrunSec force-pushed the fix/render-compiler-allocation-lifetime branch from 1b950df to 97663d4 Compare November 2, 2026 05:19
@GTrunSec
GTrunSec merged commit 1fe2038 into main Nov 2, 2026
4 checks passed
@GTrunSec
GTrunSec deleted the fix/render-compiler-allocation-lifetime branch November 2, 2026 05:23
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