feat(bex): complete garbage collector implementation - #3003
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hellovai
force-pushed
the
vbv/bex-gc-complete
branch
from
January 20, 2026 08:00
d42e342 to
0eb2803
Compare
hellovai
force-pushed
the
vbv/bex-gc-complete
branch
from
January 20, 2026 08:06
0eb2803 to
bb8f7ea
Compare
Complete the BEX garbage collector by closing 5 identified gaps: - Gap 1: Parked VM roots now collected via VM pointer registry - Gap 2: VM stacks updated with forwarding pointers after GC - Gap 3: TLABs invalidated after GC space swap - Gap 6: Handle race condition fixed with EpochGuard Key changes: - Add parked_vms registry to EpochState for tracking VMs at safepoints - Collect roots from all parked VM stacks during GC - Update parked VM stacks with forwarding pointers after copying - Remove cached ObjectIndex from Handle (always resolve through table) - Add gc_in_progress flag to synchronize new calls with GC - Add EpochGuard token for compile-time epoch protection enforcement - Add heap accessor API for safe external code access (read_string, etc.) - Add GC coordination documentation to module docs
hellovai
force-pushed
the
vbv/bex-gc-complete
branch
from
January 20, 2026 08:14
bb8f7ea to
62220b0
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.
Summary
Complete the BEX garbage collector implementation by closing 5 identified gaps in the engine-level integration:
Key Changes
VM Pointer Registry (Phase 1-2)
parked_vms: Mutex<Vec<VmPtr>>toEpochStatefor tracking VMs at safepointsStack Updates & TLAB Invalidation (Phase 3)
collect_garbage_with_forwarding()that returns the forwarding mapHandle Race Condition Fixes (Phase 4)
ObjectIndexfromHandle- always resolve through tablegc_in_progressflag to synchronize new calls with GCcall_functioninvocations wait for in-progress GC before resolving handlesEpochGuard & Accessor API (Phase 6)
EpochGuardtoken type for compile-time epoch protection enforcementHandle::object_index()now requires&EpochGuard<'_>parameterread_string,read_array,with_object) for safe external accessDocumentation & Tests (Phase 5)
test_gc_updates_forwarding_pointers,test_multiple_handles_survive_gcTest plan
cargo build -p bex_engine -p bex_heap -p bex_external_typescompilescargo test -p bex_engine- all tests pass (including 5 GC tests)cargo test -p bex_heap- 28 tests passcargo test -p bex_external_types- all tests passcargo clippypasseshandle.object_index()without guard fails to compile🤖 Generated with Claude Code