Rebalancer is a domain-specific language and tool for specifying and solving assignment problems (eg, putting balls in boxes with complex rules).
by facebookC++
Last 12 weeks · 377 commits
5 of 6 standards met
What maps every value that doesn't start with / to . The flag docstring is , but nothing rejects invalid values: (all caps, clearly requesting Xpress) silently replays with Gurobi. (HiGHS is a supported LP backend elsewhere in the repo) silently replays with Gurobi. Any typo silently falls back to Gurobi. For a replay/benchmarking tool this silently produces wrong solver and timing data, or a confusing failure later when the silently-chosen solver isn't installed. already validates its equivalent flag and throws a clear error (); the replayer should do the same. Fix Accept the documented / spellings (case-insensitive prefix, matching the existing check style) and with a clear message for anything else. Verification Logic is pure string matching; valid inputs (, , , ) behave exactly as before. Invalid inputs (, , typos, empty) now throw instead of silently using Gurobi. Replayer.cpp is built as an example executable in CI (), so the change is type-checked by the existing Linux/macOS jobs.
Summary: This stack of diffs adds clientId and TTL to getHandle of Thrift Explorer so we can attribute sandbox loads to callers. Similar changes were made to Rebalancer Explorer (D110808769) and Opal Explorer (D112165920) recently. Unidash pages for both explorers shows loads by clientId now: 1, 2. Thrift Explorer Unidash can be updated after this lands. Thrift Explorer could reuse the shared, generic , but needs features the current store lacks. This diff adds them while keeping Opal Explorer and Rebalancer Explorer behavior unchanged. Features Thrift Explorer needs: Compound keys: the store takes the key type and hash as template parameters, so sandboxes can be keyed by any type, such as a pair of strings. Awaitable loads: starts a load if needed and awaits the shared result, so concurrent callers share one load instead of racing. Opal and Rebalancer Explorer instead use the existing fire-and-poll path (, then poll and fetch with ). Injected factories and executors: a new constructor accepts a stateful factory and an external executor. Retained failures: failed loads can be kept with their error message, reported through and the sandbox counts. Configurable eviction: bundles the eviction, load-throttling, and failure-retention options. Implementation notes: Storage was consolidated from four parallel maps (the materializer , a status map, a map, and a map) into a single map of , each holding a plus relaxed-atomic metadata. Load status is now derived by polling the promise. now adds background loads to the instead of firing them detached, so in-flight loads are cancelled and joined when the store is destroyed. Compatibility: The key type defaults to , so existing consumers keep using string keys with the same behavior. is now a synchronous method template , and is no longer a class template parameter. The Opal, Standalone, and Rebalancer handlers were updated to match by dropping and passing the status enum as a template argument. now throws instead of (from the old ); it throws in the same cases (missing, loading, or failed key). The old constructor and the retry-after-failure behavior relied on by Opal and Rebalancer stay the same. Differential Revision: D112927161
Repository: facebook/rebalancer. Description: Rebalancer is a domain-specific language and tool for specifying and solving assignment problems (eg, putting balls in boxes with complex rules). Stars: 18, Forks: 5. Primary language: C++. Languages: C++ (82.7%), Python (9.1%), TypeScript (4.4%), Thrift (1.6%), CMake (1.5%). License: Apache-2.0. Homepage: https://facebook.github.io/rebalancer/ Latest release: v1.0.4 (1mo ago). Open PRs: 3, open issues: 0. Last activity: 7h ago. Community health: 87%. Top contributors: vj-menon, r-barnes, polmauri, kvelakur, yangneu2015, facebook-github-bot, sud03r, xiatingouyang, sahilsd, sravi-in and others.