feat(extractor): extract scene modules (SCENE:DLLS=) like engines

A module DLL has no engine factory: its CMC_ExternObject::resolve compares
TYPE (CXString::equals or operator==), allocates and constructs. The
runner of each type is the vftable its constructor or a virtual installs
whose prepare slot chains to CMC_Runner::prepareMthHashSet (defined when
analysis left it out); registrations, dispatch, signatures, per-type
events and fields then come from the engine passes, limited to the
module's own runners. Snapshots record module_of (the host engine DLL).

An unoptimised run() keeps the switch index in a stack slot; its bounds
are followed through that slot only when the register match finds none.
The batch queue extracts plugins too, the inventory knows MATRIX, QMAN,
INERTIA and BOARD, and the tracker marks module-mapped types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Patryk Gensch
2026-10-28 20:58:40 +01:00
co-authored by Claude Opus 5.5
parent f71cd9a90f
commit 4e65268a1e
7 changed files with 301 additions and 49 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ def test_lock_and_scope_limit(setup):
with pytest.raises(RuntimeError, match='Another'):
batch.run_queue(manifest, out, worker=success)
data = json.loads(manifest.read_text())
data['builds'][0]['scope'] = 'plugin'
data['builds'][0]['scope'] = 'native_dependency'
manifest.write_text(json.dumps(data))
assert batch.run_queue(manifest, out, worker=success)['skipped_scope'] == 1
+12
View File
@@ -122,6 +122,18 @@ def test_runner_factory_maps_shared_and_unnamed_runners(tmp_path):
assert "inherits" not in typ(result, "@") # built-ins do not chain to CMC_Runner
def test_scene_module_types_map_through_the_runner_their_objects_install(tmp_path):
module = Snapshot({"binary": {"name": "Matrix.dll", "sha256": "b" * 64, "module_of": "PIKLIB8.DLL"},
"types": [{"script_name": "MATRIX", "cpp_class": None, "type_id": 10002}],
"methods": [{"owner": "CMC_Matrix", "runner": "CMC_Matrix_Runner", "name": "TICK", "id": 1}],
"method_inheritance": [{"runner": "CMC_Matrix_Runner", "base_runner": "CMC_Runner"}],
"runner_map": {"module": True, "by_type_id": [{"type_id": 10002, "runner": "CMC_Matrix_Runner"}]}})
result = build_tracker([factory_snapshot(), module], emulator(tmp_path))
tick = row(result, "MATRIX", "TICK")["original"][0]
assert (tick["owner"], tick["mapping"]) == ("CMC_Matrix", "module")
assert typ(result, "MATRIX")["inherits"] == ["*"]
def test_builtin_statements_are_read_from_the_parser(tmp_path):
parser = tmp_path / "core/src/pl/genschu/bloomooemulator/interpreter/parser"
parser.mkdir(parents=True)