Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Design model

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Normative model for how Beskid heap objects live, how the Abfall tri-color collector interacts with generated code, and how Phase A scheduling constrains mutators before parallel GC (Phase B).

ActorResponsibility
Compiler loweringEmits alloc, write barriers, stack maps, type descriptors
beskid_runtime::gcenter_runtime_scope, heap attachment, GcSnapshot for hosts
Abfall heapConcurrent mark/sweep with STW segments
Fiber schedulerEnsures only one mutator runs Beskid allocations in Phase A
  • Heap objects begin with a type descriptor pointer used for precise scanning.
  • alloc(size, type_desc) creates descriptor-backed payloads via abfall::Heap::allocate_beskid.
  • Strings use BeskidStr; arrays use BeskidArray headers (backing optional per feature flag).
  • Roots: stacks (stack maps), globals (registered roots), external handles (gc_root_handle).
flowchart TB
  mut[Mutator / generated code]
  barrier[gc_write_barrier]
  heap[Abfall tri-color heap]
  stw[STW root scan]
  mut -->|pointer stores| barrier --> heap
  heap -->|mark/sweep| stw
  stw --> heap

Tri-color marking runs concurrently with the mutator where Phase allows; write barriers prevent black→white edges during marking. STW episodes are limited to root scanning and phase transitions.

PhaseMutatorsNotes
A (current)One Beskid mutator at a timeFibers swap on scheduler threads; syscall pool workers must not allocate as mutators
B (target)Parallel mutators with barriersRequires full stack-map coverage and scheduler coordination

See Fiber scheduler and stacks for parking and safepoints.