Repository navigation
Conversation
…t out libcvc keeps no process-wide state in code it controls. The scan blocked new statics, but a change could add the new symbol's line to the allowlist, and changes did: the list went on growing. - ratchet.py (new) fails a change whose allowlist has a line its base's does not; a moved or renamed object counts as new. It runs in the clang-format (changed lines) job, which needs only git and is a required check. - scan.py leaves third-party libraries' own statics out and counts them (THIRD_PARTY): Boost's, VTK's per-file Schwarz counters, libigl's, Eigen's, pocketfft's, the standard library's. Vendored code built into libcvc (SDF, cvc-mesher) stays scanned. - allowlist.txt drops those 289 lines. The 510 left are libcvc's own objects still to move (cvc 358, cvcGL 102, pycvc 32, cvc-cli 9, pycvc_gl 7, cvc_physics_jolt 2); the list only shrinks, to empty. - The scan's message, README and the roadmap say so. Tests: test_scan.py covers the third-party patterns (and that ours still count) and the ratchet (deletions pass, an added or moved line fails, the command's exit codes).
libcvc keeps no process-wide state in code we control. This removes 49 of Ariadne's allowlist lines (cvc 358 -> 309) without touching the registries' API. Bugs fixed: - WebSocket handles were process-wide: one app's documents could send to, read or close another app's connection by handle, and the cap was shared. The table is the app's (app.slot). - The section epoch was the process's; each app has its own (section_epoch(app)). - The building-library cache, open-url's rate limit and the Runtime owner ids are the app's. - Room-lane message ids are per sender under a random tag, as room-call ids are; the helper is shared (conference/message_ids.h). Constants built at first use are constexpr, built where used, or held by their owner: the repeat token, the special-form set, the key-name and capability-token tables (static constexpr), world_rules' word lists and fallbacks (new fallback_avatar / fallback_controller members), OIDC's kReply and options_dict, the placeholder RNG, the script engine's parsed bodies, tvision's palettes, ftxui's TERM check. API: section_epoch(app); capability_tokens() by value; lane_offer_message / lane_answer_message take the sender's serial. Tests: multi_app_integration_test (new): six apps' workloads give the same transcript alone, at once on threads and in reverse order, and differ from each other. StockWorldsMatchTheirTwins writes both apps with one epoch (it relied on the shared one).
This was referenced Nov 12, 2026
Closed
No singletons, Ariadne part 2b: media players, play policy and streams per app [4.0, breaking]
#1163
Closed
…riadne # Conflicts: # tools/singleton_scan/allowlist.txt
#1159 (O7c) kept the last source sea_surface found in a thread_local, so the velocity a fluid field reads after a cell's height at the same point and time did not invert the sideways move again. A thread_local that keeps state between calls is a static cache, which libcvc's no-singletons rule forbids (VOLROVER-LIBRARY-PORTS-ROADMAP.md 1.3, tools/singleton_scan). #1159's release-grpc job, where the scan runs, was cancelled, so the scan never judged it; the next PR that merges master would fail that lane on it. The memo now belongs to the caller: - sea_surface::source_memo, and height() / velocity() overloads that take one. The plain reads share nothing. - fluid_surface::height_with / velocity_with and a surface_memo the caller owns; the defaults ignore it. ocean_surface passes it to the sea. - field_set::apply keeps one memo per cell, for the cell's height and its velocity at the same clipped centre. The memo is keyed on the point, the time and the digest as before, so every value is unchanged.
sea_surface::source kept the last source a thread found in a thread_local (O7c, #1159), which landed after the writable-data allowlist was cut (#1152), so the scan fails on master and on every PR into it. The band for one time (frame) now keeps them, one a slot in a 64-slot table picked by the point's bits, under its own mutex. A fluid field's height-then-velocity pair still finds its source the second time; the values are unchanged (the platform digest test passes as before).
… into p0a/no-singletons-ariadne
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 1: constants, counters and caches. Stacked on #1152 (the allowlist ratchet); merge that first. Breaking (4.0).
libcvc keeps no process-wide state in code we control (Joe, 2026-11-11). This PR removes 49 of Ariadne's allowlist lines without changing the registries' API. Those come next.
Bugs it fixes
ws-sendto,ws-recvfrom orws-closeanother app's connection by handle, and the 16-connection cap was shared. The table is now the app's (app.slot).section_epoch(app)).open-url's one-a-second limit was shared across every app's documents. It is now the app's.conference/message_ids.h).Constants built at first use
These were function-local statics: immutable, but built lazily and shared. They are now
constexpr, or built where they are used, or held by their owner:ariadne.cpp: the repeat index token; the special-form allow-set (per engine).keys.cpp's key-name table andrequires.cpp's capability-token table:static constexprarrays, read-only data.capability_tokens()returns by value.world_rules.cpp: the yes/no word lists (constexpr).world_rules::avatar()/controller()fall back to newfallback_avatar/fallback_controllermembers.oidc_host.cpp:kReply(constexpr).options_dictreturns a new empty dict instead of a shared mutable one.net_intrinsics.cpp:kName(constexpr); the credential placeholder's per-thread RNG (nowstd::random_deviceper placeholder).script_engine.cpp: the two parsed program bodies (parsed per call).tvision_backend.cpp: the palettes, now view members.ftxui_backend.cpp:TERMis read when asked.Public API changes
section_epoch(cvc::app &).capability_tokens()returnsstd::vector<CapabilityToken>by value.lane_offer_message(..., serial)/lane_answer_message(..., serial): the caller passes its sender's serial.world_rulesgainsfallback_avatarandfallback_controller.Tests
multi_app_integration_test(new). Six apps each run a workload, and each app's transcript must be the same three ways: alone, all at once on six threads, and all alive in reverse order. Different apps' transcripts must differ, so seeing another app's state shows. The workload covers the file handler tables, action intrinsics, the state tree and sections; each later PR adds its subsystem.EachAppHasItsOwnSectionEpoch: two apps differ, and making another app moves neither.RoomSceneTest.StockWorldsMatchTheirTwinscompared two apps' leaves, epoch included, so it only passed while the epoch was process-wide. It now writes both with one epoch.Locally (Windows, MSVC 2022): the whole tree builds. These pass:
multi_app_integration_test2,ariadne_registries_test7,app_test121;ariadne_requires_test18,ariadne_runtime_test262,ariadne_loader_test228,ariadne_media_test55;ariadne_script_engine_test30,ariadne_data_test14,world_rules_test7,room_scene_test21;holon_sync_test25,room_avatar_test9,room_chat_test14,ariadne_host_test46;Allowlist: -49 lines (cvc 358 -> 309)
CI
This PR targets #1152's branch, and
ci.ymlruns only on PRs into master, so the full run comes from the push toci/full/no-singletons-ariadne: https://github.com/transfix/libcvc/actions/runs/43154365904. Once #1152 merges, this PR retargets to master and runs there.