Skip to main content

Module composition

Module composition 

Source
Expand description

Correct beamr scheduler composition for hot-loading hosts.

Scheduler::with_services silently installs an EMPTY BIF registry (beamr 0.15.1 scheduler/mod.rs:1010-1024). Import resolution is bif-registry-first, so every erlang:* import in hot-loaded bytecode resolves Deferred; guard-BIF dispatch requires a Native entry (beamr guards.rs:193-195) and refuses at the first arithmetic instruction with a process-fatal InvalidOperand("guard bif native import") — the composition defect attributed in frame-host/attribution/gcbif-wedge/ and Artemis’s 2026-07-18 gcbif probe report (Round 2).

Every frame scheduler that hot-loads component bytecode must therefore be composed through compose_scheduler, which populates the registry via beamr’s canonical gate-1 population path (beamr::native::bifs::register_gate1_bifs) and constructs through Scheduler::with_services_and_code_server. As defense in depth, crate::registry::ComponentRegistry::start refuses any hot-loaded module whose committed import table still defers an erlang:* entry.

Enums§

SchedulerCompositionError
A typed refusal from scheduler composition.

Functions§

compose_scheduler
Composes a scheduler whose BIF registry is populated BEFORE any module can load against it.