Repository navigation
Conversation
… own Ariadne's document registries were process-wide: what one app registered, every app's documents saw. They are each app's own now (app.slot), and the loader checks a document against the app it loads for. Allowlist -19 lines (cvc 309 -> 290). - Widget types: register_widget_type / register_known_widget_type / has_widget_type take the app; the backends' register_widget(app, ...) declares a native widget to that app; register_status_dot_widget takes the app. - .ari blocks: register_ari_block / has_ari_block take the app; register_world_block / register_server_block / register_relay_block register per app (their process-wide once-flags are gone). - Data decoders: register_data_decoder / has_data_decoder / data_decoders take the app; every app starts with the built-ins. DataStore::of keeps the store in the app's slot. - Script engines: register / unregister / find / has_script_engine take the app. AppRuntime::use_script_engine registers the engine on its app, so ari's, arigl's and ariadne_python's engines no longer register process-wide. HostFacts::app answers the language tokens; capability_hint takes the app. - The loader: load_string(app, yaml), load_file(app, path); its context carries the app into imports and mounts. Tests: ariadne_registries_test adds two-apps (both orders), built-ins per app and threads cases; multi_app_integration_test's workload adds the registries; the script-engine and requires tests check another app sees nothing. Tests that registered and then loaded use one app; parse-only tests use a file-local fresh_load. Two scene-world tests had passed only because an earlier test registered the world: block for the process; their helpers now register it on their own app.
arisrvx reads its server document before it attaches Python, and a
server document never calls use_script_engine, so after script engines
became each app's own the relay's app had none: requires: python failed
("this host does not provide what the document requires: python"), and
the room-call tests that run such a document failed with it.
python::Engine::register_on(app) registers the engine on an app;
arisrvx calls it as soon as its app exists, and attach() does it for a
server host's app.
This was referenced Nov 12, 2026
Closed
Owner
Author
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.
No singletons, Ariadne part 2: the document registries are each app's own. Stacked on #1155 (which is on #1152). Breaking (4.0).
libcvc keeps no process-wide state in code we control. Ariadne's document registries were process-wide, so what one app registered, every app's documents saw. They are now each app's own (
app.slot), and the loader checks a document against the app it loads for.What moved onto the app
register_widget_type(app, type, emit),register_known_widget_type(app, type)andhas_widget_type(app, type).ImGuiBackend::register_widget(app, type, draw)andFtxuiBackend::register_widget(app, type, draw).register_status_dot_widget(backend, app)..ariblocks.register_ari_block(app, key, parse)andhas_ari_block(app, key).register_world_block(app),register_server_block(app)andregister_relay_block(app). Their process-wide once-flags are gone.register_data_decoder(app, as, decoder),has_data_decoder(app, as)anddata_decoders(app). Every app starts with the built-ins.DataStore::of(app)keeps the store in the app's slot, not in a table keyed byapp*.register_script_engine(app, engine),unregister_script_engine(app, language),find_script_engine(app, language)andhas_script_engine(app, language).AppRuntime::use_script_engine(engine)now registers the engine on its runtime's app. So ari's and arigl's Wasm engine and the Python engine (src/ariadne_python) no longer register process-wide at startup.python,wasm,python.<module>) are answered fromHostFacts::app, whichRuntimesets.capability_hint(app, name).load_string(app, yaml)andload_file(app, path). The parse context carries the app into imports and mounts, for the widget-type, block, decoder andcustoms:checks and for the block parsers.Callers updated
fresh_load(yaml)/fresh_load_file(path). It loads against a new app, so only the built-ins apply, and nothing is shared.pycvc does not wrap any of these.
Allowlist: -19 lines (cvc 309 -> 290)
ariadne.cpp:widget_registry,widget_mutex,known_widget_typesand their guards.loader.cpp:block_registry,block_mutexand the guard.data.cpp:decoder_map,decoder_mutex,stores,stores_mutexand their guards.script_engine.cpp:engines,engines_mutexand the guard.world_rules.cppandserver_document.cpp: the once-flags.Tests
ariadne_registries_test:DocumentRegistriesAreEachAppsOwn: two apps each register a widget type, a block and a decoder, in both orders. A document naming each app's three loads cleanly on its own app and gets all three warnings on the other.EveryAppStartsWithTheBuiltInDecodersOnly: removing a built-in from one app leaves it on another.AppsOnOtherThreadsKeepTheirOwnDocumentRegistries: four apps on four threads.multi_app_integration_test: the workload adds the document registries. App i registers w, b and d, then loads a document naming every app's blocks; only its own are kept, alone, at once on threads, and in reverse order.ariadne_script_engine_test: an engine registered on one app is not on another, anduse_script_engineregisters it on the runtime's app only.ariadne_requires_test: another app's facts, and facts with no app, don't see an engine.CI
This PR targets #1155's branch, so
ci.yml's full run comes from the push toci/full/no-singletons-ariadne-2: https://github.com/transfix/libcvc/actions/runs/43157470987.Locally (Windows, MSVC 2022): the whole tree builds (libraries, cvcGL, the hosts, the examples, pycvc), and these pass: multi_app_integration_test 2, ariadne_registries_test 10, app_test 121, ariadne_requires_test 18, ariadne_runtime_test 262, ariadne_loader_test 228, ariadne_media_test 55, ariadne_script_engine_test 31, ariadne_data_test 14, ariadne_doc_fetch_test 9, ariadne_host_test 46, ariadne_scene_tf_test 10, ariadne_scene_world_test 25, ariadne_stream_view_test 5, world_rules_test 7, room_scene_test 21, holon_sync_test 25, room_avatar_test 9, room_chat_test 14, and the cvcGL ariadne, media, stream and room-view tests (12). ariadne_wasm_test is not built here (no Wasm runtime); CI runs it.
Update: 57460d6 fixes arisrvx (a server host now registers its Python engine on its app before it reads its server document). Full run: https://github.com/transfix/libcvc/actions/runs/43171987170.