| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
📝 Walkthrough
WalkthroughExpose human-readable callable/system names (demangled when available) via new GetName() APIs, propagate those names into logs and duplicate warnings, add a demangling utility, and update tests to set scheduler error policy and expect exceptions for error scenarios. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem🚥 Pre-merge checks | ✅ 2 | ❌ 1 ❌ Failed checks (1 warning)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
|
✅ Actions performed
Review triggered.
|
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)src/engine/src/system/WrappedSystem.hpp (1)69-97: ⚠️ Potential issue | 🟠 Major
Change GetCallableID and GetCallableName to accept const reference to avoid requiring copies of move-only callables.
Passing _system (an lvalue) to by-value GetCallableID and GetCallableName parameters requires a copy. For move-only callables (e.g., lambdas with move-only captures), this fails to compile. Use const TSystem& instead, which is idiomatic for std::hash operators and avoids unnecessary copies.
Suggested change- static FunctionUtils::FunctionID GetCallableID(TSystem callable) + static FunctionUtils::FunctionID GetCallableID(const TSystem &callable) { if constexpr (std::is_class_v<TSystem>) { return typeid(callable).hash_code(); } else { return std::hash<TSystem>{}(callable); } } - static std::string GetCallableName(TSystem callable) + static std::string GetCallableName(const TSystem &callable) { if constexpr (std::is_class_v<TSystem>) { return typeid(callable).name(); } else { return std::to_string(GetCallableID(callable)); } }
In `@src/engine/src/system/WrappedSystem.hpp`: - Around line 89-92: The code uses typeid(callable).name() inside WrappedSystem (see the return in the constexpr branch) which yields mangled names on GCC/Clang; change this to produce human-readable names by demangling on platforms that need it (e.g., call abi::__cxa_demangle or boost::core::demangle when compiling with GCC/Clang) and fall back to typeid(...).name() on other compilers, and also add an optional explicit name override mechanism (e.g., accept a provided name string in the WrappedSystem constructor or a static trait) so callers can supply portable names when demangling is unavailable. Ensure the change targets the code path that currently returns typeid(callable).name() and preserves noexcept/ownership semantics for the returned string.
Sorry, something went wrong.
…System and CallableFunction
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agentsIn `@src/engine/src/system/WrappedSystem.hpp`: - Around line 4-7: Remove the non-portable include <cxxabi.h> from WrappedSystem.hpp since this header does not use any ABI APIs directly; keep the existing include of "Demangle.hpp" and ensure all demangling calls rely on FunctionUtils::DemangleTypeName() from Demangle.hpp (so no references to cxxabi symbols remain in WrappedSystem.hpp). Update the includes in WrappedSystem.hpp to only what is required (e.g., "Demangle.hpp", <string>, <typeinfo>) so the file builds on MSVC and other platforms. In `@src/utils/function-container/src/Demangle.hpp`: - Around line 18-27: The current demangling code may leak memory because abi::__cxa_demangle can allocate even when status != 0; ensure that before returning typeInfo.name() you check if demangledName is non-null and call std::free(demangledName). Update the block around demangledName (the variable returned by __cxa_demangle) in Demangle.hpp so that in the else/failure branch you free demangledName if it was allocated, then return typeInfo.name(). - Around line 3-6: The Demangle.hpp include of <cxxabi.h> and any use of abi::__cxa_demangle must be guarded for non-MSVC platforms; wrap the `#include` <cxxabi.h> with a platform check (e.g. `#if` !defined(_MSC_VER) / `#endif`) and update the demangle function (the symbol-demangling function in Demangle.hpp, e.g., demangle or demangleName) to call abi::__cxa_demangle only when that platform macro is not set, otherwise simply return the input typeInfo.name() string; ensure the fallback preserves signature and behavior (no exception/alloc changes) so callers work on MSVC.
src/engine/src/system/WrappedSystem.hpp (1)72-98: Change GetCallableID and GetCallableName to accept const TSystem&.
The functions only read from the parameter and never modify it. Using const TSystem& improves const-correctness and allows these functions to accept temporaries without unnecessary restriction, while maintaining efficiency for lvalue references.
♻️ Proposed adjustment-static FunctionUtils::FunctionID GetCallableID(TSystem &callable) +static FunctionUtils::FunctionID GetCallableID(const TSystem &callable) { if constexpr (std::is_class_v<TSystem>) { return typeid(callable).hash_code(); } else { return std::hash<TSystem>{}(callable); } } ... -static std::string GetCallableName(TSystem &callable) +static std::string GetCallableName(const TSystem &callable) { if constexpr (std::is_class_v<TSystem>) { return FunctionUtils::DemangleTypeName(typeid(callable)); } else { return std::to_string(GetCallableID(callable)); } }
Sorry, something went wrong.
…nces for better performance
…ngleTypeName for clarity
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agentsIn `@src/utils/function-container/src/Demangle.hpp`: - Around line 3-8: Demangle.hpp conditionally includes <string> and <typeinfo> (used by the function signature that accepts/returns std::string and std::type_info) and misses <memory> (used for std::unique_ptr), which breaks MSVC; fix by moving or adding unconditional includes for <string>, <typeinfo>, and <memory> outside the `#if` defined(__GNUG__) || defined(__clang__) block so that the function declaration/definition referencing std::string, std::type_info, and std::unique_ptr compiles on all compilers (locate the includes near the top of Demangle.hpp and update them accordingly).
Sorry, something went wrong.
There was a problem hiding this comment.
small comment in code
Sorry, something went wrong.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This pull request introduces improvements to function and system identification and logging throughout the engine and utility code. The main focus is on adding support for retrieving and logging the human-readable names of systems and functions, in addition to their IDs. This enhancement improves debugging and log clarity, especially when handling errors or duplicate registrations. The PR also updates related tests to ensure correct error policy handling.
Function and System Naming Enhancements:
Logging and Duplicate Handling Improvements:
Test Enhancements:
Summary by CodeRabbit
Improvements
New Features
Tests